# Postgres
# psql
show all tables in all schema
\dt *.*
show all tables in schema hhh
\dt hhh.*
The PostgreSQL Catalog
PostgreSQL stores the metadata information about the database and cluster in the schema 'pg_catalog'. This information is partially used by PostgreSQL itself to keep track of things itself, but it also is presented so external people / processes can understand the inside of the databases too.
what is COLLATE pg_catalog."default
oid
查看连接
select * from pg_stat_activity;
pg_dump 某一张表
pg_dump --host aaa.bbb.ccc.ddd --port 5432 --username user_name --format plain --verbose --file "output.sql" --table schems.table_name database_name
删除 schema 以及内部的所有表
drop schema schema_name cascade
查看某个表的 oid
select 'table_name'::regclass::oid
查看某个 schema 的 oid
SELECT 'public'::regnamespace::oid;