pg_class
- pg_class catalogs tables and mostly
+ pg_class catalogs tables and most
everything else that has columns or is otherwise similar to a
table. This includes indexes (but see also
pg_index), sequences, views, and some
- kinds of special relation. Below, when we mean all of these
+ kinds of special relation; see relkind>.
+. Below, when we mean all of these
kinds of objects we speak of relations
. Not all
fields are meaningful for all relation types.
relfilenode
oid
- Name of the on-disk file of this relation
+ Name of the on-disk file of this relation; 0 if none
|
'r' = ordinary table, 'i' = index, 'S' = sequence, 'v' = view,
- 's' = special, 't' = secondary TOAST table
+ 'c' = composite type, 's' = special, 't' = TOAST table
This catalog stores information about data types. Scalar types
(base types>) are created with CREATE TYPE.
- A complex type is also created for each table in the database, to
+ A complex type is automatically created for each table in the database, to
represent the row structure of the table. It is also possible to create
+ complex types with CREATE TYPE AS, and
derived types with CREATE DOMAIN.
If this is a complex type (see
typtype), then this field points to
- the pg_class entry that defines the
- corresponding table. A table could theoretically be used as a
- composite data type, but this is only partly functional.
+ the pg_class entry that defines the
+ corresponding table. (For a free-standing composite type, the
+ pg_class entry doesn't really represent
+ a table, but it is needed anyway for the type's
+ pg_attribute entries to link to.)
Zero for non-complex types.