📄 catalogs.sgml
字号:
<row> <entry><structfield>ammarkpos</structfield></entry> <entry><type>regproc</type></entry> <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry> <entry><quote>Mark current scan position</quote> function</entry> </row> <row> <entry><structfield>amrestrpos</structfield></entry> <entry><type>regproc</type></entry> <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry> <entry><quote>Restore marked scan position</quote> function</entry> </row> <row> <entry><structfield>ambuild</structfield></entry> <entry><type>regproc</type></entry> <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry> <entry><quote>Build new index</quote> function</entry> </row> <row> <entry><structfield>ambulkdelete</structfield></entry> <entry><type>regproc</type></entry> <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry> <entry>Bulk-delete function</entry> </row> <row> <entry><structfield>amvacuumcleanup</structfield></entry> <entry><type>regproc</type></entry> <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry> <entry>Post-<command>VACUUM</command> cleanup function</entry> </row> <row> <entry><structfield>amcostestimate</structfield></entry> <entry><type>regproc</type></entry> <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry> <entry>Function to estimate cost of an index scan</entry> </row> </tbody> </tgroup> </table> <para> An index access method that supports multiple columns (has <structfield>amcanmulticol</structfield> true) <emphasis>must</> support indexing null values in columns after the first, because the planner will assume the index can be used for queries on just the first column(s). For example, consider an index on (a,b) and a query with <literal>WHERE a = 4</literal>. The system will assume the index can be used to scan for rows with <literal>a = 4</literal>, which is wrong if the index omits rows where <literal>b</> is null. It is, however, OK to omit rows where the first indexed column is null. (GiST currently does so.) <structfield>amindexnulls</structfield> should be set true only if the index access method indexes all rows, including arbitrary combinations of null values. </para> </sect1> <sect1 id="catalog-pg-amop"> <title><structname>pg_amop</structname></title> <indexterm zone="catalog-pg-amop"> <primary>pg_amop</primary> </indexterm> <para> The catalog <structname>pg_amop</structname> stores information about operators associated with index access method operator classes. There is one row for each operator that is a member of an operator class. </para> <table> <title><structname>pg_amop</> 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>amopclaid</structfield></entry> <entry><type>oid</type></entry> <entry><literal><link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link>.oid</literal></entry> <entry>The index operator class this entry is for</entry> </row> <row> <entry><structfield>amopstrategy</structfield></entry> <entry><type>int2</type></entry> <entry></entry> <entry>Operator strategy number</entry> </row> <row> <entry><structfield>amopreqcheck</structfield></entry> <entry><type>bool</type></entry> <entry></entry> <entry>Index hit must be rechecked</entry> </row> <row> <entry><structfield>amopopr</structfield></entry> <entry><type>oid</type></entry> <entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry> <entry>OID of the operator</entry> </row> </tbody> </tgroup> </table> </sect1> <sect1 id="catalog-pg-amproc"> <title><structname>pg_amproc</structname></title> <indexterm zone="catalog-pg-amproc"> <primary>pg_amproc</primary> </indexterm> <para> The catalog <structname>pg_amproc</structname> stores information about support procedures associated with index access method operator classes. There is one row for each support procedure belonging to an operator class. </para> <table> <title><structname>pg_amproc</structname> 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>amopclaid</structfield></entry> <entry><type>oid</type></entry> <entry><literal><link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link>.oid</literal></entry> <entry>The index operator class this entry is for</entry> </row> <row> <entry><structfield>amprocnum</structfield></entry> <entry><type>int2</type></entry> <entry></entry> <entry>Support procedure number</entry> </row> <row> <entry><structfield>amproc</structfield></entry> <entry><type>regproc</type></entry> <entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry> <entry>OID of the procedure</entry> </row> </tbody> </tgroup> </table> </sect1> <sect1 id="catalog-pg-attrdef"> <title><structname>pg_attrdef</structname></title> <indexterm zone="catalog-pg-attrdef"> <primary>pg_attrdef</primary> </indexterm> <para> The catalog <structname>pg_attrdef</structname> stores column default values. The main information about columns is stored in <structname>pg_attribute</structname> (see below). Only columns that explicitly specify a default value (when the table is created or the column is added) will have an entry here. </para> <table> <title><structname>pg_attrdef</> 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>adrelid</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 column belongs to</entry> </row> <row> <entry><structfield>adnum</structfield></entry> <entry><type>int2</type></entry> <entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attnum</literal></entry> <entry>The number of the column</entry> </row> <row> <entry><structfield>adbin</structfield></entry> <entry><type>text</type></entry> <entry></entry> <entry>The internal representation of the column default value</entry> </row> <row> <entry><structfield>adsrc</structfield></entry> <entry><type>text</type></entry> <entry></entry> <entry>A human-readable representation of the default value</entry> </row> </tbody> </tgroup> </table> </sect1> <sect1 id="catalog-pg-attribute"> <title><structname>pg_attribute</structname></title> <indexterm zone="catalog-pg-attribute"> <primary>pg_attribute</primary> </indexterm> <para> The catalog <structname>pg_attribute</structname> stores information about table columns. There will be exactly one <structname>pg_attribute</structname> row for every column in every table in the database. (There will also be attribute entries for indexes and other objects. See <structname>pg_class</structname>.) </para> <para> The term attribute is equivalent to column and is used for historical reasons. </para> <table> <title><structname>pg_attribute</> 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>attrelid</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 column belongs to</entry> </row> <row> <entry><structfield>attname</structfield></entry> <entry><type>name</type></entry> <entry></entry> <entry>The column name</entry> </row> <row> <entry><structfield>atttypid</structfield></entry> <entry><type>oid</type></entry> <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry> <entry>The data type of this column</entry> </row> <row> <entry><structfield>attstattarget</structfield></entry> <entry><type>int4</type></entry> <entry></entry> <entry> <structfield>attstattarget</structfield> controls the level of detail of statistics accumulated for this column by <command>ANALYZE</command>. A zero value indicates that no statistics should be collected. A negative value says to use the system default statistics target. The exact meaning of positive values is data type-dependent. For scalar data types, <structfield>attstattarget</structfield> is both the target number of <quote>most common values</quote> to collect, and the target number of histogram bins to create. </entry> </row> <row> <entry><structfield>attlen</structfield></entry> <entry><type>int2</type></entry> <entry></entry> <entry> A copy of <literal>pg_type.typlen</literal> of this column's type </entry> </row> <row> <entry><structfield>attnum</structfield></entry> <entry><type>int2</type></entry> <entry></entry> <entry> The number of the column. Ordinary columns are numbered from 1 up. System columns, such as <structfield>oid</structfield>, have (arbitrary) negative numbers. </entry> </row> <row> <entry><structfield>attndims</structfield></entry> <entry><type>int4</type></entry> <entry></entry> <entry> Number of dimensions, if the column is an array type; otherwise 0. (Presently, the number of dimensions of an array is not enforced, so any nonzero value effectively means <quote>it's an array</>.) </entry> </row> <row> <entry><structfield>attcacheoff</structfield></entry> <entry><type>int4</type></entry> <entry></entry> <entry> Always -1 in storage, but when loaded into a row descriptor in memory this may be updated to cache the offset of the attribute within the row. </entry> </row> <row> <entry><structfield>atttypmod</structfield></entry> <entry><type>int4</type></entry> <entry></entry> <entry> <structfield>atttypmod</structfield> records type-specific data supplied at table creation time (for example, the maximum length of a <type>varchar</type> column). It is passed to type-specific input functions and length coercion functions. The value will generally be -1 for types that do not need <structfield>atttypmod</>. </entry> </row> <row> <entry><structfield>attbyval</structfield></entry> <entry><type>bool</type></entry> <entry></entry> <entry> A copy of <literal>pg_type.typbyval</> of this column's type </entry> </row> <row> <entry><structfield>attstorage</structfield></entry> <entry><type>char</type></entry> <entry></entry> <entry> Normally a copy of <literal>pg_type.typstorage</> of this column's type. For TOAST-able data types, this can be altered after column creation to control storage policy. </entry> </row> <row> <entry><structfield>attisset</structfield></entry> <entry><type>bool</type></entry> <entry></entry> <entry> If true, this attribute is a set. In that case, what is really stored in the attribute is the OID of a row in the <structname>pg_proc</structname> catalog. The <structname>pg_proc</structname> row contains the query string that defines this set, i.e., the query to run to get
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -