From: Tom Lane Date: Mon, 15 Oct 2001 22:47:47 +0000 (+0000) Subject: Add note about pg_stats to pg_statistic entry; add sections for X-Git-Tag: REL7_2_BETA1~83 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=daf72bba912017abaf821671ba2eb8ece216f364;p=postgresql Add note about pg_stats to pg_statistic entry; add sections for pg_largeobject, pg_listener, pg_rewrite, pg_trigger; miscellaneous small improvements. --- diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index 0b9c10d3bb..b5e7fffe8e 100644 --- a/doc/src/sgml/catalogs.sgml +++ b/doc/src/sgml/catalogs.sgml @@ -1,6 +1,6 @@ @@ -63,7 +63,7 @@ pg_attribute - table columns (attributes, fields) + table columns (attributes, fields) @@ -73,7 +73,7 @@ pg_database - databases + databases within this database cluster @@ -83,7 +83,7 @@ pg_group - user groups + groups of database users @@ -162,8 +162,7 @@ More detailed documentation of most catalogs follow below. The catalogs that relate to index access methods are explained in the - Programmer's Guide. Some catalogs don't - have any documentation, yet. + Programmer's Guide. @@ -210,13 +209,13 @@ aggtransfn regproc (function) - + pg_proc.oid Transition function aggfinalfn regproc (function) - + pg_proc.oid Final function @@ -431,7 +430,7 @@ Always -1 in storage, but when loaded into a tuple descriptor - in memory this may be updated cache the offset of the attribute + in memory this may be updated to cache the offset of the attribute within the tuple. @@ -653,7 +652,8 @@ bool True if this table is shared across all databases in the - cluster. + cluster. Only certain system catalogs (such as + pg_database) are shared. @@ -741,7 +741,9 @@ relhasrules bool - Table has rules + Table has rules; see + pg_rewrite catalog + @@ -772,14 +774,19 @@ The pg_database catalog stores information - about the available databases. The - pg_database table is shared between all - databases of a cluster. Databases are created with the - CREATE DATABASE. Consult the + about the available databases. Databases are created with the + CREATE DATABASE command. Consult the Administrator's Guide for details about the meaning of some of the parameters. + + Unlike most system catalogs, pg_database + is shared across all databases of a cluster: there is only one + copy of pg_database per cluster, not + one per database. + + pg_database Columns @@ -959,6 +966,14 @@ Guide for information about user permission management. + + Because user and group identities are cluster-wide, + pg_group + is shared across all databases of a cluster: there is only one + copy of pg_group per cluster, not + one per database. + +
pg_group Columns @@ -1039,7 +1054,7 @@ indproc - oid + regproc pg_proc.oid The registered procedure if this is a functional index @@ -1086,7 +1101,8 @@ indisprimarybool - If true, this index is a unique index that represents the primary key of the table. + If true, this index represents the primary key of the table. + (indisunique should always be true when this is true.) @@ -1147,7 +1163,7 @@ oid pg_class.oid - This is the reference to the parent table, from which the table + This is the reference to the parent table, which the table referenced by inhrelid inherited from. @@ -1158,7 +1174,7 @@ int4 - If there is more than one subtable/parent pair (multiple + If there is more than one parent for a subtable (multiple inheritance), this number tells the order in which the inherited columns are to be arranged. The count starts at 1. @@ -1250,6 +1266,132 @@ +
+ pg_largeobject + + + pg_largeobject holds the data making up + large objects. A large object is identified by an + OID assigned when it is created. Each large object is broken into + segments or pages small enough to be conveniently stored as rows + in pg_largeobject. + The amount of data per page is defined to be LOBLKSIZE (which is currently + BLCKSZ/4, or typically 2Kbytes). + + +
+ pg_largeobject Columns + + + + + Name + Type + References + Description + + + + + + loid + oid + + Identifier of the large object that includes this page + + + + pageno + int4 + + Page number of this page within its large object + (counting from zero) + + + + data + bytea + + + Actual data stored in the large object. + This will never be more than LOBLKSIZE bytes, and may be less. + + + + +
+ + + Each row of pg_largeobject holds data + for one page of a large object, beginning at + byte offset (pageno * LOBLKSIZE) within the object. The implementation + allows sparse storage: pages may be missing, and may be shorter than + LOBLKSIZE bytes even if they are not the last page of the object. + Missing regions within a large object read as zeroes. + + + + + +
+ pg_listener + + + pg_listener supports the LISTEN + and NOTIFY commands. A listener creates an entry in + pg_listener for each notification name + it is listening for. A notifier scans pg_listener + and updates each matching entry to show that a notification has occurred. + The notifier also sends a signal (using the PID recorded in the table) + to awaken the listener from sleep. + + + + pg_listener Columns + + + + + Name + Type + References + Description + + + + + + relname + name + + Notify condition name. (The name need not match any actual + relation in the database; the term relname is historical.) + + + + + listenerpid + int4 + + PID of the backend process that created this entry. + + + + notification + int4 + + + Zero if no event is pending for this listener. If an event is + pending, the PID of the backend that sent the notification. + + + + +
+ +
+ +
pg_operator @@ -1489,7 +1631,8 @@ proretset bool - Function returns a set (probably not functional) + Function returns a set (ie, multiple values of the specified + datatype) @@ -1542,7 +1685,7 @@ This tells the function handler how to invoke the function. It might be the actual source code of the function for interpreted languages, a link symbol, a file name, or just about anything - else, depending the implementation language/call convention. + else, depending on the implementation language/call convention. @@ -1550,12 +1693,26 @@ probin bytea - ? + Additional information about how to invoke the function. + Again, the interpretation is language-specific. + + + Currently, prosrc contains the function's C-language name (link symbol) + for compiled functions, both built-in and dynamically loaded. For all + other language types, prosrc contains the function's source text. + + + + Currently, probin is unused except for dynamically-loaded C functions, + for which it gives the name of the shared library file containing the + function. + +
@@ -1608,7 +1765,7 @@ rcsrc text - A human-readable representation of the consraint expression + A human-readable representation of the constraint expression
@@ -1624,6 +1781,93 @@ +
+ pg_rewrite + + + This system catalog stores rewrite rules for tables and views. + + + + pg_rewrite Columns + + + + + Name + Type + References + Description + + + + + + rulename + name + + Rule name + + + + ev_type + char + + Event type that the rule is for: '1' = SELECT, + '2' = UPDATE, '3' = INSERT, '4' = DELETE + + + + ev_class + oid + pg_class.oid + The table this rule is for + + + + ev_attr + int2 + + The column this rule is for (currently, always zero to + indicate the whole table) + + + + is_instead + bool + + True if the rule is an INSTEAD rule + + + + ev_qual + text + + Expression tree (in the form of a nodeToString representation) + for the rule's qualifying condition + + + + ev_action + text + + Query tree (in the form of a nodeToString representation) + for the rule's action + + + +
+ + + + pg_class.relhasrules + must be true if a table has any rules in this catalog. + + + +
+ +
pg_shadow @@ -1631,7 +1875,7 @@ pg_shadow contains information about database users. The name stems from the fact that this table should not be readable by the public since it contains passwords. - pg_user is a view on + pg_user is a publicly readable view on pg_shadow that blanks out the password field. @@ -1640,6 +1884,14 @@ information about user and permission management. + + Because user identities are cluster-wide, + pg_shadow + is shared across all databases of a cluster: there is only one + copy of pg_shadow per cluster, not + one per database. + + pg_shadow Columns @@ -1743,6 +1995,20 @@ src/include/catalog/pg_statistic.h. + + pg_statistic should not be readable by the + public, since even statistical information about a table's contents + may be considered sensitive. (Example: minimum and maximum values + of a salary column might be quite interesting.) + pg_stats is a publicly readable view on + pg_statistic that only exposes information + about those tables that are readable by the current user. + pg_stats is also designed to present the + information in a more readable format than the underlying + pg_statistic table --- at the cost that + its schema must be extended whenever new slot types are added. + +
pg_statistic Columns @@ -1843,9 +2109,144 @@ +
+ pg_trigger + + + This system catalog stores triggers on tables. See under + CREATE TRIGGER for more information. + + +
+ pg_trigger Columns + + + + + Name + Type + References + Description + + + + + + tgrelid + oid + pg_class.oid + The table this trigger is on + + + + tgname + name + + Trigger name (need not be unique) + + + + tgfoid + oid + pg_proc.oid + The function to be called + + + + tgtype + int2 + + Bitmask identifying trigger conditions + + + + tgenabled + bool + + True if trigger is enabled (not presently checked everywhere + it should be, so disabling a trigger by setting this false does not + work reliably) + + + + tgisconstraint + bool + + True if trigger is a RI constraint + + + + tgconstrname + name + + RI constraint name + + + + tgconstrrelid + oid + pg_class.oid + The table referenced by an RI constraint + + + + tgdeferrable + bool + + True if deferrable + + + + tginitdeferred + bool + + True if initially deferred + + + + tgnargs + int2 + + Number of argument strings passed to trigger function + + + + tgattr + int2vector + + Currently unused + + + + tgargs + bytea + + Argument strings to pass to trigger, each null-terminated + + + +
+ + + + pg_class.reltriggers + needs to match up with the entries in this table. + + + +
+ +
pg_type + + This catalog stores information about datatypes. Scalar types + (base types) are created with CREATE TYPE. + A complex type is also created for each table in the database, to + represent the row structure of the table. + + pg_type Columns @@ -1913,8 +2314,8 @@ typtype is b for - a basic type and c for a catalog type (i.e., - a table). If typtype is + a base type and c for a complex type (i.e., + a table's row type). If typtype is c, typrelid is the OID of the type's entry in pg_class. @@ -1925,7 +2326,10 @@ typisdefined bool - ??? + True if the type is defined, false if this is a placeholder + entry for a not-yet-defined type. When typisdefined is false, + nothing except the type name and OID can be relied on. + @@ -1940,7 +2344,7 @@ oid pg_class.oid - If this is a catalog type (see + 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