📄 catalogs.sgml
字号:
<entry><type>bool</type></entry> <entry></entry> <entry>True if table has rules; see <structname>pg_rewrite</structname> catalog. </entry> </row> <row> <entry><structfield>relhassubclass</structfield></entry> <entry><type>bool</type></entry> <entry></entry> <entry>True if table has (or once had) any inheritance children.</entry> </row> <row> <entry><structfield>relacl</structfield></entry> <entry><type>aclitem[]</type></entry> <entry></entry> <entry> Access privileges; see <xref linkend="sql-grant" endterm="sql-grant-title"> and <xref linkend="sql-revoke" endterm="sql-revoke-title"> for details. </entry> </row> </tbody> </tgroup> </table> </sect1> <sect1 id="catalog-pg-constraint"> <title><structname>pg_constraint</structname></title> <indexterm zone="catalog-pg-constraint"> <primary>pg_constraint</primary> </indexterm> <para> The catalog <structname>pg_constraint</structname> stores check, primary key, unique, and foreign key constraints on tables. (Column constraints are not treated specially. Every column constraint is equivalent to some table constraint.) Not-null constraints are represented in the <structname>pg_attribute</> catalog. </para> <para> Check constraints on domains are stored here, too. </para> <table> <title><structname>pg_constraint</> Columns</title> <tgroup cols=4> <thead> <row> <entry>Name</entry> <entry>Type</entry> <entry>References</entry> <entry>Description</entry> </row> </thead> <tbody> <row> <entry><structfield>conname</structfield></entry> <entry><type>name</type></entry> <entry></entry> <entry>Constraint name (not necessarily unique!)</entry> </row> <row> <entry><structfield>connamespace</structfield></entry> <entry><type>oid</type></entry> <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry> <entry> The OID of the namespace that contains this constraint </entry> </row> <row> <entry><structfield>contype</structfield></entry> <entry><type>char</type></entry> <entry></entry> <entry> <literal>c</> = check constraint, <literal>f</> = foreign key constraint, <literal>p</> = primary key constraint, <literal>u</> = unique constraint </entry> </row> <row> <entry><structfield>condeferrable</structfield></entry> <entry><type>bool</type></entry> <entry></entry> <entry>Is the constraint deferrable?</entry> </row> <row> <entry><structfield>condeferred</structfield></entry> <entry><type>bool</type></entry> <entry></entry> <entry>Is the constraint deferred by default?</entry> </row> <row> <entry><structfield>conrelid</structfield></entry> <entry><type>oid</type></entry> <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry> <entry>The table this constraint is on; 0 if not a table constraint</entry> </row> <row> <entry><structfield>contypid</structfield></entry> <entry><type>oid</type></entry> <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry> <entry>The domain this constraint is on; 0 if not a domain constraint</entry> </row> <row> <entry><structfield>confrelid</structfield></entry> <entry><type>oid</type></entry> <entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry> <entry>If a foreign key, the referenced table; else 0</entry> </row> <row> <entry><structfield>confupdtype</structfield></entry> <entry><type>char</type></entry> <entry></entry> <entry>Foreign key update action code</entry> </row> <row> <entry><structfield>confdeltype</structfield></entry> <entry><type>char</type></entry> <entry></entry> <entry>Foreign key deletion action code</entry> </row> <row> <entry><structfield>confmatchtype</structfield></entry> <entry><type>char</type></entry> <entry></entry> <entry>Foreign key match type</entry> </row> <row> <entry><structfield>conkey</structfield></entry> <entry><type>int2[]</type></entry> <entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attnum</></entry> <entry>If a table constraint, list of columns which the constraint constrains</entry> </row> <row> <entry><structfield>confkey</structfield></entry> <entry><type>int2[]</type></entry> <entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attnum</></entry> <entry>If a foreign key, list of the referenced columns</entry> </row> <row> <entry><structfield>conbin</structfield></entry> <entry><type>text</type></entry> <entry></entry> <entry>If a check constraint, an internal representation of the expression</entry> </row> <row> <entry><structfield>consrc</structfield></entry> <entry><type>text</type></entry> <entry></entry> <entry>If a check constraint, a human-readable representation of the expression</entry> </row> </tbody> </tgroup> </table> <note> <para> <structfield>consrc</structfield> is not updated when referenced objects change; for example, it won't track renaming of columns. Rather than relying on this field, it's best to use <function>pg_get_constraintdef()</> to extract the definition of a check constraint. </para> </note> <note> <para> <literal>pg_class.relchecks</literal> needs to agree with the number of check-constraint entries found in this table for the given relation. </para> </note> </sect1> <sect1 id="catalog-pg-conversion"> <title><structname>pg_conversion</structname></title> <indexterm zone="catalog-pg-conversion"> <primary>pg_conversion</primary> </indexterm> <para> The catalog <structname>pg_conversion</structname> describes the available encoding conversion procedures. See <xref linkend="sql-createconversion" endterm="sql-createconversion-title"> for more information. </para> <table> <title><structname>pg_conversion</> Columns</title> <tgroup cols=4> <thead> <row> <entry>Name</entry> <entry>Type</entry> <entry>References</entry> <entry>Description</entry> </row> </thead> <tbody> <row> <entry><structfield>conname</structfield></entry> <entry><type>name</type></entry> <entry></entry> <entry>Conversion name (unique within a namespace)</entry> </row> <row> <entry><structfield>connamespace</structfield></entry> <entry><type>oid</type></entry> <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry> <entry> The OID of the namespace that contains this conversion </entry> </row> <row> <entry><structfield>conowner</structfield></entry> <entry><type>oid</type></entry> <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry> <entry>Owner of the conversion</entry> </row> <row> <entry><structfield>conforencoding</structfield></entry> <entry><type>int4</type></entry> <entry></entry> <entry>Source encoding ID</entry> </row> <row> <entry><structfield>contoencoding</structfield></entry> <entry><type>int4</type></entry> <entry></entry> <entry>Destination encoding ID</entry> </row> <row> <entry><structfield>conproc</structfield></entry> <entry><type>regproc</type></entry> <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry> <entry>Conversion procedure</entry> </row> <row> <entry><structfield>condefault</structfield></entry> <entry><type>bool</type></entry> <entry></entry> <entry>True if this is the default conversion</entry> </row> </tbody> </tgroup> </table> </sect1> <sect1 id="catalog-pg-database"> <title><structname>pg_database</structname></title> <indexterm zone="catalog-pg-database"> <primary>pg_database</primary> </indexterm> <para> The catalog <structname>pg_database</structname> stores information about the available databases. Databases are created with the <command>CREATE DATABASE</command> command. Consult <xref linkend="managing-databases"> for details about the meaning of some of the parameters. </para> <para> Unlike most system catalogs, <structname>pg_database</structname> is shared across all databases of a cluster: there is only one copy of <structname>pg_database</structname> per cluster, not one per database. </para> <table> <title><structname>pg_database</> Columns</title> <tgroup cols=4> <thead> <row> <entry>Name</entry> <entry>Type</entry> <entry>References</entry> <entry>Description</entry> </row> </thead> <tbody> <row> <entry><structfield>datname</structfield></entry> <entry><type>name</type></entry> <entry></entry> <entry>Database name</entry> </row> <row> <entry><structfield>datdba</structfield></entry> <entry><type>oid</type></entry> <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry> <entry>Owner of the database, usually the user who created it</entry> </row> <row> <entry><structfield>encoding</structfield></entry> <entry><type>int4</type></entry> <entry></entry> <entry>Character encoding for this database</entry> </row> <row> <entry><structfield>datistemplate</structfield></entry> <entry><type>bool</type></entry> <entry></entry> <entry> If true then this database can be used in the <literal>TEMPLATE</literal> clause of <command>CREATE DATABASE</command> to create a new database as a clone of this one. </entry> </row> <row> <entry><structfield>datallowconn</structfield></entry> <entry><type>bool</type></entry> <entry></entry> <entry> If false then no one can connect to this database. This is used to protect the <literal>template0</> database from being altered. </entry> </row> <row> <entry><structfield>datconnlimit</structfield></entry> <entry><type>int4</type></entry> <entry></entry> <entry> Sets maximum number of concurrent connections that can be made to this database. -1 means no limit. </entry> </row> <row> <entry><structfield>datlastsysoid</structfield></entry> <entry><type>oid</type></entry> <entry></entry> <entry> Last system OID in the database; useful particularly to <application>pg_dump</application> </entry> </row> <row> <entry><structfield>datvacuumxid</structfield></entry> <entry><type>xid</type></entry> <entry></entry> <entry> All rows inserted or deleted by transaction IDs before this one have been marked as known committed or known aborted in this database. This is used to determine when commit-log space can be recycled. </entry> </row> <row> <entry><structfield>datfrozenxid</structfield></entry> <entry><type>xid</type></entry> <entry></entry> <entry> All rows inserted by transaction IDs before this one have been relabeled with a permanent (<quote>frozen</>) transaction ID in this database.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -