列出表名
SELECT tablename FROM pg_tables
WHERE tablename NOT LIKE 'pg%'
AND tablename NOT LIKE 'sql_%'
ORDER BY tablename;
列出数据库名
\l
或
SELECT datname FROM pg_database;
切换数据库
\c 数据库名
查看表结构:
\d table
---
\l
\d table
\?
列出表名
SELECT tablename FROM pg_tables
WHERE tablename NOT LIKE 'pg%'
AND tablename NOT LIKE 'sql_%'
ORDER BY tablename;
列出数据库名
\l
或
SELECT datname FROM pg_database;
切换数据库
\c 数据库名
查看表结构:
\d table
---
\l
\d table
\?
转载于:https://www.cnblogs.com/pxpxstudy/p/3731109.html