|
1 | 1 | <!-- |
2 | 2 | Documentation of the system catalogs, directed toward PostgreSQL developers |
3 | | - $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.61 2002/09/22 19:42:50 tgl Exp $ |
| 3 | + $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.62 2002/09/24 21:26:44 tgl Exp $ |
4 | 4 | --> |
5 | 5 |
|
6 | 6 | <chapter id="catalogs"> |
|
232 | 232 | <entry>aggfinalfn</entry> |
233 | 233 | <entry><type>regproc</type></entry> |
234 | 234 | <entry>pg_proc.oid</entry> |
235 | | - <entry>Final function</entry> |
| 235 | + <entry>Final function (zero if none)</entry> |
236 | 236 | </row> |
237 | 237 | <row> |
238 | 238 | <entry>aggtranstype</entry> |
|
685 | 685 | <entry><type>int2</type></entry> |
686 | 686 | <entry></entry> |
687 | 687 | <entry> |
688 | | - This is a copy of the |
| 688 | + This is a copy of |
689 | 689 | <structname>pg_type</structname>.<structfield>typlen</structfield> |
690 | | -for this column's type. |
| 690 | +of this column's type. |
691 | 691 | </entry> |
692 | 692 | </row> |
693 | 693 |
|
|
732 | 732 | <structfield>atttypmod</structfield> records type-specific data |
733 | 733 | supplied at table creation time (for example, the maximum |
734 | 734 | length of a <type>varchar</type> column). It is passed to |
735 | | - type-specific input and output functions as the third |
736 | | - argument. The value will generally be -1 for types that do not |
737 | | - need typmod. |
| 735 | + type-specific input functions and length coercion functions. |
| 736 | + The value will generally be -1 for types that do not need typmod. |
738 | 737 | </entry> |
739 | 738 | </row> |
740 | 739 |
|
|
754 | 753 | <entry><type>char</type></entry> |
755 | 754 | <entry></entry> |
756 | 755 | <entry> |
757 | | -A copy of |
| 756 | +Normally a copy of |
758 | 757 | <structname>pg_type</structname>.<structfield>typstorage</structfield> |
759 | | - of this column's type |
| 758 | + of this column's type. For TOASTable datatypes, this can be altered |
| 759 | + after column creation to control storage policy. |
760 | 760 | </entry> |
761 | 761 | </row> |
762 | 762 |
|
|
922 | 922 | table. This includes indexes (but see also |
923 | 923 | <structname>pg_index</structname>), sequences, views, and some |
924 | 924 | kinds of special relation; see <structfield>relkind</>. |
925 | | -. Below, when we mean all of these |
| 925 | + Below, when we mean all of these |
926 | 926 | kinds of objects we speak of <quote>relations</quote>. Not all |
927 | 927 | fields are meaningful for all relation types. |
928 | 928 | </para> |
|
1287 | 1287 |
|
1288 | 1288 | <row> |
1289 | 1289 | <entry>conkey</entry> |
1290 | | - <entry><type>smallint[]</type></entry> |
| 1290 | + <entry><type>int2[]</type></entry> |
1291 | 1291 | <entry>pg_attribute.attnum</entry> |
1292 | 1292 | <entry>If a table constraint, list of columns which the constraint constrains</entry> |
1293 | 1293 | </row> |
1294 | 1294 |
|
1295 | 1295 | <row> |
1296 | 1296 | <entry>confkey</entry> |
1297 | | - <entry><type>smallint[]</type></entry> |
| 1297 | + <entry><type>int2[]</type></entry> |
1298 | 1298 | <entry>pg_attribute.attnum</entry> |
1299 | 1299 | <entry>If a foreign key, list of the referenced columns</entry> |
1300 | 1300 | </row> |
|
1448 | 1448 | <entry>datdba</entry> |
1449 | 1449 | <entry><type>int4</type></entry> |
1450 | 1450 | <entry>pg_shadow.usesysid</entry> |
1451 | | - <entry>Owner of the database,initially who created it</entry> |
| 1451 | + <entry>Owner of the database,usually the user who created it</entry> |
1452 | 1452 | </row> |
1453 | 1453 |
|
1454 | 1454 | <row> |
|
1584 | 1584 |
|
1585 | 1585 | <row> |
1586 | 1586 | <entry>objsubid</entry> |
1587 | | - <entry><type>integer</type></entry> |
| 1587 | + <entry><type>int4</type></entry> |
1588 | 1588 | <entry></entry> |
1589 | 1589 | <entry>For a table attribute, this is the attribute's |
1590 | 1590 | column number (the objid and classid refer to the table itself). |
|
1608 | 1608 |
|
1609 | 1609 | <row> |
1610 | 1610 | <entry>refobjsubid</entry> |
1611 | | - <entry><type>integer</type></entry> |
| 1611 | + <entry><type>int4</type></entry> |
1612 | 1612 | <entry></entry> |
1613 | 1613 | <entry>For a table attribute, this is the attribute's |
1614 | | - column number (theobjid andclassid refer to the table itself). |
| 1614 | + column number (therefobjid andrefclassid refer to the table itself). |
1615 | 1615 | For all other object types, this field is presently zero. |
1616 | 1616 | </entry> |
1617 | 1617 | </row> |
|
1694 | 1694 | <para> |
1695 | 1695 | The pg_description table can store an optional description or |
1696 | 1696 | comment for each database object. Descriptions can be manipulated |
1697 | | - with the <command>COMMENT</command> command. Client applications |
1698 | | - can view the descriptions by joining with this table. Many built-in |
1699 | | - system objects have comments associated with them that are shown by |
| 1697 | + with the <command>COMMENT</command> command and viewed with |
1700 | 1698 | <application>psql</application>'s <literal>\d</literal> commands. |
| 1699 | + Descriptions of many built-in system objects are provided in the initial |
| 1700 | + contents of pg_description. |
1701 | 1701 | </para> |
1702 | 1702 |
|
1703 | 1703 | <table> |
|
1837 | 1837 | <entry>indexrelid</entry> |
1838 | 1838 | <entry><type>oid</type></entry> |
1839 | 1839 | <entry>pg_class.oid</entry> |
1840 | | - <entry>Theoid of the pg_class entry for this index</entry> |
| 1840 | + <entry>TheOID of the pg_class entry for this index</entry> |
1841 | 1841 | </row> |
1842 | 1842 |
|
1843 | 1843 | <row> |
1844 | 1844 | <entry>indrelid</entry> |
1845 | 1845 | <entry><type>oid</type></entry> |
1846 | 1846 | <entry>pg_class.oid</entry> |
1847 | | - <entry>Theoid of the pg_class entry for the table this index is for</entry> |
| 1847 | + <entry>TheOID of the pg_class entry for the table this index is for</entry> |
1848 | 1848 | </row> |
1849 | 1849 |
|
1850 | 1850 | <row> |
1851 | 1851 | <entry>indproc</entry> |
1852 | 1852 | <entry><type>regproc</type></entry> |
1853 | 1853 | <entry>pg_proc.oid</entry> |
1854 | | - <entry>The registered procedure if this is a functional index</entry> |
| 1854 | + <entry>The function's OID if this is a functional index, |
| 1855 | + else zero</entry> |
1855 | 1856 | </row> |
1856 | 1857 |
|
1857 | 1858 | <row> |
|
1863 | 1864 | <symbol>INDEX_MAX_KEYS</symbol> values that indicate which |
1864 | 1865 | table columns this index pertains to. For example a value of |
1865 | 1866 | <literal>1 3</literal> would mean that the first and the third |
1866 | | - column make up the index key. |
| 1867 | + column make up the index key. For a functional index, these |
| 1868 | + columns are the inputs to the function, and the function's return |
| 1869 | + value is the index key. |
1867 | 1870 | </entry> |
1868 | 1871 | </row> |
1869 | 1872 |
|
|
1912 | 1915 | <entry><type>text</type></entry> |
1913 | 1916 | <entry></entry> |
1914 | 1917 | <entry>Expression tree (in the form of a nodeToString representation) |
1915 | | - for partial index predicate</entry> |
| 1918 | + for partial index predicate. Empty string if not a partial |
| 1919 | + index.</entry> |
1916 | 1920 | </row> |
1917 | 1921 | </tbody> |
1918 | 1922 | </tgroup> |
|
1947 | 1951 | <entry><type>oid</type></entry> |
1948 | 1952 | <entry>pg_class.oid</entry> |
1949 | 1953 | <entry> |
1950 | | - This is the reference to the subtable, that is, it records the |
1951 | | - fact that the identified table is inherited from some other |
1952 | | - table. |
| 1954 | + The OID of the child table. |
1953 | 1955 | </entry> |
1954 | 1956 | </row> |
1955 | 1957 |
|
|
1958 | 1960 | <entry><type>oid</type></entry> |
1959 | 1961 | <entry>pg_class.oid</entry> |
1960 | 1962 | <entry> |
1961 | | - This is the reference to the parent table, which the table |
1962 | | - referenced by <structfield>inhrelid</structfield> inherited |
1963 | | - from. |
| 1963 | + The OID of the parent table. |
1964 | 1964 | </entry> |
1965 | 1965 | </row> |
1966 | 1966 |
|
|
1969 | 1969 | <entry><type>int4</type></entry> |
1970 | 1970 | <entry></entry> |
1971 | 1971 | <entry> |
1972 | | - If there is more than one parent for asubtable (multiple |
| 1972 | + If there is more than one parent for achild table (multiple |
1973 | 1973 | inheritance), this number tells the order in which the |
1974 | 1974 | inherited columns are to be arranged. The count starts at 1. |
1975 | 1975 | </entry> |
|
2511 | 2511 | </tgroup> |
2512 | 2512 | </table> |
2513 | 2513 |
|
| 2514 | + <para> |
| 2515 | + Unused fields contain zeroes, for example oprleft is zero for a |
| 2516 | + prefix operator. |
| 2517 | + </para> |
| 2518 | + |
2514 | 2519 | </sect1> |
2515 | 2520 |
|
2516 | 2521 |
|
|
2582 | 2587 | </row> |
2583 | 2588 |
|
2584 | 2589 | <row> |
2585 | | - <entry>proistrusted</entry> |
| 2590 | + <entry>prosecdef</entry> |
2586 | 2591 | <entry><type>bool</type></entry> |
2587 | 2592 | <entry></entry> |
2588 | | - <entry>not functional</entry> |
| 2593 | + <entry>Function is a security definer (i.e., a <quote>setuid</> |
| 2594 | + function)</entry> |
2589 | 2595 | </row> |
2590 | 2596 |
|
2591 | 2597 | <row> |
|
2638 | 2644 | <entry>prorettype</entry> |
2639 | 2645 | <entry><type>oid</type></entry> |
2640 | 2646 | <entry>pg_type.oid</entry> |
2641 | | - <entry>Data type of the return value (0 if the function does not return a value)</entry> |
| 2647 | + <entry>Data type of the return value</entry> |
2642 | 2648 | </row> |
2643 | 2649 |
|
2644 | 2650 | <row> |
|
2721 | 2727 | <entry>Rule name</entry> |
2722 | 2728 | </row> |
2723 | 2729 |
|
2724 | | - <row> |
2725 | | - <entry>ev_type</entry> |
2726 | | - <entry><type>char</type></entry> |
2727 | | - <entry></entry> |
2728 | | - <entry>Event type that the rule is for: '1' = SELECT, |
2729 | | - '2' = UPDATE, '3' = INSERT, '4' = DELETE</entry> |
2730 | | - </row> |
2731 | | - |
2732 | 2730 | <row> |
2733 | 2731 | <entry>ev_class</entry> |
2734 | 2732 | <entry><type>oid</type></entry> |
|
2744 | 2742 | indicate the whole table)</entry> |
2745 | 2743 | </row> |
2746 | 2744 |
|
| 2745 | + <row> |
| 2746 | + <entry>ev_type</entry> |
| 2747 | + <entry><type>char</type></entry> |
| 2748 | + <entry></entry> |
| 2749 | + <entry>Event type that the rule is for: '1' = SELECT, |
| 2750 | + '2' = UPDATE, '3' = INSERT, '4' = DELETE</entry> |
| 2751 | + </row> |
| 2752 | + |
2747 | 2753 | <row> |
2748 | 2754 | <entry>is_instead</entry> |
2749 | 2755 | <entry><type>bool</type></entry> |
|
3054 | 3060 | <entry>tgname</entry> |
3055 | 3061 | <entry><type>name</type></entry> |
3056 | 3062 | <entry></entry> |
3057 | | - <entry>Trigger name (need notbe unique)</entry> |
| 3063 | + <entry>Trigger name (mustbe unique among triggers of same table)</entry> |
3058 | 3064 | </row> |
3059 | 3065 |
|
3060 | 3066 | <row> |
|
3084 | 3090 | <entry>tgisconstraint</entry> |
3085 | 3091 | <entry><type>bool</type></entry> |
3086 | 3092 | <entry></entry> |
3087 | | - <entry>True if triggeris a RI constraint</entry> |
| 3093 | + <entry>True if triggerimplements an RI constraint</entry> |
3088 | 3094 | </row> |
3089 | 3095 |
|
3090 | 3096 | <row> |
|
3251 | 3257 | <entry></entry> |
3252 | 3258 | <entry>True if the type is defined, false if this is a placeholder |
3253 | 3259 | entry for a not-yet-defined type. When typisdefined is false, |
3254 | | - nothing except the type name and OID can be relied on. |
| 3260 | + nothing except the type name, namespace, and OID can be relied on. |
3255 | 3261 | </entry> |
3256 | 3262 | </row> |
3257 | 3263 |
|
|
3306 | 3312 | <entry>typinput</entry> |
3307 | 3313 | <entry><type>regproc</type></entry> |
3308 | 3314 | <entry>pg_proc.oid</entry> |
3309 | | - <entry>Input function</entry> |
| 3315 | + <entry>Inputconversionfunction</entry> |
3310 | 3316 | </row> |
3311 | 3317 |
|
3312 | 3318 | <row> |
3313 | 3319 | <entry>typoutput</entry> |
3314 | 3320 | <entry><type>regproc</type></entry> |
3315 | 3321 | <entry>pg_proc.oid</entry> |
3316 | | - <entry>Output function</entry> |
| 3322 | + <entry>Outputconversionfunction</entry> |
3317 | 3323 | </row> |
3318 | 3324 |
|
3319 | 3325 | <row> |
|
3417 | 3423 | <entry><type>int4</type></entry> |
3418 | 3424 | <entry></entry> |
3419 | 3425 | <entry><para> |
3420 | | - <structfield>typtypmod</structfield> records type-specific data |
3421 | | - supplied at table creation time (for example, the maximum |
3422 | | - length of a <type>varchar</type> column). It is passed to |
3423 | | - type-specific input and output functions as the third |
3424 | | - argument. The value will generally be -1 for types that do not |
3425 | | - need typmod. This value is copied to |
3426 | | - <structfield>pg_attribute.atttypmod</structfield> when |
3427 | | - creating a column of a domain type. |
3428 | | - </para></entry> |
| 3426 | + Domains use <structfield>typtypmod</structfield> to record the typmod |
| 3427 | + to be applied to their base type (-1 if base type does not use a |
| 3428 | + typmod). -1 if this type is not a domain. |
| 3429 | + </para></entry> |
3429 | 3430 | </row> |
3430 | 3431 |
|
3431 | 3432 | <row> |
|
3434 | 3435 | <entry></entry> |
3435 | 3436 | <entry><para> |
3436 | 3437 | <structfield>typndims</structfield> is the number of array dimensions |
3437 | | - for a domain that is an array. (The array element type is |
3438 | | - typbasetype.) Zero for non-domains and non-array domains. |
3439 | | - This value is copied to |
3440 | | - <structfield>pg_attribute.attndims</structfield> when |
3441 | | - creating a column of a domain type. |
| 3438 | + for a domain that is an array (that is, typbasetype is an array type; |
| 3439 | + the domain's typelem will match the base type's typelem). |
| 3440 | + Zero for non-domains and non-array domains. |
3442 | 3441 | </para></entry> |
3443 | 3442 | </row> |
3444 | 3443 |
|
|