db_lei2=# select * from information_schema.schemata; catalog_name | schema_name | schema_owner | default_character_set_catalog | default_character_set_schema | default_character_set_name | sql_path --------------+--------------------+--------------+-------------------------------+------------------------------+----------------------------+---------- db_lei2 | s_lei_2 | pg102 | | | | db_lei2 | information_schema | pg102 | | | | db_lei2 | public | pg102 | | | | db_lei2 | pg_catalog | pg102 | | | | db_lei2 | pg_toast_temp_1 | pg102 | | | | db_lei2 | pg_temp_1 | pg102 | | | | db_lei2 | pg_toast | pg102 | | | | (7 rows)db_lei2=# select * from pg_namespace; nspname | nspowner | nspacl --------------------+----------+---------------------------- pg_toast | 10 | pg_temp_1 | 10 | pg_toast_temp_1 | 10 | pg_catalog | 10 | {pg102=UC/pg102,=U/pg102} public | 10 | {pg102=UC/pg102,=UC/pg102} information_schema | 10 | {pg102=UC/pg102,=U/pg102} s_lei_2 | 10 | (7 rows)db_lei2=# select oID,* from pg_namespace; oID | nspname | nspowner | nspacl -------+--------------------+----------+---------------------------- 99 | pg_toast | 10 | 11736 | pg_temp_1 | 10 | 11737 | pg_toast_temp_1 | 10 | 11 | pg_catalog | 10 | {pg102=UC/pg102,=U/pg102} 2200 | public | 10 | {pg102=UC/pg102,=UC/pg102} 12921 | information_schema | 10 | {pg102=UC/pg102,=U/pg102} 40967 | s_lei_2 | 10 | (7 rows)db_lei2=# db_lei2=# select * from pg_authID where oID=10; rolname | rolsuper | rolinherit | rolcreaterole | rolcreatedb | rolcanlogin | rolreplication | rolbypassrls | rolconnlimit | rolpassword | rolvalIDuntil ---------+----------+------------+---------------+-------------+-------------+----------------+--------------+--------------+-------------+--------------- pg102 | t | t | t | t | t | t | t | -1 | | (1 row)db_lei2=# select SELECT pg_relation_filepath('pg_db_role_setting');ERROR: Syntax error at or near "SELECT"liNE 1: select SELECT pg_relation_filepath('pg_db_role_setting'); ^db_lei2=# SELECT pg_relation_filepath('pg_db_role_setting'); pg_relation_filepath ---------------------- global/2964(1 row)db_lei2=# SELECT pg_relation_filepath('pg_class'); pg_relation_filepath ---------------------- base/40966/1259(1 row)db_lei2=# SELECT pg_relation_filepath('pg_authID'); pg_relation_filepath ---------------------- global/1260(1 row)db_lei2=# SELECT pg_relation_filepath('pg_roles'); pg_relation_filepath ---------------------- (1 row)db_lei2=# SELECT pg_relation_filepath('pg_namespace'); pg_relation_filepath ---------------------- base/40966/2615(1 row)db_lei2=# SELECT pg_relation_filepath('information_schema.schemata'); pg_relation_filepath ---------------------- (1 row)db_lei2=# SELECT pg_relation_filepath('schemata');ERROR: relation "schemata" does not existliNE 1: SELECT pg_relation_filepath('schemata'); ^db_lei2=# db_lei2=#
[pg102@pgserver ~]$ psql -p 5532 -d postgrespsql (10.2)Type "help" for help.postgres=# \set ECHO_HIDDEN onpostgres=# \dnS+********* query **********SELECT n.nspname AS "name",pg_catalog.pg_get_userbyID(n.nspowner) AS "Owner",pg_catalog.array_to_string(n.nspacl,E'\n') AS "Access privileges",pg_catalog.obj_description(n.oID,'pg_namespace') AS "Description"FROM pg_catalog.pg_namespace nORDER BY 1;************************** List of schemas name | Owner | Access privileges | Description --------------------+-------+-------------------+---------------------------------- information_schema | pg102 | pg102=UC/pg102 +| | | =U/pg102 | pg_catalog | pg102 | pg102=UC/pg102 +| system catalog schema | | =U/pg102 | pg_temp_1 | pg102 | | pg_toast | pg102 | | reserved schema for TOAST tables pg_toast_temp_1 | pg102 | | public | pg102 | pg102=UC/pg102 +| standard public schema | | =UC/pg102 | (6 rows)postgres=#总结
以上是内存溢出为你收集整理的pg schema全部内容,希望文章能够帮你解决pg schema所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)