The system tables show the information under the current operations database, and the objects are from the current database. Because different system tables use different name fields to record the OID of different objects, the table references that table, and the table references another table, so these field names are not very good to remember.
Pg_class (System table: Object) is an object table , each field of the table is ' rel ' beginning, clearly is 'relation ' the word abbreviation, meaning ' relationship '. the Relkind field in the table determines the object type: R = Normal table, i = index, s = sequence, V = view, c = Compound type, S = special, T = Toast table. the Relnamespace (schema name) and Relowner (owner) that the object belongs to are displayed with its corresponding OID, so it is intuitive to see the actual name to be federated pg_namespace (System table: Schema) and Pg_ Roles (System view: Role) , both tables and views have OID fields.
Take the query object's owning pattern and its name as an example:
SelectRelname,relkind,relnamespace,nspname fromPg_class c,pg_namespace NwhereN.oid=16424 andC.relnamespace=n.oid Relname|Relkind|Relnamespace|Nspname-------------------+---------+--------------+---------Website_pkey|I| 16424 |Yun website|R| 16424 |Yun Board_pkey|I| 16424 |Yun Board|R| 16424 |Yun Spam_keyword_pkey|I| 16424 |Yun Spam_keyword|R| 16424 |Yun
OID data type, the query can have no single quotation mark. The OID field in Pg_namespace is implied and cannot be queried directly with SELECT * from.
SelectOid* fromPg_namespace
OID | Nspname | Nspowner | Nspacl
-------+--------------------+----------+-------------------------------------
99 | Pg_toast | 10 |
11194 | Pg_temp_1 | 10 |
11195 | Pg_toast_temp_1 | 10 |
11 | Pg_catalog | 10 | {Postgres=uc/postgres,=u/postgres}
11469 | Information_schema | 10 | {Postgres=uc/postgres,=u/postgres}
2200 | Public | 10 | {Postgres=uc/postgres,=uc/postgres}
16424 | Yun | 16392 |
16551 | Audit | 16392 |
PS: A comma is actually a symbol that acts as a link between several columns and columns, and is a symbol that directly affects the results of the query, not because multiple fields are checked so that it is easy to read and look good.
Pg_namespace has a oid,pg_roles of the user's OID.
Pg_attribute, there is such a table to record all the fields of the table, magical.
postgresql-system tables, System views