Created
February 19, 2019 08:43
-
-
Save hooopo/6649e09b6cbe34d0a7128b55ad203387 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\copy (SELECT row_number() over() AS "序号", n.nspname as "系统名", c.relname as "表名",pg_catalog.pg_size_pretty(pg_catalog.pg_table_size(c.oid)) as "大小",pg_catalog.obj_description(c.oid, 'pg_class') as "中文名",c.reltuples AS "条数" FROM pg_catalog.pg_class c LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace WHERE c.relkind IN ('r','') AND n.nspname <> 'pg_catalog' AND n.nspname <> 'information_schema' AND n.nspname !~ '^pg_toast' AND pg_catalog.pg_table_is_visible(c.oid) ORDER BY 1 DESC,2) to '/tmp/tables.csv' WITH CSV HEADER; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment