[sql] view plaincopy
- 1、相当与mysql的show databases;
[sql] view plaincopy
- select datname from pg_database;
[sql] view plaincopy
- 2、相当于mysql的show tables;
[sql] view plaincopy
- SELECT table_name FROM information_schema.tables WHERE table_schema = ‘public‘;
public 是默认的schema的名字
[sql] view plaincopy
- 3、相当与mysql的describe table_name;
[sql] view plaincopy
- SELECT column_name FROM information_schema.columns WHERE table_name =‘table_name‘;
[sql] view plaincopy
- ‘table_name‘是要查询的表的名字
postgresql的show databases、show tables、describe table操作,布布扣,bubuko.com
时间: 2024-10-22 19:05:04