2010-09-20 22:08:53 +02:00
|
|
|
<!-- doc/src/sgml/catalogs.sgml -->
|
2000-11-29 21:15:59 +01:00
|
|
|
<!--
|
|
|
|
Documentation of the system catalogs, directed toward PostgreSQL developers
|
|
|
|
-->
|
|
|
|
|
|
|
|
<chapter id="catalogs">
|
|
|
|
<title>System Catalogs</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The system catalogs are the place where a relational database
|
|
|
|
management system stores schema metadata, such as information about
|
|
|
|
tables and columns, and internal bookkeeping information.
|
|
|
|
<productname>PostgreSQL</productname>'s system catalogs are regular
|
|
|
|
tables. You can drop and recreate the tables, add columns, insert
|
|
|
|
and update values, and severely mess up your system that way.
|
2003-04-15 15:23:35 +02:00
|
|
|
Normally, one should not change the system catalogs by hand, there
|
2000-11-29 21:15:59 +01:00
|
|
|
are always SQL commands to do that. (For example, <command>CREATE
|
|
|
|
DATABASE</command> inserts a row into the
|
2004-11-15 07:32:15 +01:00
|
|
|
<structname>pg_database</structname> catalog — and actually
|
2000-11-29 21:15:59 +01:00
|
|
|
creates the database on disk.) There are some exceptions for
|
2003-04-15 15:23:35 +02:00
|
|
|
particularly esoteric operations, such as adding index access methods.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<sect1 id="catalogs-overview">
|
|
|
|
<title>Overview</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<xref linkend="catalog-table"> lists the system catalogs.
|
|
|
|
More detailed documentation of each catalog follows below.
|
2000-11-29 21:15:59 +01:00
|
|
|
</para>
|
2003-04-15 15:23:35 +02:00
|
|
|
|
2002-10-14 06:29:23 +02:00
|
|
|
<para>
|
|
|
|
Most system catalogs are copied from the template database during
|
2003-04-15 15:23:35 +02:00
|
|
|
database creation and are thereafter database-specific. A few
|
|
|
|
catalogs are physically shared across all databases in a cluster;
|
2005-01-06 00:42:03 +01:00
|
|
|
these are noted in the descriptions of the individual catalogs.
|
2002-10-14 06:29:23 +02:00
|
|
|
</para>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
2003-04-15 15:23:35 +02:00
|
|
|
<table id="catalog-table">
|
2000-11-29 21:15:59 +01:00
|
|
|
<title>System Catalogs</title>
|
|
|
|
|
|
|
|
<tgroup cols="2">
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Catalog Name</entry>
|
|
|
|
<entry>Purpose</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-aggregate"><structname>pg_aggregate</structname></link></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>aggregate functions</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-am"><structname>pg_am</structname></link></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>index access methods</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-amop"><structname>pg_amop</structname></link></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>access method operators</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-amproc"><structname>pg_amproc</structname></link></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>access method support procedures</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-attrdef"><structname>pg_attrdef</structname></link></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>column default values</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link></entry>
|
|
|
|
<entry>table columns (<quote>attributes</quote>)</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
2005-06-28 07:09:14 +02:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link></entry>
|
|
|
|
<entry>authorization identifiers (roles)</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><link linkend="catalog-pg-auth-members"><structname>pg_auth_members</structname></link></entry>
|
|
|
|
<entry>authorization identifier membership relationships</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-07-22 22:23:19 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-cast"><structname>pg_cast</structname></link></entry>
|
2002-07-22 22:23:19 +02:00
|
|
|
<entry>casts (data type conversions)</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-class"><structname>pg_class</structname></link></entry>
|
2005-01-06 00:42:03 +01:00
|
|
|
<entry>tables, indexes, sequences, views (<quote>relations</quote>)</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
2002-07-12 20:43:19 +02:00
|
|
|
<row>
|
2013-12-30 19:27:51 +01:00
|
|
|
<entry><link linkend="catalog-pg-collation"><structname>pg_collation</structname></link></entry>
|
|
|
|
<entry>collations (locale information)</entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
</row>
|
|
|
|
|
2011-02-08 22:04:18 +01:00
|
|
|
<row>
|
2013-12-30 19:27:51 +01:00
|
|
|
<entry><link linkend="catalog-pg-constraint"><structname>pg_constraint</structname></link></entry>
|
|
|
|
<entry>check constraints, unique constraints, primary key constraints, foreign key constraints</entry>
|
2011-02-08 22:04:18 +01:00
|
|
|
</row>
|
|
|
|
|
2002-07-24 07:51:56 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-conversion"><structname>pg_conversion</structname></link></entry>
|
2002-07-24 07:51:56 +02:00
|
|
|
<entry>encoding conversion information</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-database"><structname>pg_database</structname></link></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry>databases within this database cluster</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
2010-09-17 20:49:54 +02:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="catalog-pg-db-role-setting"><structname>pg_db_role_setting</structname></link></entry>
|
|
|
|
<entry>per-role and per-database settings</entry>
|
|
|
|
</row>
|
|
|
|
|
2009-10-05 21:24:49 +02:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="catalog-pg-default-acl"><structname>pg_default_acl</structname></link></entry>
|
|
|
|
<entry>default privileges for object types</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-07-12 20:43:19 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-depend"><structname>pg_depend</structname></link></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry>dependencies between database objects</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-description"><structname>pg_description</structname></link></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>descriptions or comments on database objects</entry>
|
|
|
|
</row>
|
|
|
|
|
2007-04-02 05:49:42 +02:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="catalog-pg-enum"><structname>pg_enum</structname></link></entry>
|
|
|
|
<entry>enum label and value definitions</entry>
|
|
|
|
</row>
|
|
|
|
|
2012-07-18 16:16:16 +02:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="catalog-pg-event-trigger"><structname>pg_event_trigger</structname></link></entry>
|
|
|
|
<entry>event triggers</entry>
|
|
|
|
</row>
|
|
|
|
|
2011-02-08 22:08:41 +01:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="catalog-pg-extension"><structname>pg_extension</structname></link></entry>
|
|
|
|
<entry>installed extensions</entry>
|
|
|
|
</row>
|
|
|
|
|
2008-12-19 17:25:19 +01:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="catalog-pg-foreign-data-wrapper"><structname>pg_foreign_data_wrapper</structname></link></entry>
|
|
|
|
<entry>foreign-data wrapper definitions</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><link linkend="catalog-pg-foreign-server"><structname>pg_foreign_server</structname></link></entry>
|
|
|
|
<entry>foreign server definitions</entry>
|
|
|
|
</row>
|
|
|
|
|
2011-01-02 05:48:11 +01:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="catalog-pg-foreign-table"><structname>pg_foreign_table</structname></link></entry>
|
|
|
|
<entry>additional foreign table information</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-index"><structname>pg_index</structname></link></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>additional index information</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-inherits"><structname>pg_inherits</structname></link></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>table inheritance hierarchy</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-language"><structname>pg_language</structname></link></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>languages for writing functions</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-largeobject"><structname>pg_largeobject</structname></link></entry>
|
2009-12-11 04:34:57 +01:00
|
|
|
<entry>data pages for large objects</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><link linkend="catalog-pg-largeobject-metadata"><structname>pg_largeobject_metadata</structname></link></entry>
|
|
|
|
<entry>metadata for large objects</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
2002-03-22 22:34:44 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link></entry>
|
|
|
|
<entry>schemas</entry>
|
2002-03-22 22:34:44 +01:00
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link></entry>
|
2006-12-23 01:43:13 +01:00
|
|
|
<entry>access method operator classes</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>operators</entry>
|
|
|
|
</row>
|
|
|
|
|
2006-12-23 01:43:13 +01:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="catalog-pg-opfamily"><structname>pg_opfamily</structname></link></entry>
|
|
|
|
<entry>access method operator families</entry>
|
|
|
|
</row>
|
|
|
|
|
2005-09-08 22:07:42 +02:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="catalog-pg-pltemplate"><structname>pg_pltemplate</structname></link></entry>
|
|
|
|
<entry>template data for procedural languages</entry>
|
|
|
|
</row>
|
|
|
|
|
2015-01-24 22:16:22 +01:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="catalog-pg-policy"><structname>pg_policy</structname></link></entry>
|
|
|
|
<entry>row-security policies</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>functions and procedures</entry>
|
|
|
|
</row>
|
|
|
|
|
2011-11-03 12:16:28 +01:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="catalog-pg-range"><structname>pg_range</structname></link></entry>
|
|
|
|
<entry>information about range types</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-rewrite"><structname>pg_rewrite</structname></link></entry>
|
|
|
|
<entry>query rewrite rules</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
Introduce replication progress tracking infrastructure.
When implementing a replication solution ontop of logical decoding, two
related problems exist:
* How to safely keep track of replication progress
* How to change replication behavior, based on the origin of a row;
e.g. to avoid loops in bi-directional replication setups
The solution to these problems, as implemented here, consist out of
three parts:
1) 'replication origins', which identify nodes in a replication setup.
2) 'replication progress tracking', which remembers, for each
replication origin, how far replay has progressed in a efficient and
crash safe manner.
3) The ability to filter out changes performed on the behest of a
replication origin during logical decoding; this allows complex
replication topologies. E.g. by filtering all replayed changes out.
Most of this could also be implemented in "userspace", e.g. by inserting
additional rows contain origin information, but that ends up being much
less efficient and more complicated. We don't want to require various
replication solutions to reimplement logic for this independently. The
infrastructure is intended to be generic enough to be reusable.
This infrastructure also replaces the 'nodeid' infrastructure of commit
timestamps. It is intended to provide all the former capabilities,
except that there's only 2^16 different origins; but now they integrate
with logical decoding. Additionally more functionality is accessible via
SQL. Since the commit timestamp infrastructure has also been introduced
in 9.5 (commit 73c986add) changing the API is not a problem.
For now the number of origins for which the replication progress can be
tracked simultaneously is determined by the max_replication_slots
GUC. That GUC is not a perfect match to configure this, but there
doesn't seem to be sufficient reason to introduce a separate new one.
Bumps both catversion and wal page magic.
Author: Andres Freund, with contributions from Petr Jelinek and Craig Ringer
Reviewed-By: Heikki Linnakangas, Petr Jelinek, Robert Haas, Steve Singer
Discussion: 20150216002155.GI15326@awork2.anarazel.de,
20140923182422.GA15776@alap3.anarazel.de,
20131114172632.GE7522@alap2.anarazel.de
2015-04-29 19:30:53 +02:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="catalog-pg-replication-origin"><structname>pg_replication_origin</structname></link></entry>
|
|
|
|
<entry>registered replication origins</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><link linkend="catalog-pg-replication-origin-status"><structname>pg_replication_origin_status</structname></link></entry>
|
|
|
|
<entry>information about replication origins, including replication progress</entry>
|
|
|
|
</row>
|
|
|
|
|
2014-02-01 04:45:17 +01:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="catalog-pg-replication-slots"><structname>pg_replication_slots</structname></link></entry>
|
|
|
|
<entry>replication slot information</entry>
|
|
|
|
</row>
|
|
|
|
|
2010-09-28 02:55:27 +02:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="catalog-pg-seclabel"><structname>pg_seclabel</structname></link></entry>
|
|
|
|
<entry>security labels on database objects</entry>
|
|
|
|
</row>
|
|
|
|
|
2005-07-07 22:40:02 +02:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="catalog-pg-shdepend"><structname>pg_shdepend</structname></link></entry>
|
|
|
|
<entry>dependencies on shared objects</entry>
|
|
|
|
</row>
|
|
|
|
|
2006-02-12 04:22:21 +01:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="catalog-pg-shdescription"><structname>pg_shdescription</structname></link></entry>
|
|
|
|
<entry>comments on shared objects</entry>
|
|
|
|
</row>
|
|
|
|
|
2011-07-20 19:18:24 +02:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="catalog-pg-shseclabel"><structname>pg_shseclabel</structname></link></entry>
|
|
|
|
<entry>security labels on shared database objects</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-statistic"><structname>pg_statistic</structname></link></entry>
|
|
|
|
<entry>planner statistics</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
2004-06-18 08:14:31 +02:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="catalog-pg-tablespace"><structname>pg_tablespace</structname></link></entry>
|
|
|
|
<entry>tablespaces within this database cluster</entry>
|
|
|
|
</row>
|
|
|
|
|
2015-04-26 16:33:14 +02:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="catalog-pg-transform"><structname>pg_transform</structname></link></entry>
|
|
|
|
<entry>transforms (data type to procedural language conversions)</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-trigger"><structname>pg_trigger</structname></link></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>triggers</entry>
|
|
|
|
</row>
|
|
|
|
|
2007-10-01 23:10:40 +02:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="catalog-pg-ts-config"><structname>pg_ts_config</structname></link></entry>
|
|
|
|
<entry>text search configurations</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><link linkend="catalog-pg-ts-config-map"><structname>pg_ts_config_map</structname></link></entry>
|
|
|
|
<entry>text search configurations' token mappings</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><link linkend="catalog-pg-ts-dict"><structname>pg_ts_dict</structname></link></entry>
|
|
|
|
<entry>text search dictionaries</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><link linkend="catalog-pg-ts-parser"><structname>pg_ts_parser</structname></link></entry>
|
|
|
|
<entry>text search parsers</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><link linkend="catalog-pg-ts-template"><structname>pg_ts_template</structname></link></entry>
|
|
|
|
<entry>text search templates</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><link linkend="catalog-pg-type"><structname>pg_type</structname></link></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>data types</entry>
|
|
|
|
</row>
|
2008-12-19 17:25:19 +01:00
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><link linkend="catalog-pg-user-mapping"><structname>pg_user_mapping</structname></link></entry>
|
|
|
|
<entry>mappings of users to foreign servers</entry>
|
|
|
|
</row>
|
2000-11-29 21:15:59 +01:00
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-aggregate">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_aggregate</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-aggregate">
|
|
|
|
<primary>pg_aggregate</primary>
|
|
|
|
</indexterm>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_aggregate</structname> stores information about
|
2000-11-29 21:15:59 +01:00
|
|
|
aggregate functions. An aggregate function is a function that
|
2001-05-07 02:43:27 +02:00
|
|
|
operates on a set of values (typically one column from each row
|
2000-11-29 21:15:59 +01:00
|
|
|
that matches a query condition) and returns a single value computed
|
|
|
|
from all these values. Typical aggregate functions are
|
|
|
|
<function>sum</function>, <function>count</function>, and
|
2002-04-11 22:00:18 +02:00
|
|
|
<function>max</function>. Each entry in
|
|
|
|
<structname>pg_aggregate</structname> is an extension of an entry
|
|
|
|
in <structname>pg_proc</structname>. The <structname>pg_proc</structname>
|
2003-04-15 15:23:35 +02:00
|
|
|
entry carries the aggregate's name, input and output data types, and
|
2002-04-11 22:00:18 +02:00
|
|
|
other information that is similar to ordinary functions.
|
2000-11-29 21:15:59 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_aggregate</> Columns</title>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2000-11-29 21:15:59 +01:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>aggfnoid</structfield></entry>
|
2002-04-11 22:00:18 +02:00
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structname>pg_proc</structname> OID of the aggregate function</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
Support ordered-set (WITHIN GROUP) aggregates.
This patch introduces generic support for ordered-set and hypothetical-set
aggregate functions, as well as implementations of the instances defined in
SQL:2008 (percentile_cont(), percentile_disc(), rank(), dense_rank(),
percent_rank(), cume_dist()). We also added mode() though it is not in the
spec, as well as versions of percentile_cont() and percentile_disc() that
can compute multiple percentile values in one pass over the data.
Unlike the original submission, this patch puts full control of the sorting
process in the hands of the aggregate's support functions. To allow the
support functions to find out how they're supposed to sort, a new API
function AggGetAggref() is added to nodeAgg.c. This allows retrieval of
the aggregate call's Aggref node, which may have other uses beyond the
immediate need. There is also support for ordered-set aggregates to
install cleanup callback functions, so that they can be sure that
infrastructure such as tuplesort objects gets cleaned up.
In passing, make some fixes in the recently-added support for variadic
aggregates, and make some editorial adjustments in the recent FILTER
additions for aggregates. Also, simplify use of IsBinaryCoercible() by
allowing it to succeed whenever the target type is ANY or ANYELEMENT.
It was inconsistent that it dealt with other polymorphic target types
but not these.
Atri Sharma and Andrew Gierth; reviewed by Pavel Stehule and Vik Fearing,
and rather heavily editorialized upon by Tom Lane
2013-12-23 22:11:35 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>aggkind</structfield></entry>
|
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Aggregate kind:
|
|
|
|
<literal>n</literal> for <quote>normal</> aggregates,
|
|
|
|
<literal>o</literal> for <quote>ordered-set</> aggregates, or
|
|
|
|
<literal>h</literal> for <quote>hypothetical-set</> aggregates
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>aggnumdirectargs</structfield></entry>
|
|
|
|
<entry><type>int2</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Number of direct (non-aggregated) arguments of an ordered-set or
|
|
|
|
hypothetical-set aggregate, counting a variadic array as one argument.
|
|
|
|
If equal to <structfield>pronargs</>, the aggregate must be variadic
|
|
|
|
and the variadic array describes the aggregated arguments as well as
|
|
|
|
the final direct arguments.
|
|
|
|
Always zero for normal aggregates.</entry>
|
|
|
|
</row>
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>aggtransfn</structfield></entry>
|
2002-04-11 22:00:18 +02:00
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>Transition function</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>aggfinalfn</structfield></entry>
|
2002-04-11 22:00:18 +02:00
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2002-09-24 23:26:44 +02:00
|
|
|
<entry>Final function (zero if none)</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
2014-04-12 17:58:53 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>aggmtransfn</structfield></entry>
|
|
|
|
<entry><type>regproc</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
|
|
|
<entry>Forward transition function for moving-aggregate mode (zero if none)</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>aggminvtransfn</structfield></entry>
|
|
|
|
<entry><type>regproc</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
|
|
|
<entry>Inverse transition function for moving-aggregate mode (zero if none)</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>aggmfinalfn</structfield></entry>
|
|
|
|
<entry><type>regproc</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
|
|
|
<entry>Final function for moving-aggregate mode (zero if none)</entry>
|
|
|
|
</row>
|
Allow polymorphic aggregates to have non-polymorphic state data types.
Before 9.4, such an aggregate couldn't be declared, because its final
function would have to have polymorphic result type but no polymorphic
argument, which CREATE FUNCTION would quite properly reject. The
ordered-set-aggregate patch found a workaround: allow the final function
to be declared as accepting additional dummy arguments that have types
matching the aggregate's regular input arguments. However, we failed
to notice that this problem applies just as much to regular aggregates,
despite the fact that we had a built-in regular aggregate array_agg()
that was known to be undeclarable in SQL because its final function
had an illegal signature. So what we should have done, and what this
patch does, is to decouple the extra-dummy-arguments behavior from
ordered-set aggregates and make it generally available for all aggregate
declarations. We have to put this into 9.4 rather than waiting till
later because it slightly alters the rules for declaring ordered-set
aggregates.
The patch turned out a bit bigger than I'd hoped because it proved
necessary to record the extra-arguments option in a new pg_aggregate
column. I'd thought we could just look at the final function's pronargs
at runtime, but that didn't work well for variadic final functions.
It's probably just as well though, because it simplifies life for pg_dump
to record the option explicitly.
While at it, fix array_agg() to have a valid final-function signature,
and add an opr_sanity test to notice future deviations from polymorphic
consistency. I also marked the percentile_cont() aggregates as not
needing extra arguments, since they don't.
2014-04-24 01:17:31 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>aggfinalextra</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2014-07-17 04:20:15 +02:00
|
|
|
<entry>True to pass extra dummy arguments to <structfield>aggfinalfn</structfield></entry>
|
Allow polymorphic aggregates to have non-polymorphic state data types.
Before 9.4, such an aggregate couldn't be declared, because its final
function would have to have polymorphic result type but no polymorphic
argument, which CREATE FUNCTION would quite properly reject. The
ordered-set-aggregate patch found a workaround: allow the final function
to be declared as accepting additional dummy arguments that have types
matching the aggregate's regular input arguments. However, we failed
to notice that this problem applies just as much to regular aggregates,
despite the fact that we had a built-in regular aggregate array_agg()
that was known to be undeclarable in SQL because its final function
had an illegal signature. So what we should have done, and what this
patch does, is to decouple the extra-dummy-arguments behavior from
ordered-set aggregates and make it generally available for all aggregate
declarations. We have to put this into 9.4 rather than waiting till
later because it slightly alters the rules for declaring ordered-set
aggregates.
The patch turned out a bit bigger than I'd hoped because it proved
necessary to record the extra-arguments option in a new pg_aggregate
column. I'd thought we could just look at the final function's pronargs
at runtime, but that didn't work well for variadic final functions.
It's probably just as well though, because it simplifies life for pg_dump
to record the option explicitly.
While at it, fix array_agg() to have a valid final-function signature,
and add an opr_sanity test to notice future deviations from polymorphic
consistency. I also marked the percentile_cont() aggregates as not
needing extra arguments, since they don't.
2014-04-24 01:17:31 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>aggmfinalextra</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2014-07-17 04:20:15 +02:00
|
|
|
<entry>True to pass extra dummy arguments to <structfield>aggmfinalfn</structfield></entry>
|
Allow polymorphic aggregates to have non-polymorphic state data types.
Before 9.4, such an aggregate couldn't be declared, because its final
function would have to have polymorphic result type but no polymorphic
argument, which CREATE FUNCTION would quite properly reject. The
ordered-set-aggregate patch found a workaround: allow the final function
to be declared as accepting additional dummy arguments that have types
matching the aggregate's regular input arguments. However, we failed
to notice that this problem applies just as much to regular aggregates,
despite the fact that we had a built-in regular aggregate array_agg()
that was known to be undeclarable in SQL because its final function
had an illegal signature. So what we should have done, and what this
patch does, is to decouple the extra-dummy-arguments behavior from
ordered-set aggregates and make it generally available for all aggregate
declarations. We have to put this into 9.4 rather than waiting till
later because it slightly alters the rules for declaring ordered-set
aggregates.
The patch turned out a bit bigger than I'd hoped because it proved
necessary to record the extra-arguments option in a new pg_aggregate
column. I'd thought we could just look at the final function's pronargs
at runtime, but that didn't work well for variadic final functions.
It's probably just as well though, because it simplifies life for pg_dump
to record the option explicitly.
While at it, fix array_agg() to have a valid final-function signature,
and add an opr_sanity test to notice future deviations from polymorphic
consistency. I also marked the percentile_cont() aggregates as not
needing extra arguments, since they don't.
2014-04-24 01:17:31 +02:00
|
|
|
</row>
|
2005-04-12 06:26:34 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>aggsortop</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry>
|
|
|
|
<entry>Associated sort operator (zero if none)</entry>
|
|
|
|
</row>
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>aggtranstype</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2005-04-12 06:26:34 +02:00
|
|
|
<entry>Data type of the aggregate function's internal transition (state) data</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
2013-11-16 22:03:40 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>aggtransspace</structfield></entry>
|
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Approximate average size (in bytes) of the transition state
|
|
|
|
data, or zero to use a default estimate</entry>
|
|
|
|
</row>
|
2014-04-12 17:58:53 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>aggmtranstype</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
|
|
|
<entry>Data type of the aggregate function's internal transition (state)
|
|
|
|
data for moving-aggregate mode (zero if none)</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>aggmtransspace</structfield></entry>
|
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Approximate average size (in bytes) of the transition state data
|
|
|
|
for moving-aggregate mode, or zero to use a default estimate</entry>
|
|
|
|
</row>
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>agginitval</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
The initial value of the transition state. This is a text
|
2001-09-06 04:07:42 +02:00
|
|
|
field containing the initial value in its external string
|
2010-08-17 06:37:21 +02:00
|
|
|
representation. If this field is null, the transition state
|
|
|
|
value starts out null.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
2014-04-12 17:58:53 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>aggminitval</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
The initial value of the transition state for moving-aggregate mode.
|
|
|
|
This is a text field containing the initial value in its external
|
|
|
|
string representation. If this field is null, the transition state
|
|
|
|
value starts out null.
|
|
|
|
</entry>
|
|
|
|
</row>
|
2000-11-29 21:15:59 +01:00
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<para>
|
2006-01-16 19:15:31 +01:00
|
|
|
New aggregate functions are registered with the <xref
|
2010-04-03 09:23:02 +02:00
|
|
|
linkend="sql-createaggregate">
|
2006-01-16 19:15:31 +01:00
|
|
|
command. See <xref linkend="xaggr"> for more information about
|
|
|
|
writing aggregate functions and the meaning of the transition
|
|
|
|
functions, etc.
|
2000-11-29 21:15:59 +01:00
|
|
|
</para>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
|
2002-07-30 07:24:56 +02:00
|
|
|
<sect1 id="catalog-pg-am">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_am</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-am">
|
|
|
|
<primary>pg_am</primary>
|
|
|
|
</indexterm>
|
2002-07-30 07:24:56 +02:00
|
|
|
|
|
|
|
<para>
|
2005-02-13 04:04:15 +01:00
|
|
|
The catalog <structname>pg_am</structname> stores information about index
|
|
|
|
access methods. There is one row for each index access method supported by
|
Restructure index access method API to hide most of it at the C level.
This patch reduces pg_am to just two columns, a name and a handler
function. All the data formerly obtained from pg_am is now provided
in a C struct returned by the handler function. This is similar to
the designs we've adopted for FDWs and tablesample methods. There
are multiple advantages. For one, the index AM's support functions
are now simple C functions, making them faster to call and much less
error-prone, since the C compiler can now check function signatures.
For another, this will make it far more practical to define index access
methods in installable extensions.
A disadvantage is that SQL-level code can no longer see attributes
of index AMs; in particular, some of the crosschecks in the opr_sanity
regression test are no longer possible from SQL. We've addressed that
by adding a facility for the index AM to perform such checks instead.
(Much more could be done in that line, but for now we're content if the
amvalidate functions more or less replace what opr_sanity used to do.)
We might also want to expose some sort of reporting functionality, but
this patch doesn't do that.
Alexander Korotkov, reviewed by Petr Jelínek, and rather heavily
editorialized on by me.
2016-01-18 01:36:59 +01:00
|
|
|
the system. The requirements for index access methods are discussed in
|
|
|
|
detail in <xref linkend="indexam">.
|
2002-07-30 07:24:56 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_am</> Columns</title>
|
2002-07-30 07:24:56 +02:00
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2002-07-30 07:24:56 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
|
2012-12-15 06:42:47 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-07-30 07:24:56 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>amname</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Name of the access method</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
Restructure index access method API to hide most of it at the C level.
This patch reduces pg_am to just two columns, a name and a handler
function. All the data formerly obtained from pg_am is now provided
in a C struct returned by the handler function. This is similar to
the designs we've adopted for FDWs and tablesample methods. There
are multiple advantages. For one, the index AM's support functions
are now simple C functions, making them faster to call and much less
error-prone, since the C compiler can now check function signatures.
For another, this will make it far more practical to define index access
methods in installable extensions.
A disadvantage is that SQL-level code can no longer see attributes
of index AMs; in particular, some of the crosschecks in the opr_sanity
regression test are no longer possible from SQL. We've addressed that
by adding a facility for the index AM to perform such checks instead.
(Much more could be done in that line, but for now we're content if the
amvalidate functions more or less replace what opr_sanity used to do.)
We might also want to expose some sort of reporting functionality, but
this patch doesn't do that.
Alexander Korotkov, reviewed by Petr Jelínek, and rather heavily
editorialized on by me.
2016-01-18 01:36:59 +01:00
|
|
|
<entry><structfield>amhandler</structfield></entry>
|
2008-09-15 20:43:41 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
Restructure index access method API to hide most of it at the C level.
This patch reduces pg_am to just two columns, a name and a handler
function. All the data formerly obtained from pg_am is now provided
in a C struct returned by the handler function. This is similar to
the designs we've adopted for FDWs and tablesample methods. There
are multiple advantages. For one, the index AM's support functions
are now simple C functions, making them faster to call and much less
error-prone, since the C compiler can now check function signatures.
For another, this will make it far more practical to define index access
methods in installable extensions.
A disadvantage is that SQL-level code can no longer see attributes
of index AMs; in particular, some of the crosschecks in the opr_sanity
regression test are no longer possible from SQL. We've addressed that
by adding a facility for the index AM to perform such checks instead.
(Much more could be done in that line, but for now we're content if the
amvalidate functions more or less replace what opr_sanity used to do.)
We might also want to expose some sort of reporting functionality, but
this patch doesn't do that.
Alexander Korotkov, reviewed by Petr Jelínek, and rather heavily
editorialized on by me.
2016-01-18 01:36:59 +01:00
|
|
|
<entry>
|
|
|
|
OID of a handler function that is responsible for supplying information
|
|
|
|
about the access method
|
|
|
|
</entry>
|
2006-07-04 00:45:41 +02:00
|
|
|
</row>
|
|
|
|
|
2002-07-30 07:24:56 +02:00
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
|
|
|
<sect1 id="catalog-pg-amop">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_amop</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-amop">
|
|
|
|
<primary>pg_amop</primary>
|
|
|
|
</indexterm>
|
2002-07-30 07:24:56 +02:00
|
|
|
|
|
|
|
<para>
|
2006-12-23 01:43:13 +01:00
|
|
|
The catalog <structname>pg_amop</structname> stores information about
|
|
|
|
operators associated with access method operator families. There is one
|
2010-11-24 20:20:39 +01:00
|
|
|
row for each operator that is a member of an operator family. A family
|
|
|
|
member can be either a <firstterm>search</> operator or an
|
|
|
|
<firstterm>ordering</> operator. An operator
|
Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
Also update two error messages mentioned in the documenation to match.
2007-01-31 21:56:20 +01:00
|
|
|
can appear in more than one family, but cannot appear in more than one
|
2010-11-24 20:20:39 +01:00
|
|
|
search position nor more than one ordering position within a family.
|
|
|
|
(It is allowed, though unlikely, for an operator to be used for both
|
|
|
|
search and ordering purposes.)
|
2002-07-30 07:24:56 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_amop</> Columns</title>
|
2002-07-30 07:24:56 +02:00
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2002-07-30 07:24:56 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
|
2012-12-15 06:42:47 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-07-30 07:24:56 +02:00
|
|
|
<row>
|
2006-12-23 01:43:13 +01:00
|
|
|
<entry><structfield>amopfamily</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2006-12-23 01:43:13 +01:00
|
|
|
<entry><literal><link linkend="catalog-pg-opfamily"><structname>pg_opfamily</structname></link>.oid</literal></entry>
|
|
|
|
<entry>The operator family this entry is for</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
2003-11-12 22:15:59 +01:00
|
|
|
<row>
|
2006-12-23 01:43:13 +01:00
|
|
|
<entry><structfield>amoplefttype</structfield></entry>
|
2003-11-12 22:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2006-12-23 01:43:13 +01:00
|
|
|
<entry>Left-hand input data type of operator</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>amoprighttype</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
|
|
|
<entry>Right-hand input data type of operator</entry>
|
2003-11-12 22:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
2002-07-30 07:24:56 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>amopstrategy</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>int2</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Operator strategy number</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
2010-11-24 20:20:39 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>amoppurpose</structfield></entry>
|
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Operator purpose, either <literal>s</> for search or
|
|
|
|
<literal>o</> for ordering</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-07-30 07:24:56 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>amopopr</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>OID of the operator</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
2006-12-23 01:43:13 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>amopmethod</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-am"><structname>pg_am</structname></link>.oid</literal></entry>
|
|
|
|
<entry>Index access method operator family is for</entry>
|
|
|
|
</row>
|
|
|
|
|
2010-11-24 20:20:39 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>amopsortfamily</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-opfamily"><structname>pg_opfamily</structname></link>.oid</literal></entry>
|
2014-07-17 04:20:15 +02:00
|
|
|
<entry>The B-tree operator family this entry sorts according to, if an
|
2010-11-24 20:20:39 +01:00
|
|
|
ordering operator; zero if a search operator</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-07-30 07:24:56 +02:00
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
2010-11-24 20:20:39 +01:00
|
|
|
<para>
|
|
|
|
A <quote>search</> operator entry indicates that an index of this operator
|
|
|
|
family can be searched to find all rows satisfying
|
|
|
|
<literal>WHERE</>
|
|
|
|
<replaceable>indexed_column</>
|
|
|
|
<replaceable>operator</>
|
|
|
|
<replaceable>constant</>.
|
2014-07-17 04:20:15 +02:00
|
|
|
Obviously, such an operator must return <type>boolean</type>, and its left-hand input
|
2010-11-24 20:20:39 +01:00
|
|
|
type must match the index's column data type.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
An <quote>ordering</> operator entry indicates that an index of this
|
|
|
|
operator family can be scanned to return rows in the order represented by
|
|
|
|
<literal>ORDER BY</>
|
|
|
|
<replaceable>indexed_column</>
|
|
|
|
<replaceable>operator</>
|
|
|
|
<replaceable>constant</>.
|
|
|
|
Such an operator could return any sortable data type, though again
|
|
|
|
its left-hand input type must match the index's column data type.
|
|
|
|
The exact semantics of the <literal>ORDER BY</> are specified by the
|
|
|
|
<structfield>amopsortfamily</structfield> column, which must reference
|
2014-07-17 04:20:15 +02:00
|
|
|
a B-tree operator family for the operator's result type.
|
2010-11-24 20:20:39 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<note>
|
|
|
|
<para>
|
|
|
|
At present, it's assumed that the sort order for an ordering operator
|
2014-07-17 04:20:15 +02:00
|
|
|
is the default for the referenced operator family, i.e., <literal>ASC NULLS
|
2010-11-24 20:20:39 +01:00
|
|
|
LAST</>. This might someday be relaxed by adding additional columns
|
|
|
|
to specify sort options explicitly.
|
|
|
|
</para>
|
|
|
|
</note>
|
|
|
|
|
2006-12-23 01:43:13 +01:00
|
|
|
<para>
|
|
|
|
An entry's <structfield>amopmethod</> must match the
|
|
|
|
<structname>opfmethod</> of its containing operator family (including
|
|
|
|
<structfield>amopmethod</> here is an intentional denormalization of the
|
|
|
|
catalog structure for performance reasons). Also,
|
|
|
|
<structfield>amoplefttype</> and <structfield>amoprighttype</> must match
|
|
|
|
the <structfield>oprleft</> and <structfield>oprright</> fields of the
|
|
|
|
referenced <structname>pg_operator</> entry.
|
|
|
|
</para>
|
|
|
|
|
2002-07-30 07:24:56 +02:00
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
|
|
|
<sect1 id="catalog-pg-amproc">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_amproc</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-amproc">
|
|
|
|
<primary>pg_amproc</primary>
|
|
|
|
</indexterm>
|
2002-07-30 07:24:56 +02:00
|
|
|
|
|
|
|
<para>
|
2006-12-23 01:43:13 +01:00
|
|
|
The catalog <structname>pg_amproc</structname> stores information about
|
|
|
|
support procedures associated with access method operator families. There
|
|
|
|
is one row for each support procedure belonging to an operator family.
|
2002-07-30 07:24:56 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_amproc</structname> Columns</title>
|
2002-07-30 07:24:56 +02:00
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2002-07-30 07:24:56 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
|
2012-12-15 06:42:47 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-07-30 07:24:56 +02:00
|
|
|
<row>
|
2006-12-23 01:43:13 +01:00
|
|
|
<entry><structfield>amprocfamily</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2006-12-23 01:43:13 +01:00
|
|
|
<entry><literal><link linkend="catalog-pg-opfamily"><structname>pg_opfamily</structname></link>.oid</literal></entry>
|
|
|
|
<entry>The operator family this entry is for</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>amproclefttype</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
|
|
|
<entry>Left-hand input data type of associated operator</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
2003-11-12 22:15:59 +01:00
|
|
|
<row>
|
2006-12-23 01:43:13 +01:00
|
|
|
<entry><structfield>amprocrighttype</structfield></entry>
|
2003-11-12 22:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2006-12-23 01:43:13 +01:00
|
|
|
<entry>Right-hand input data type of associated operator</entry>
|
2003-11-12 22:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
2002-07-30 07:24:56 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>amprocnum</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>int2</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Support procedure number</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>amproc</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>OID of the procedure</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
2006-12-23 01:43:13 +01:00
|
|
|
<para>
|
|
|
|
The usual interpretation of the
|
|
|
|
<structfield>amproclefttype</> and <structfield>amprocrighttype</> fields
|
|
|
|
is that they identify the left and right input types of the operator(s)
|
|
|
|
that a particular support procedure supports. For some access methods
|
|
|
|
these match the input data type(s) of the support procedure itself, for
|
|
|
|
others not. There is a notion of <quote>default</> support procedures for
|
|
|
|
an index, which are those with <structfield>amproclefttype</> and
|
2014-07-17 04:20:15 +02:00
|
|
|
<structfield>amprocrighttype</> both equal to the index operator class's
|
2006-12-23 01:43:13 +01:00
|
|
|
<structfield>opcintype</>.
|
|
|
|
</para>
|
|
|
|
|
2002-07-30 07:24:56 +02:00
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-attrdef">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_attrdef</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-attrdef">
|
|
|
|
<primary>pg_attrdef</primary>
|
|
|
|
</indexterm>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_attrdef</structname> stores column default values. The main information
|
2000-11-29 21:15:59 +01:00
|
|
|
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>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_attrdef</> Columns</title>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2000-11-29 21:15:59 +01:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
2012-12-15 06:42:47 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>adrelid</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>The table this column belongs to</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>adnum</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int2</type></entry>
|
2003-09-13 00:17:24 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attnum</literal></entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
<entry>The number of the column</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>adbin</structfield></entry>
|
2010-09-03 03:34:55 +02:00
|
|
|
<entry><type>pg_node_tree</type></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>The internal representation of the column default value</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>adsrc</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>A human-readable representation of the default value</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
2005-01-06 00:42:03 +01:00
|
|
|
<para>
|
|
|
|
The <structfield>adsrc</structfield> field is historical, and is best
|
|
|
|
not used, because it does not track outside changes that might affect
|
|
|
|
the representation of the default value. Reverse-compiling the
|
|
|
|
<structfield>adbin</structfield> field (with <function>pg_get_expr</> for
|
|
|
|
example) is a better way to display the default value.
|
|
|
|
</para>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-attribute">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_attribute</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-attribute">
|
|
|
|
<primary>pg_attribute</primary>
|
|
|
|
</indexterm>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_attribute</structname> stores information about
|
2000-11-29 21:15:59 +01:00
|
|
|
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
|
2005-01-06 00:42:03 +01:00
|
|
|
indexes, and indeed all objects that have <structname>pg_class</structname>
|
|
|
|
entries.)
|
2000-11-29 21:15:59 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The term attribute is equivalent to column and is used for
|
|
|
|
historical reasons.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_attribute</> Columns</title>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2000-11-29 21:15:59 +01:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>attrelid</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>The table this column belongs to</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>attname</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>The column name</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>atttypid</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>The data type of this column</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>attstattarget</structfield></entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
<entry><type>int4</type></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
<structfield>attstattarget</structfield> controls the level of detail
|
|
|
|
of statistics accumulated for this column by
|
2010-04-03 09:23:02 +02:00
|
|
|
<xref linkend="sql-analyze">.
|
2001-05-07 02:43:27 +02:00
|
|
|
A zero value indicates that no statistics should be collected.
|
2002-07-31 19:19:54 +02:00
|
|
|
A negative value says to use the system default statistics target.
|
2003-04-15 15:23:35 +02:00
|
|
|
The exact meaning of positive values is data type-dependent.
|
|
|
|
For scalar data types, <structfield>attstattarget</structfield>
|
2001-05-07 02:43:27 +02:00
|
|
|
is both the target number of <quote>most common values</quote>
|
2010-08-17 06:37:21 +02:00
|
|
|
to collect, and the target number of histogram bins to create.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>attlen</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int2</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
A copy of <literal>pg_type.typlen</literal> of this column's
|
|
|
|
type
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>attnum</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<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>,
|
2010-08-17 06:37:21 +02:00
|
|
|
have (arbitrary) negative numbers.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>attndims</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
<entry>
|
2001-11-03 22:42:47 +01:00
|
|
|
Number of dimensions, if the column is an array type; otherwise 0.
|
|
|
|
(Presently, the number of dimensions of an array is not enforced,
|
2010-08-17 06:37:21 +02:00
|
|
|
so any nonzero value effectively means <quote>it's an array</>.)
|
2001-05-07 02:43:27 +02:00
|
|
|
</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>attcacheoff</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2003-11-01 02:56:29 +01:00
|
|
|
Always -1 in storage, but when loaded into a row descriptor
|
Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
Also update two error messages mentioned in the documenation to match.
2007-01-31 21:56:20 +01:00
|
|
|
in memory this might be updated to cache the offset of the attribute
|
2006-11-12 07:25:37 +01:00
|
|
|
within the row
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>atttypmod</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<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
|
2002-09-24 23:26:44 +02:00
|
|
|
type-specific input functions and length coercion functions.
|
2010-08-17 06:37:21 +02:00
|
|
|
The value will generally be -1 for types that do not need <structfield>atttypmod</>.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>attbyval</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
A copy of <literal>pg_type.typbyval</> of this column's type
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>attstorage</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
Normally a copy of <literal>pg_type.typstorage</> of this
|
|
|
|
column's type. For TOAST-able data types, this can be altered
|
2010-08-17 06:37:21 +02:00
|
|
|
after column creation to control storage policy.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>attalign</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
A copy of <literal>pg_type.typalign</> of this column's type
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>attnotnull</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2014-10-11 23:23:57 +02:00
|
|
|
This represents a not-null constraint.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>atthasdef</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
This column has a default value, in which case there will be a
|
|
|
|
corresponding entry in the <structname>pg_attrdef</structname>
|
2010-08-17 06:37:21 +02:00
|
|
|
catalog that actually defines the value.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-08-02 20:15:10 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>attisdropped</structfield></entry>
|
2002-08-02 20:15:10 +02:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
This column has been dropped and is no longer valid. A dropped
|
|
|
|
column is still physically present in the table, but is
|
2010-08-17 06:37:21 +02:00
|
|
|
ignored by the parser and so cannot be accessed via SQL.
|
2002-08-02 20:15:10 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-08-30 21:23:20 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>attislocal</structfield></entry>
|
2002-08-30 21:23:20 +02:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
Also update two error messages mentioned in the documenation to match.
2007-01-31 21:56:20 +01:00
|
|
|
This column is defined locally in the relation. Note that a column can
|
2010-08-17 06:37:21 +02:00
|
|
|
be locally defined and inherited simultaneously.
|
2002-09-22 21:42:52 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>attinhcount</structfield></entry>
|
2002-09-22 21:42:52 +02:00
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
Replace the hard-wired type knowledge in TypeCategory() and IsPreferredType()
with system catalog lookups, as was foreseen to be necessary almost since
their creation. Instead put the information into two new pg_type columns,
typcategory and typispreferred. Add support for setting these when
creating a user-defined base type.
The category column is just a "char" (i.e. a poor man's enum), allowing
a crude form of user extensibility of the category list: just use an
otherwise-unused character. This seems sufficient for foreseen uses,
but we could upgrade to having an actual category catalog someday, if
there proves to be a huge demand for custom type categories.
In this patch I have attempted to hew exactly to the behavior of the
previous hardwired logic, except for introducing new type categories for
arrays, composites, and enums. In particular the default preferred state
for user-defined types remains TRUE. That seems worth revisiting, but it
should be done as a separate patch from introducing the infrastructure.
Likewise, any adjustment of the standard set of categories should be done
separately.
2008-07-30 19:05:05 +02:00
|
|
|
The number of direct ancestors this column has. A column with a
|
2010-08-17 06:37:21 +02:00
|
|
|
nonzero number of ancestors cannot be dropped nor renamed.
|
2002-08-30 21:23:20 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2011-02-08 22:04:18 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>attcollation</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-collation"><structname>pg_collation</structname></link>.oid</literal></entry>
|
|
|
|
<entry>
|
2011-03-08 23:10:34 +01:00
|
|
|
The defined collation of the column, or zero if the column is
|
2011-05-19 00:14:45 +02:00
|
|
|
not of a collatable data type.
|
2011-02-08 22:04:18 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2009-01-22 21:16:10 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>attacl</structfield></entry>
|
|
|
|
<entry><type>aclitem[]</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
Column-level access privileges, if any have been granted specifically
|
|
|
|
on this column
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2010-01-22 17:40:19 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>attoptions</structfield></entry>
|
|
|
|
<entry><type>text[]</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
Attribute-level options, as <quote>keyword=value</> strings
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2011-08-05 19:24:03 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>attfdwoptions</structfield></entry>
|
|
|
|
<entry><type>text[]</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
Attribute-level foreign data wrapper options, as <quote>keyword=value</> strings
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
2005-01-06 00:42:03 +01:00
|
|
|
|
|
|
|
<para>
|
|
|
|
In a dropped column's <structname>pg_attribute</structname> entry,
|
Replace the hard-wired type knowledge in TypeCategory() and IsPreferredType()
with system catalog lookups, as was foreseen to be necessary almost since
their creation. Instead put the information into two new pg_type columns,
typcategory and typispreferred. Add support for setting these when
creating a user-defined base type.
The category column is just a "char" (i.e. a poor man's enum), allowing
a crude form of user extensibility of the category list: just use an
otherwise-unused character. This seems sufficient for foreseen uses,
but we could upgrade to having an actual category catalog someday, if
there proves to be a huge demand for custom type categories.
In this patch I have attempted to hew exactly to the behavior of the
previous hardwired logic, except for introducing new type categories for
arrays, composites, and enums. In particular the default preferred state
for user-defined types remains TRUE. That seems worth revisiting, but it
should be done as a separate patch from introducing the infrastructure.
Likewise, any adjustment of the standard set of categories should be done
separately.
2008-07-30 19:05:05 +02:00
|
|
|
<structfield>atttypid</structfield> is reset to zero, but
|
2005-01-06 00:42:03 +01:00
|
|
|
<structfield>attlen</structfield> and the other fields copied from
|
|
|
|
<structname>pg_type</> are still valid. This arrangement is needed
|
|
|
|
to cope with the situation where the dropped column's data type was
|
|
|
|
later dropped, and so there is no <structname>pg_type</> row anymore.
|
|
|
|
<structfield>attlen</structfield> and the other fields can be used
|
|
|
|
to interpret the contents of a row of the table.
|
|
|
|
</para>
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
|
2005-06-28 07:09:14 +02:00
|
|
|
<sect1 id="catalog-pg-authid">
|
|
|
|
<title><structname>pg_authid</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-authid">
|
|
|
|
<primary>pg_authid</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The catalog <structname>pg_authid</structname> contains information about
|
|
|
|
database authorization identifiers (roles). A role subsumes the concepts
|
|
|
|
of <quote>users</> and <quote>groups</>. A user is essentially just a
|
|
|
|
role with the <structfield>rolcanlogin</> flag set. Any role (with or
|
Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
Also update two error messages mentioned in the documenation to match.
2007-01-31 21:56:20 +01:00
|
|
|
without <structfield>rolcanlogin</>) can have other roles as members; see
|
2005-06-28 07:09:14 +02:00
|
|
|
<link linkend="catalog-pg-auth-members"><structname>pg_auth_members</structname></link>.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Since this catalog contains passwords, it must not be publicly readable.
|
|
|
|
<link linkend="view-pg-roles"><structname>pg_roles</structname></link>
|
|
|
|
is a publicly readable view on
|
|
|
|
<structname>pg_authid</structname> that blanks out the password field.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<xref linkend="user-manag"> contains detailed information about user and
|
|
|
|
privilege management.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Because user identities are cluster-wide,
|
|
|
|
<structname>pg_authid</structname>
|
|
|
|
is shared across all databases of a cluster: there is only one
|
|
|
|
copy of <structname>pg_authid</structname> per cluster, not
|
|
|
|
one per database.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_authid</> Columns</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="3">
|
2005-06-28 07:09:14 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
2012-12-15 06:42:47 +01:00
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
|
|
|
</row>
|
|
|
|
|
2005-06-28 07:09:14 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>rolname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry>Role name</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2014-12-23 19:35:49 +01:00
|
|
|
<entry><structfield>rolsuper</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
2005-06-28 07:09:14 +02:00
|
|
|
<entry>Role has superuser privileges</entry>
|
|
|
|
</row>
|
|
|
|
|
2005-07-26 18:38:29 +02:00
|
|
|
<row>
|
2014-12-23 19:35:49 +01:00
|
|
|
<entry><structfield>rolinherit</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry>Role automatically inherits privileges of roles it is a
|
|
|
|
member of</entry>
|
2005-07-26 18:38:29 +02:00
|
|
|
</row>
|
|
|
|
|
2005-06-28 07:09:14 +02:00
|
|
|
<row>
|
2014-12-23 19:35:49 +01:00
|
|
|
<entry><structfield>rolcreaterole</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
Also update two error messages mentioned in the documenation to match.
2007-01-31 21:56:20 +01:00
|
|
|
<entry>Role can create more roles</entry>
|
2005-06-28 07:09:14 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2014-12-23 19:35:49 +01:00
|
|
|
<entry><structfield>rolcreatedb</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
Also update two error messages mentioned in the documenation to match.
2007-01-31 21:56:20 +01:00
|
|
|
<entry>Role can create databases</entry>
|
2005-06-28 07:09:14 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2014-12-23 19:35:49 +01:00
|
|
|
<entry><structfield>rolcanlogin</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
2005-06-28 07:09:14 +02:00
|
|
|
<entry>
|
Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
Also update two error messages mentioned in the documenation to match.
2007-01-31 21:56:20 +01:00
|
|
|
Role can log in. That is, this role can be given as the initial
|
2011-07-04 04:12:14 +02:00
|
|
|
session authorization identifier
|
2005-06-28 07:09:14 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2010-12-29 11:05:03 +01:00
|
|
|
<row>
|
2014-12-23 19:35:49 +01:00
|
|
|
<entry><structfield>rolreplication</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
2010-12-29 11:05:03 +01:00
|
|
|
<entry>
|
|
|
|
Role is a replication role. That is, this role can initiate streaming
|
|
|
|
replication (see <xref linkend="streaming-replication">) and set/unset
|
|
|
|
the system backup mode using <function>pg_start_backup</> and
|
2011-07-04 04:12:14 +02:00
|
|
|
<function>pg_stop_backup</>
|
2010-12-29 11:05:03 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2015-01-29 03:47:15 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>rolbypassrls</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry>
|
2015-10-04 02:19:57 +02:00
|
|
|
Role bypasses every row level security policy, see
|
2015-01-29 03:47:15 +01:00
|
|
|
<xref linkend="ddl-rowsecurity"> for more information.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2005-07-31 19:19:22 +02:00
|
|
|
<row>
|
2014-12-23 19:35:49 +01:00
|
|
|
<entry><structfield>rolconnlimit</structfield></entry>
|
|
|
|
<entry><type>int4</type></entry>
|
2005-07-31 19:19:22 +02:00
|
|
|
<entry>
|
2014-12-23 19:35:49 +01:00
|
|
|
For roles that can log in, this sets maximum number of concurrent
|
|
|
|
connections this role can make. -1 means no limit.
|
2005-07-31 19:19:22 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2014-12-23 19:35:49 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>rolpassword</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry>
|
|
|
|
Password (possibly encrypted); null if none. If the password
|
|
|
|
is encrypted, this column will begin with the string <literal>md5</>
|
|
|
|
followed by a 32-character hexadecimal MD5 hash. The MD5 hash
|
|
|
|
will be of the user's password concatenated to their user name.
|
|
|
|
For example, if user <literal>joe</> has password <literal>xyzzy</>,
|
|
|
|
<productname>PostgreSQL</> will store the md5 hash of
|
|
|
|
<literal>xyzzyjoe</>. A password that does not follow that
|
|
|
|
format is assumed to be unencrypted.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>rolvaliduntil</structfield></entry>
|
|
|
|
<entry><type>timestamptz</type></entry>
|
|
|
|
<entry>Password expiry time (only used for password authentication);
|
|
|
|
null if no expiration</entry>
|
|
|
|
</row>
|
2005-06-28 07:09:14 +02:00
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
|
|
|
<sect1 id="catalog-pg-auth-members">
|
|
|
|
<title><structname>pg_auth_members</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-auth-members">
|
|
|
|
<primary>pg_auth_members</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The catalog <structname>pg_auth_members</structname> shows the membership
|
|
|
|
relations between roles. Any non-circular set of relationships is allowed.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Because user identities are cluster-wide,
|
|
|
|
<structname>pg_auth_members</structname>
|
|
|
|
is shared across all databases of a cluster: there is only one
|
|
|
|
copy of <structname>pg_auth_members</structname> per cluster, not
|
|
|
|
one per database.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_auth_members</> Columns</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2005-06-28 07:09:14 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>roleid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
|
|
|
|
<entry>ID of a role that has a member</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>member</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
|
|
|
|
<entry>ID of a role that is a member of <structfield>roleid</></entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>grantor</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
|
|
|
|
<entry>ID of the role that granted this membership</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>admin_option</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
Also update two error messages mentioned in the documenation to match.
2007-01-31 21:56:20 +01:00
|
|
|
<entry>True if <structfield>member</> can grant membership in
|
2005-06-28 07:09:14 +02:00
|
|
|
<structfield>roleid</> to others</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
2002-07-22 22:23:19 +02:00
|
|
|
<sect1 id="catalog-pg-cast">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_cast</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-cast">
|
|
|
|
<primary>pg_cast</primary>
|
|
|
|
</indexterm>
|
2002-07-22 22:23:19 +02:00
|
|
|
|
|
|
|
<para>
|
2007-06-05 23:31:09 +02:00
|
|
|
The catalog <structname>pg_cast</structname> stores data type conversion
|
2012-05-11 00:02:37 +02:00
|
|
|
paths, both built-in and user-defined.
|
2002-07-22 22:23:19 +02:00
|
|
|
</para>
|
|
|
|
|
2007-06-05 23:31:09 +02:00
|
|
|
<para>
|
|
|
|
It should be noted that <structname>pg_cast</structname> does not represent
|
|
|
|
every type conversion that the system knows how to perform; only those that
|
|
|
|
cannot be deduced from some generic rule. For example, casting between a
|
|
|
|
domain and its base type is not explicitly represented in
|
|
|
|
<structname>pg_cast</structname>. Another important exception is that
|
2008-10-31 09:39:22 +01:00
|
|
|
<quote>automatic I/O conversion casts</>, those performed using a data
|
|
|
|
type's own I/O functions to convert to or from <type>text</> or other
|
|
|
|
string types, are not explicitly represented in
|
|
|
|
<structname>pg_cast</structname>.
|
2007-06-05 23:31:09 +02:00
|
|
|
</para>
|
|
|
|
|
2002-07-22 22:23:19 +02:00
|
|
|
<table>
|
2008-01-29 14:03:50 +01:00
|
|
|
<title><structname>pg_cast</> Columns</title>
|
2002-07-22 22:23:19 +02:00
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2002-07-22 22:23:19 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
2012-12-15 06:42:47 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-07-22 22:23:19 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>castsource</structfield></entry>
|
2002-07-22 22:23:19 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2002-07-22 22:23:19 +02:00
|
|
|
<entry>OID of the source data type</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>casttarget</structfield></entry>
|
2002-07-22 22:23:19 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2002-07-22 22:23:19 +02:00
|
|
|
<entry>OID of the target data type</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>castfunc</structfield></entry>
|
2002-07-22 22:23:19 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2002-07-22 22:23:19 +02:00
|
|
|
<entry>
|
Extend pg_cast castimplicit column to a three-way value; this allows us
to be flexible about assignment casts without introducing ambiguity in
operator/function resolution. Introduce a well-defined promotion hierarchy
for numeric datatypes (int2->int4->int8->numeric->float4->float8).
Change make_const to initially label numeric literals as int4, int8, or
numeric (never float8 anymore).
Explicitly mark Func and RelabelType nodes to indicate whether they came
from a function call, explicit cast, or implicit cast; use this to do
reverse-listing more accurately and without so many heuristics.
Explicit casts to char, varchar, bit, varbit will truncate or pad without
raising an error (the pre-7.2 behavior), while assigning to a column without
any explicit cast will still raise an error for wrong-length data like 7.3.
This more nearly follows the SQL spec than 7.2 behavior (we should be
reporting a 'completion condition' in the explicit-cast cases, but we have
no mechanism for that, so just do silent truncation).
Fix some problems with enforcement of typmod for array elements;
it didn't work at all in 'UPDATE ... SET array[n] = foo', for example.
Provide a generalized array_length_coerce() function to replace the
specialized per-array-type functions that used to be needed (and were
missing for NUMERIC as well as all the datetime types).
Add missing conversions int8<->float4, text<->numeric, oid<->int8.
initdb forced.
2002-09-18 23:35:25 +02:00
|
|
|
The OID of the function to use to perform this cast. Zero is
|
2008-10-31 09:39:22 +01:00
|
|
|
stored if the cast method doesn't require a function.
|
2002-07-22 22:23:19 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>castcontext</structfield></entry>
|
Extend pg_cast castimplicit column to a three-way value; this allows us
to be flexible about assignment casts without introducing ambiguity in
operator/function resolution. Introduce a well-defined promotion hierarchy
for numeric datatypes (int2->int4->int8->numeric->float4->float8).
Change make_const to initially label numeric literals as int4, int8, or
numeric (never float8 anymore).
Explicitly mark Func and RelabelType nodes to indicate whether they came
from a function call, explicit cast, or implicit cast; use this to do
reverse-listing more accurately and without so many heuristics.
Explicit casts to char, varchar, bit, varbit will truncate or pad without
raising an error (the pre-7.2 behavior), while assigning to a column without
any explicit cast will still raise an error for wrong-length data like 7.3.
This more nearly follows the SQL spec than 7.2 behavior (we should be
reporting a 'completion condition' in the explicit-cast cases, but we have
no mechanism for that, so just do silent truncation).
Fix some problems with enforcement of typmod for array elements;
it didn't work at all in 'UPDATE ... SET array[n] = foo', for example.
Provide a generalized array_length_coerce() function to replace the
specialized per-array-type functions that used to be needed (and were
missing for NUMERIC as well as all the datetime types).
Add missing conversions int8<->float4, text<->numeric, oid<->int8.
initdb forced.
2002-09-18 23:35:25 +02:00
|
|
|
<entry><type>char</type></entry>
|
2002-07-22 22:23:19 +02:00
|
|
|
<entry></entry>
|
Extend pg_cast castimplicit column to a three-way value; this allows us
to be flexible about assignment casts without introducing ambiguity in
operator/function resolution. Introduce a well-defined promotion hierarchy
for numeric datatypes (int2->int4->int8->numeric->float4->float8).
Change make_const to initially label numeric literals as int4, int8, or
numeric (never float8 anymore).
Explicitly mark Func and RelabelType nodes to indicate whether they came
from a function call, explicit cast, or implicit cast; use this to do
reverse-listing more accurately and without so many heuristics.
Explicit casts to char, varchar, bit, varbit will truncate or pad without
raising an error (the pre-7.2 behavior), while assigning to a column without
any explicit cast will still raise an error for wrong-length data like 7.3.
This more nearly follows the SQL spec than 7.2 behavior (we should be
reporting a 'completion condition' in the explicit-cast cases, but we have
no mechanism for that, so just do silent truncation).
Fix some problems with enforcement of typmod for array elements;
it didn't work at all in 'UPDATE ... SET array[n] = foo', for example.
Provide a generalized array_length_coerce() function to replace the
specialized per-array-type functions that used to be needed (and were
missing for NUMERIC as well as all the datetime types).
Add missing conversions int8<->float4, text<->numeric, oid<->int8.
initdb forced.
2002-09-18 23:35:25 +02:00
|
|
|
<entry>
|
Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
Also update two error messages mentioned in the documenation to match.
2007-01-31 21:56:20 +01:00
|
|
|
Indicates what contexts the cast can be invoked in.
|
Extend pg_cast castimplicit column to a three-way value; this allows us
to be flexible about assignment casts without introducing ambiguity in
operator/function resolution. Introduce a well-defined promotion hierarchy
for numeric datatypes (int2->int4->int8->numeric->float4->float8).
Change make_const to initially label numeric literals as int4, int8, or
numeric (never float8 anymore).
Explicitly mark Func and RelabelType nodes to indicate whether they came
from a function call, explicit cast, or implicit cast; use this to do
reverse-listing more accurately and without so many heuristics.
Explicit casts to char, varchar, bit, varbit will truncate or pad without
raising an error (the pre-7.2 behavior), while assigning to a column without
any explicit cast will still raise an error for wrong-length data like 7.3.
This more nearly follows the SQL spec than 7.2 behavior (we should be
reporting a 'completion condition' in the explicit-cast cases, but we have
no mechanism for that, so just do silent truncation).
Fix some problems with enforcement of typmod for array elements;
it didn't work at all in 'UPDATE ... SET array[n] = foo', for example.
Provide a generalized array_length_coerce() function to replace the
specialized per-array-type functions that used to be needed (and were
missing for NUMERIC as well as all the datetime types).
Add missing conversions int8<->float4, text<->numeric, oid<->int8.
initdb forced.
2002-09-18 23:35:25 +02:00
|
|
|
<literal>e</> means only as an explicit cast (using
|
2004-06-16 03:27:00 +02:00
|
|
|
<literal>CAST</> or <literal>::</> syntax).
|
Extend pg_cast castimplicit column to a three-way value; this allows us
to be flexible about assignment casts without introducing ambiguity in
operator/function resolution. Introduce a well-defined promotion hierarchy
for numeric datatypes (int2->int4->int8->numeric->float4->float8).
Change make_const to initially label numeric literals as int4, int8, or
numeric (never float8 anymore).
Explicitly mark Func and RelabelType nodes to indicate whether they came
from a function call, explicit cast, or implicit cast; use this to do
reverse-listing more accurately and without so many heuristics.
Explicit casts to char, varchar, bit, varbit will truncate or pad without
raising an error (the pre-7.2 behavior), while assigning to a column without
any explicit cast will still raise an error for wrong-length data like 7.3.
This more nearly follows the SQL spec than 7.2 behavior (we should be
reporting a 'completion condition' in the explicit-cast cases, but we have
no mechanism for that, so just do silent truncation).
Fix some problems with enforcement of typmod for array elements;
it didn't work at all in 'UPDATE ... SET array[n] = foo', for example.
Provide a generalized array_length_coerce() function to replace the
specialized per-array-type functions that used to be needed (and were
missing for NUMERIC as well as all the datetime types).
Add missing conversions int8<->float4, text<->numeric, oid<->int8.
initdb forced.
2002-09-18 23:35:25 +02:00
|
|
|
<literal>a</> means implicitly in assignment
|
|
|
|
to a target column, as well as explicitly.
|
|
|
|
<literal>i</> means implicitly in expressions, as well as the
|
2010-08-17 06:37:21 +02:00
|
|
|
other cases.
|
Extend pg_cast castimplicit column to a three-way value; this allows us
to be flexible about assignment casts without introducing ambiguity in
operator/function resolution. Introduce a well-defined promotion hierarchy
for numeric datatypes (int2->int4->int8->numeric->float4->float8).
Change make_const to initially label numeric literals as int4, int8, or
numeric (never float8 anymore).
Explicitly mark Func and RelabelType nodes to indicate whether they came
from a function call, explicit cast, or implicit cast; use this to do
reverse-listing more accurately and without so many heuristics.
Explicit casts to char, varchar, bit, varbit will truncate or pad without
raising an error (the pre-7.2 behavior), while assigning to a column without
any explicit cast will still raise an error for wrong-length data like 7.3.
This more nearly follows the SQL spec than 7.2 behavior (we should be
reporting a 'completion condition' in the explicit-cast cases, but we have
no mechanism for that, so just do silent truncation).
Fix some problems with enforcement of typmod for array elements;
it didn't work at all in 'UPDATE ... SET array[n] = foo', for example.
Provide a generalized array_length_coerce() function to replace the
specialized per-array-type functions that used to be needed (and were
missing for NUMERIC as well as all the datetime types).
Add missing conversions int8<->float4, text<->numeric, oid<->int8.
initdb forced.
2002-09-18 23:35:25 +02:00
|
|
|
</entry>
|
2002-07-22 22:23:19 +02:00
|
|
|
</row>
|
2008-10-31 09:39:22 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>castmethod</structfield></entry>
|
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
Indicates how the cast is performed.
|
|
|
|
<literal>f</> means that the function specified in the <structfield>castfunc</> field is used.
|
|
|
|
<literal>i</> means that the input/output functions are used.
|
2010-08-17 06:37:21 +02:00
|
|
|
<literal>b</> means that the types are binary-coercible, thus no conversion is required.
|
2008-10-31 09:39:22 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
2002-07-22 22:23:19 +02:00
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
2004-06-16 03:27:00 +02:00
|
|
|
|
|
|
|
<para>
|
|
|
|
The cast functions listed in <structname>pg_cast</structname> must
|
|
|
|
always take the cast source type as their first argument type, and
|
|
|
|
return the cast destination type as their result type. A cast
|
|
|
|
function can have up to three arguments. The second argument,
|
|
|
|
if present, must be type <type>integer</>; it receives the type
|
2011-02-07 00:32:27 +01:00
|
|
|
modifier associated with the destination type, or -1
|
2004-06-16 03:27:00 +02:00
|
|
|
if there is none. The third argument,
|
|
|
|
if present, must be type <type>boolean</>; it receives <literal>true</>
|
|
|
|
if the cast is an explicit cast, <literal>false</> otherwise.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
It is legitimate to create a <structname>pg_cast</structname> entry
|
|
|
|
in which the source and target types are the same, if the associated
|
|
|
|
function takes more than one argument. Such entries represent
|
|
|
|
<quote>length coercion functions</> that coerce values of the type
|
2007-04-02 05:49:42 +02:00
|
|
|
to be legal for a particular type modifier value.
|
2004-06-16 03:27:00 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
When a <structname>pg_cast</structname> entry has different source and
|
|
|
|
target types and a function that takes more than one argument, it
|
|
|
|
represents converting from one type to another and applying a length
|
|
|
|
coercion in a single step. When no such entry is available, coercion
|
|
|
|
to a type that uses a type modifier involves two steps, one to
|
2004-12-13 19:05:10 +01:00
|
|
|
convert between data types and a second to apply the modifier.
|
2004-06-16 03:27:00 +02:00
|
|
|
</para>
|
2002-07-22 22:23:19 +02:00
|
|
|
</sect1>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-class">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_class</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-class">
|
|
|
|
<primary>pg_class</primary>
|
|
|
|
</indexterm>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_class</structname> catalogs tables and most
|
2000-11-29 21:15:59 +01:00
|
|
|
everything else that has columns or is otherwise similar to a
|
2001-08-10 20:57:42 +02:00
|
|
|
table. This includes indexes (but see also
|
2013-03-04 01:23:31 +01:00
|
|
|
<structname>pg_index</structname>), sequences, views, materialized
|
|
|
|
views, composite types, and TOAST tables; see <structfield>relkind</>.
|
2002-09-24 23:26:44 +02:00
|
|
|
Below, when we mean all of these
|
2000-11-29 21:15:59 +01:00
|
|
|
kinds of objects we speak of <quote>relations</quote>. Not all
|
2003-04-15 15:23:35 +02:00
|
|
|
columns are meaningful for all relation types.
|
2000-11-29 21:15:59 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_class</> Columns</title>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2000-11-29 21:15:59 +01:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
2012-12-15 06:42:47 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relname</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Name of the table, index, view, etc.</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-03-26 20:17:02 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relnamespace</structfield></entry>
|
2002-03-26 20:17:02 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
|
2002-03-26 20:17:02 +01:00
|
|
|
<entry>
|
|
|
|
The OID of the namespace that contains this relation
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>reltype</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>
|
2004-12-13 19:05:10 +01:00
|
|
|
The OID of the data type that corresponds to this table's row type,
|
2004-06-07 06:04:47 +02:00
|
|
|
if any (zero for indexes, which have no <structname>pg_type</> entry)
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2010-08-25 20:18:41 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>reloftype</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
|
|
|
<entry>
|
|
|
|
For typed tables, the OID of the underlying composite type,
|
|
|
|
zero for all other relations
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relowner</structfield></entry>
|
2005-06-28 07:09:14 +02:00
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>Owner of the relation</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relam</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-am"><structname>pg_am</structname></link>.oid</literal></entry>
|
2002-03-22 20:20:45 +01:00
|
|
|
<entry>If this is an index, the access method used (B-tree, hash, etc.)</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relfilenode</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
2010-02-07 21:48:13 +01:00
|
|
|
<entry>Name of the on-disk file of this relation; zero means this
|
|
|
|
is a <quote>mapped</> relation whose disk file name is determined
|
|
|
|
by low-level state</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
2004-06-18 08:14:31 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>reltablespace</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-tablespace"><structname>pg_tablespace</structname></link>.oid</literal></entry>
|
|
|
|
<entry>
|
|
|
|
The tablespace in which this relation is stored. If zero,
|
|
|
|
the database's default tablespace is implied. (Not meaningful
|
|
|
|
if the relation has no on-disk file.)
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relpages</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2004-12-01 20:00:56 +01:00
|
|
|
Size of the on-disk representation of this table in pages (of size
|
2006-11-12 07:25:37 +01:00
|
|
|
<symbol>BLCKSZ</symbol>). This is only an estimate used by the
|
|
|
|
planner. It is updated by <command>VACUUM</command>,
|
|
|
|
<command>ANALYZE</command>, and a few DDL commands such as
|
2010-08-17 06:37:21 +02:00
|
|
|
<command>CREATE INDEX</command>.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>reltuples</structfield></entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
<entry><type>float4</type></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
Number of rows in the table. This is only an estimate used by the
|
|
|
|
planner. It is updated by <command>VACUUM</command>,
|
|
|
|
<command>ANALYZE</command>, and a few DDL commands such as
|
2010-08-17 06:37:21 +02:00
|
|
|
<command>CREATE INDEX</command>.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2011-10-14 23:23:01 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>relallvisible</structfield></entry>
|
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
Number of pages that are marked all-visible in the table's
|
|
|
|
visibility map. This is only an estimate used by the
|
|
|
|
planner. It is updated by <command>VACUUM</command>,
|
|
|
|
<command>ANALYZE</command>, and a few DDL commands such as
|
|
|
|
<command>CREATE INDEX</command>.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>reltoastrelid</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
OID of the TOAST table associated with this table, 0 if none. The
|
|
|
|
TOAST table stores large attributes <quote>out of line</quote> in a
|
2010-08-17 06:37:21 +02:00
|
|
|
secondary table.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relhasindex</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2002-12-17 18:41:30 +01:00
|
|
|
<entry>
|
2009-12-07 06:22:23 +01:00
|
|
|
True if this is a table and it has (or recently had) any indexes
|
2001-08-10 20:57:42 +02:00
|
|
|
</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relisshared</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>
|
|
|
|
True if this table is shared across all databases in the cluster. Only
|
|
|
|
certain system catalogs (such as <structname>pg_database</structname>)
|
2010-08-17 06:37:21 +02:00
|
|
|
are shared.
|
2006-11-12 07:25:37 +01:00
|
|
|
</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
2009-03-31 19:59:56 +02:00
|
|
|
<row>
|
2010-12-13 19:07:08 +01:00
|
|
|
<entry><structfield>relpersistence</structfield></entry>
|
2011-01-19 22:09:08 +01:00
|
|
|
<entry><type>char</type></entry>
|
2009-03-31 19:59:56 +02:00
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2010-12-29 12:48:53 +01:00
|
|
|
<literal>p</> = permanent table, <literal>u</> = unlogged table,
|
|
|
|
<literal>t</> = temporary table
|
2009-03-31 19:59:56 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relkind</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<literal>r</> = ordinary table, <literal>i</> = index,
|
2013-03-04 01:23:31 +01:00
|
|
|
<literal>S</> = sequence, <literal>v</> = view,
|
|
|
|
<literal>m</> = materialized view,
|
|
|
|
<literal>c</> = composite type, <literal>t</> = TOAST table,
|
2011-01-02 05:48:11 +01:00
|
|
|
<literal>f</> = foreign table
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relnatts</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int2</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
Number of user columns in the relation (system columns not
|
|
|
|
counted). There must be this many corresponding entries in
|
2000-11-29 21:15:59 +01:00
|
|
|
<structname>pg_attribute</structname>. See also
|
2010-08-17 06:37:21 +02:00
|
|
|
<literal>pg_attribute.attnum</literal>.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relchecks</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int2</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2009-02-07 20:27:25 +01:00
|
|
|
Number of <literal>CHECK</> constraints on the table; see
|
2006-11-12 07:25:37 +01:00
|
|
|
<link linkend="catalog-pg-constraint"><structname>pg_constraint</structname></link> catalog
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2001-08-10 20:57:42 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relhasoids</structfield></entry>
|
2001-08-10 20:57:42 +02:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2006-01-16 19:15:31 +01:00
|
|
|
True if we generate an OID for each row of the relation
|
2001-08-10 20:57:42 +02:00
|
|
|
</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relhaspkey</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2006-01-16 19:15:31 +01:00
|
|
|
True if the table has (or once had) a primary key
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relhasrules</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>
|
2008-11-09 22:24:33 +01:00
|
|
|
True if table has (or once had) rules; see
|
2006-11-12 07:25:37 +01:00
|
|
|
<link linkend="catalog-pg-rewrite"><structname>pg_rewrite</structname></link> catalog
|
2001-10-16 00:47:47 +02:00
|
|
|
</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
2008-11-09 22:24:33 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>relhastriggers</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
True if table has (or once had) triggers; see
|
|
|
|
<link linkend="catalog-pg-trigger"><structname>pg_trigger</structname></link> catalog
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
Row-Level Security Policies (RLS)
Building on the updatable security-barrier views work, add the
ability to define policies on tables to limit the set of rows
which are returned from a query and which are allowed to be added
to a table. Expressions defined by the policy for filtering are
added to the security barrier quals of the query, while expressions
defined to check records being added to a table are added to the
with-check options of the query.
New top-level commands are CREATE/ALTER/DROP POLICY and are
controlled by the table owner. Row Security is able to be enabled
and disabled by the owner on a per-table basis using
ALTER TABLE .. ENABLE/DISABLE ROW SECURITY.
Per discussion, ROW SECURITY is disabled on tables by default and
must be enabled for policies on the table to be used. If no
policies exist on a table with ROW SECURITY enabled, a default-deny
policy is used and no records will be visible.
By default, row security is applied at all times except for the
table owner and the superuser. A new GUC, row_security, is added
which can be set to ON, OFF, or FORCE. When set to FORCE, row
security will be applied even for the table owner and superusers.
When set to OFF, row security will be disabled when allowed and an
error will be thrown if the user does not have rights to bypass row
security.
Per discussion, pg_dump sets row_security = OFF by default to ensure
that exports and backups will have all data in the table or will
error if there are insufficient privileges to bypass row security.
A new option has been added to pg_dump, --enable-row-security, to
ask pg_dump to export with row security enabled.
A new role capability, BYPASSRLS, which can only be set by the
superuser, is added to allow other users to be able to bypass row
security using row_security = OFF.
Many thanks to the various individuals who have helped with the
design, particularly Robert Haas for his feedback.
Authors include Craig Ringer, KaiGai Kohei, Adam Brightwell, Dean
Rasheed, with additional changes and rework by me.
Reviewers have included all of the above, Greg Smith,
Jeff McCormick, and Robert Haas.
2014-09-19 17:18:35 +02:00
|
|
|
<row>
|
2015-01-24 22:16:22 +01:00
|
|
|
<entry><structfield>relhassubclass</structfield></entry>
|
Row-Level Security Policies (RLS)
Building on the updatable security-barrier views work, add the
ability to define policies on tables to limit the set of rows
which are returned from a query and which are allowed to be added
to a table. Expressions defined by the policy for filtering are
added to the security barrier quals of the query, while expressions
defined to check records being added to a table are added to the
with-check options of the query.
New top-level commands are CREATE/ALTER/DROP POLICY and are
controlled by the table owner. Row Security is able to be enabled
and disabled by the owner on a per-table basis using
ALTER TABLE .. ENABLE/DISABLE ROW SECURITY.
Per discussion, ROW SECURITY is disabled on tables by default and
must be enabled for policies on the table to be used. If no
policies exist on a table with ROW SECURITY enabled, a default-deny
policy is used and no records will be visible.
By default, row security is applied at all times except for the
table owner and the superuser. A new GUC, row_security, is added
which can be set to ON, OFF, or FORCE. When set to FORCE, row
security will be applied even for the table owner and superusers.
When set to OFF, row security will be disabled when allowed and an
error will be thrown if the user does not have rights to bypass row
security.
Per discussion, pg_dump sets row_security = OFF by default to ensure
that exports and backups will have all data in the table or will
error if there are insufficient privileges to bypass row security.
A new option has been added to pg_dump, --enable-row-security, to
ask pg_dump to export with row security enabled.
A new role capability, BYPASSRLS, which can only be set by the
superuser, is added to allow other users to be able to bypass row
security using row_security = OFF.
Many thanks to the various individuals who have helped with the
design, particularly Robert Haas for his feedback.
Authors include Craig Ringer, KaiGai Kohei, Adam Brightwell, Dean
Rasheed, with additional changes and rework by me.
Reviewers have included all of the above, Greg Smith,
Jeff McCormick, and Robert Haas.
2014-09-19 17:18:35 +02:00
|
|
|
<entry><type>bool</type></entry>
|
Code review for row security.
Buildfarm member tick identified an issue where the policies in the
relcache for a relation were were being replaced underneath a running
query, leading to segfaults while processing the policies to be added
to a query. Similar to how TupleDesc RuleLocks are handled, add in a
equalRSDesc() function to check if the policies have actually changed
and, if not, swap back the rsdesc field (using the original instead of
the temporairly built one; the whole structure is swapped and then
specific fields swapped back). This now passes a CLOBBER_CACHE_ALWAYS
for me and should resolve the buildfarm error.
In addition to addressing this, add a new chapter in Data Definition
under Privileges which explains row security and provides examples of
its usage, change \d to always list policies (even if row security is
disabled- but note that it is disabled, or enabled with no policies),
rework check_role_for_policy (it really didn't need the entire policy,
but it did need to be using has_privs_of_role()), and change the field
in pg_class to relrowsecurity from relhasrowsecurity, based on
Heikki's suggestion. Also from Heikki, only issue SET ROW_SECURITY in
pg_restore when talking to a 9.5+ server, list Bypass RLS in \du, and
document --enable-row-security options for pg_dump and pg_restore.
Lastly, fix a number of minor whitespace and typo issues from Heikki,
Dimitri, add a missing #include, per Peter E, fix a few minor
variable-assigned-but-not-used and resource leak issues from Coverity
and add tab completion for role attribute bypassrls as well.
2014-09-24 22:32:22 +02:00
|
|
|
<entry></entry>
|
2015-01-24 22:16:22 +01:00
|
|
|
<entry>True if table has (or once had) any inheritance children</entry>
|
Row-Level Security Policies (RLS)
Building on the updatable security-barrier views work, add the
ability to define policies on tables to limit the set of rows
which are returned from a query and which are allowed to be added
to a table. Expressions defined by the policy for filtering are
added to the security barrier quals of the query, while expressions
defined to check records being added to a table are added to the
with-check options of the query.
New top-level commands are CREATE/ALTER/DROP POLICY and are
controlled by the table owner. Row Security is able to be enabled
and disabled by the owner on a per-table basis using
ALTER TABLE .. ENABLE/DISABLE ROW SECURITY.
Per discussion, ROW SECURITY is disabled on tables by default and
must be enabled for policies on the table to be used. If no
policies exist on a table with ROW SECURITY enabled, a default-deny
policy is used and no records will be visible.
By default, row security is applied at all times except for the
table owner and the superuser. A new GUC, row_security, is added
which can be set to ON, OFF, or FORCE. When set to FORCE, row
security will be applied even for the table owner and superusers.
When set to OFF, row security will be disabled when allowed and an
error will be thrown if the user does not have rights to bypass row
security.
Per discussion, pg_dump sets row_security = OFF by default to ensure
that exports and backups will have all data in the table or will
error if there are insufficient privileges to bypass row security.
A new option has been added to pg_dump, --enable-row-security, to
ask pg_dump to export with row security enabled.
A new role capability, BYPASSRLS, which can only be set by the
superuser, is added to allow other users to be able to bypass row
security using row_security = OFF.
Many thanks to the various individuals who have helped with the
design, particularly Robert Haas for his feedback.
Authors include Craig Ringer, KaiGai Kohei, Adam Brightwell, Dean
Rasheed, with additional changes and rework by me.
Reviewers have included all of the above, Greg Smith,
Jeff McCormick, and Robert Haas.
2014-09-19 17:18:35 +02:00
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2015-01-24 22:16:22 +01:00
|
|
|
<entry><structfield>relrowsecurity</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2015-01-24 22:16:22 +01:00
|
|
|
<entry>
|
2015-01-29 03:47:15 +01:00
|
|
|
True if table has row level security enabled; see
|
2015-01-24 22:16:22 +01:00
|
|
|
<link linkend="catalog-pg-policy"><structname>pg_policy</structname></link> catalog
|
|
|
|
</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
2015-10-05 03:05:08 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>relforcerowsecurity</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
True if row level security (when enabled) will also apply to table owner; see
|
|
|
|
<link linkend="catalog-pg-policy"><structname>pg_policy</structname></link> catalog
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2013-05-06 19:26:51 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>relispopulated</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>True if relation is populated (this is true for all
|
|
|
|
relations other than some materialized views)</entry>
|
|
|
|
</row>
|
|
|
|
|
2013-11-08 18:30:43 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>relreplident</structfield></entry>
|
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
Columns used to form <quote>replica identity</> for rows:
|
|
|
|
<literal>d</> = default (primary key, if any),
|
|
|
|
<literal>n</> = nothing,
|
|
|
|
<literal>f</> = all columns
|
2014-07-17 04:20:15 +02:00
|
|
|
<literal>i</> = index with <structfield>indisreplident</structfield> set, or default
|
2013-11-08 18:30:43 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2006-07-10 18:20:52 +02:00
|
|
|
<row>
|
Fix recently-understood problems with handling of XID freezing, particularly
in PITR scenarios. We now WAL-log the replacement of old XIDs with
FrozenTransactionId, so that such replacement is guaranteed to propagate to
PITR slave databases. Also, rather than relying on hint-bit updates to be
preserved, pg_clog is not truncated until all instances of an XID are known to
have been replaced by FrozenTransactionId. Add new GUC variables and
pg_autovacuum columns to allow management of the freezing policy, so that
users can trade off the size of pg_clog against the amount of freezing work
done. Revise the already-existing code that forces autovacuum of tables
approaching the wraparound point to make it more bulletproof; also, revise the
autovacuum logic so that anti-wraparound vacuuming is done per-table rather
than per-database. initdb forced because of changes in pg_class, pg_database,
and pg_autovacuum catalogs. Heikki Linnakangas, Simon Riggs, and Tom Lane.
2006-11-05 23:42:10 +01:00
|
|
|
<entry><structfield>relfrozenxid</structfield></entry>
|
2006-07-10 18:20:52 +02:00
|
|
|
<entry><type>xid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
Fix recently-understood problems with handling of XID freezing, particularly
in PITR scenarios. We now WAL-log the replacement of old XIDs with
FrozenTransactionId, so that such replacement is guaranteed to propagate to
PITR slave databases. Also, rather than relying on hint-bit updates to be
preserved, pg_clog is not truncated until all instances of an XID are known to
have been replaced by FrozenTransactionId. Add new GUC variables and
pg_autovacuum columns to allow management of the freezing policy, so that
users can trade off the size of pg_clog against the amount of freezing work
done. Revise the already-existing code that forces autovacuum of tables
approaching the wraparound point to make it more bulletproof; also, revise the
autovacuum logic so that anti-wraparound vacuuming is done per-table rather
than per-database. initdb forced because of changes in pg_class, pg_database,
and pg_autovacuum catalogs. Heikki Linnakangas, Simon Riggs, and Tom Lane.
2006-11-05 23:42:10 +01:00
|
|
|
All transaction IDs before this one have been replaced with a permanent
|
|
|
|
(<quote>frozen</>) transaction ID in this table. This is used to track
|
|
|
|
whether the table needs to be vacuumed in order to prevent transaction
|
|
|
|
ID wraparound or to allow <literal>pg_clog</> to be shrunk. Zero
|
2010-08-17 06:37:21 +02:00
|
|
|
(<symbol>InvalidTransactionId</symbol>) if the relation is not a table.
|
2006-07-10 18:20:52 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2013-06-27 21:20:33 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>relminmxid</structfield></entry>
|
|
|
|
<entry><type>xid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2015-06-04 06:22:49 +02:00
|
|
|
All multixact IDs before this one have been replaced by a
|
2013-06-27 21:20:33 +02:00
|
|
|
transaction ID in this table. This is used to track
|
2015-06-04 06:22:49 +02:00
|
|
|
whether the table needs to be vacuumed in order to prevent multixact ID
|
|
|
|
wraparound or to allow <literal>pg_multixact</> to be shrunk. Zero
|
|
|
|
(<symbol>InvalidMultiXactId</symbol>) if the relation is not a table.
|
2013-06-27 21:20:33 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>relacl</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>aclitem[]</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2005-01-06 00:42:03 +01:00
|
|
|
Access privileges; see
|
2010-04-03 09:23:02 +02:00
|
|
|
<xref linkend="sql-grant"> and
|
|
|
|
<xref linkend="sql-revoke">
|
2006-01-16 19:15:31 +01:00
|
|
|
for details
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
2006-07-04 00:45:41 +02:00
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>reloptions</structfield></entry>
|
|
|
|
<entry><type>text[]</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
Access-method-specific options, as <quote>keyword=value</> strings
|
|
|
|
</entry>
|
|
|
|
</row>
|
2000-11-29 21:15:59 +01:00
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
2009-12-07 06:22:23 +01:00
|
|
|
|
|
|
|
<para>
|
2010-08-17 06:37:21 +02:00
|
|
|
Several of the Boolean flags in <structname>pg_class</> are maintained
|
2009-12-07 06:22:23 +01:00
|
|
|
lazily: they are guaranteed to be true if that's the correct state, but
|
|
|
|
may not be reset to false immediately when the condition is no longer
|
|
|
|
true. For example, <structfield>relhasindex</> is set by
|
|
|
|
<command>CREATE INDEX</command>, but it is never cleared by
|
|
|
|
<command>DROP INDEX</command>. Instead, <command>VACUUM</command> clears
|
|
|
|
<structfield>relhasindex</> if it finds the table has no indexes. This
|
|
|
|
arrangement avoids race conditions and improves concurrency.
|
|
|
|
</para>
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
2013-12-30 19:27:51 +01:00
|
|
|
<sect1 id="catalog-pg-collation">
|
|
|
|
<title><structname>pg_collation</structname></title>
|
2012-07-18 16:16:16 +02:00
|
|
|
|
2013-12-30 19:27:51 +01:00
|
|
|
<indexterm zone="catalog-pg-collation">
|
|
|
|
<primary>pg_collation</primary>
|
2012-07-18 16:16:16 +02:00
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
2013-12-30 19:27:51 +01:00
|
|
|
The catalog <structname>pg_collation</structname> describes the
|
|
|
|
available collations, which are essentially mappings from an SQL
|
|
|
|
name to operating system locale categories.
|
|
|
|
See <xref linkend="collation"> for more information.
|
2012-07-18 16:16:16 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2013-12-30 19:27:51 +01:00
|
|
|
<title><structname>pg_collation</> Columns</title>
|
2012-07-18 16:16:16 +02:00
|
|
|
|
|
|
|
<tgroup cols="4">
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2013-12-30 19:27:51 +01:00
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
2012-07-18 16:16:16 +02:00
|
|
|
<entry></entry>
|
2013-12-30 19:27:51 +01:00
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
2012-07-18 16:16:16 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2013-12-30 19:27:51 +01:00
|
|
|
<entry><structfield>collname</structfield></entry>
|
2012-07-18 16:16:16 +02:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
2013-12-30 19:27:51 +01:00
|
|
|
<entry>Collation name (unique per namespace and encoding)</entry>
|
2012-07-18 16:16:16 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2013-12-30 19:27:51 +01:00
|
|
|
<entry><structfield>collnamespace</structfield></entry>
|
2012-07-18 16:16:16 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2013-12-30 19:27:51 +01:00
|
|
|
<entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
|
|
|
|
<entry>
|
|
|
|
The OID of the namespace that contains this collation
|
|
|
|
</entry>
|
2012-07-18 16:16:16 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2013-12-30 19:27:51 +01:00
|
|
|
<entry><structfield>collowner</structfield></entry>
|
2012-07-18 16:16:16 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2013-12-30 19:27:51 +01:00
|
|
|
<entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
|
|
|
|
<entry>Owner of the collation</entry>
|
2012-07-18 16:16:16 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2013-12-30 19:27:51 +01:00
|
|
|
<entry><structfield>collencoding</structfield></entry>
|
|
|
|
<entry><type>int4</type></entry>
|
2012-07-18 16:16:16 +02:00
|
|
|
<entry></entry>
|
2013-12-30 19:27:51 +01:00
|
|
|
<entry>Encoding in which the collation is applicable, or -1 if it
|
|
|
|
works for any encoding</entry>
|
2012-07-18 16:16:16 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2013-12-30 19:27:51 +01:00
|
|
|
<entry><structfield>collcollate</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
2012-07-18 16:16:16 +02:00
|
|
|
<entry></entry>
|
2013-12-30 19:27:51 +01:00
|
|
|
<entry><symbol>LC_COLLATE</> for this collation object</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>collctype</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry><symbol>LC_CTYPE</> for this collation object</entry>
|
2012-07-18 16:16:16 +02:00
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
2013-12-30 19:27:51 +01:00
|
|
|
|
|
|
|
<para>
|
|
|
|
Note that the unique key on this catalog is (<structfield>collname</>,
|
|
|
|
<structfield>collencoding</>, <structfield>collnamespace</>) not just
|
|
|
|
(<structfield>collname</>, <structfield>collnamespace</>).
|
|
|
|
<productname>PostgreSQL</productname> generally ignores all
|
|
|
|
collations that do not have <structfield>collencoding</> equal to
|
|
|
|
either the current database's encoding or -1, and creation of new entries
|
|
|
|
with the same name as an entry with <structfield>collencoding</> = -1
|
|
|
|
is forbidden. Therefore it is sufficient to use a qualified SQL name
|
|
|
|
(<replaceable>schema</>.<replaceable>name</>) to identify a collation,
|
|
|
|
even though this is not unique according to the catalog definition.
|
|
|
|
The reason for defining the catalog this way is that
|
|
|
|
<application>initdb</> fills it in at cluster initialization time with
|
|
|
|
entries for all locales available on the system, so it must be able to
|
|
|
|
hold entries for all encodings that might ever be used in the cluster.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
In the <literal>template0</> database, it could be useful to create
|
|
|
|
collations whose encoding does not match the database encoding,
|
|
|
|
since they could match the encodings of databases later cloned from
|
|
|
|
<literal>template0</>. This would currently have to be done manually.
|
|
|
|
</para>
|
2012-07-18 16:16:16 +02:00
|
|
|
</sect1>
|
|
|
|
|
2002-07-12 20:43:19 +02:00
|
|
|
<sect1 id="catalog-pg-constraint">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_constraint</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-constraint">
|
|
|
|
<primary>pg_constraint</primary>
|
|
|
|
</indexterm>
|
2002-07-12 20:43:19 +02:00
|
|
|
|
|
|
|
<para>
|
2009-12-07 06:22:23 +01:00
|
|
|
The catalog <structname>pg_constraint</structname> stores check, primary
|
|
|
|
key, unique, foreign key, and exclusion 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, not here.
|
2002-07-12 20:43:19 +02:00
|
|
|
</para>
|
|
|
|
|
2010-01-17 23:56:23 +01:00
|
|
|
<para>
|
|
|
|
User-defined constraint triggers (created with <command>CREATE CONSTRAINT
|
|
|
|
TRIGGER</>) also give rise to an entry in this table.
|
|
|
|
</para>
|
|
|
|
|
2002-07-12 20:43:19 +02:00
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
Check constraints on domains are stored here, too.
|
2002-07-12 20:43:19 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_constraint</> Columns</title>
|
2002-07-12 20:43:19 +02:00
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2002-07-12 20:43:19 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
2012-12-15 06:42:47 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-07-12 20:43:19 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>conname</structfield></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Constraint name (not necessarily unique!)</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>connamespace</structfield></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry>
|
|
|
|
The OID of the namespace that contains this constraint
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>contype</structfield></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<literal>c</> = check constraint,
|
|
|
|
<literal>f</> = foreign key constraint,
|
|
|
|
<literal>p</> = primary key constraint,
|
2009-12-07 06:22:23 +01:00
|
|
|
<literal>u</> = unique constraint,
|
2010-01-17 23:56:23 +01:00
|
|
|
<literal>t</> = constraint trigger,
|
2009-12-07 06:22:23 +01:00
|
|
|
<literal>x</> = exclusion constraint
|
2002-07-12 20:43:19 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>condeferrable</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry></entry>
|
|
|
|
<entry>Is the constraint deferrable?</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>condeferred</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry></entry>
|
|
|
|
<entry>Is the constraint deferred by default?</entry>
|
|
|
|
</row>
|
|
|
|
|
2011-02-15 01:59:29 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>convalidated</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2011-06-16 01:05:11 +02:00
|
|
|
<entry>Has the constraint been validated?
|
2011-06-02 00:43:50 +02:00
|
|
|
Currently, can only be false for foreign keys and CHECK constraints</entry>
|
2011-02-15 01:59:29 +01:00
|
|
|
</row>
|
|
|
|
|
2002-07-12 20:43:19 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>conrelid</structfield></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry>The table this constraint is on; 0 if not a table constraint</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>contypid</structfield></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry>The domain this constraint is on; 0 if not a domain constraint</entry>
|
|
|
|
</row>
|
|
|
|
|
2009-07-28 04:56:31 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>conindid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
|
|
|
<entry>The index supporting this constraint, if it's a unique, primary
|
2009-12-07 06:22:23 +01:00
|
|
|
key, foreign key, or exclusion constraint; else 0</entry>
|
2009-07-28 04:56:31 +02:00
|
|
|
</row>
|
|
|
|
|
2002-07-12 20:43:19 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>confrelid</structfield></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry>If a foreign key, the referenced table; else 0</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>confupdtype</structfield></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
2009-01-09 02:53:10 +01:00
|
|
|
<entry>Foreign key update action code:
|
2009-01-09 16:02:22 +01:00
|
|
|
<literal>a</> = no action,
|
|
|
|
<literal>r</> = restrict,
|
|
|
|
<literal>c</> = cascade,
|
|
|
|
<literal>n</> = set null,
|
|
|
|
<literal>d</> = set default
|
|
|
|
</entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>confdeltype</structfield></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
2009-01-09 02:53:10 +01:00
|
|
|
<entry>Foreign key deletion action code:
|
2009-01-09 16:02:22 +01:00
|
|
|
<literal>a</> = no action,
|
|
|
|
<literal>r</> = restrict,
|
|
|
|
<literal>c</> = cascade,
|
|
|
|
<literal>n</> = set null,
|
|
|
|
<literal>d</> = set default
|
|
|
|
</entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>confmatchtype</structfield></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
2009-01-09 02:53:10 +01:00
|
|
|
<entry>Foreign key match type:
|
2009-01-09 16:02:22 +01:00
|
|
|
<literal>f</> = full,
|
|
|
|
<literal>p</> = partial,
|
2012-06-18 02:16:07 +02:00
|
|
|
<literal>s</> = simple
|
2009-01-09 16:02:22 +01:00
|
|
|
</entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
</row>
|
|
|
|
|
2008-05-10 01:32:05 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>conislocal</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2009-12-07 06:22:23 +01:00
|
|
|
This constraint is defined locally for the relation. Note that a
|
2010-08-17 06:37:21 +02:00
|
|
|
constraint can be locally defined and inherited simultaneously.
|
2008-05-10 01:32:05 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>coninhcount</structfield></entry>
|
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2009-12-07 06:22:23 +01:00
|
|
|
The number of direct inheritance ancestors this constraint has.
|
|
|
|
A constraint with
|
2010-08-17 06:37:21 +02:00
|
|
|
a nonzero number of ancestors cannot be dropped nor renamed.
|
2008-05-10 01:32:05 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2011-12-05 19:10:18 +01:00
|
|
|
<row>
|
2012-09-12 20:23:50 +02:00
|
|
|
<entry><structfield>connoinherit</structfield></entry>
|
2011-12-05 19:10:18 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
This constraint is defined locally for the relation. It is a
|
|
|
|
non-inheritable constraint.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-07-12 20:43:19 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>conkey</structfield></entry>
|
2002-09-24 23:26:44 +02:00
|
|
|
<entry><type>int2[]</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attnum</></entry>
|
2010-01-17 23:56:23 +01:00
|
|
|
<entry>If a table constraint (including foreign keys, but not constraint
|
|
|
|
triggers), list of the constrained columns</entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>confkey</structfield></entry>
|
2002-09-24 23:26:44 +02:00
|
|
|
<entry><type>int2[]</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attnum</></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry>If a foreign key, list of the referenced columns</entry>
|
|
|
|
</row>
|
|
|
|
|
2007-02-14 02:58:58 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>conpfeqop</structfield></entry>
|
|
|
|
<entry><type>oid[]</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</></entry>
|
|
|
|
<entry>If a foreign key, list of the equality operators for PK = FK comparisons</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>conppeqop</structfield></entry>
|
|
|
|
<entry><type>oid[]</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</></entry>
|
|
|
|
<entry>If a foreign key, list of the equality operators for PK = PK comparisons</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>conffeqop</structfield></entry>
|
|
|
|
<entry><type>oid[]</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</></entry>
|
|
|
|
<entry>If a foreign key, list of the equality operators for FK = FK comparisons</entry>
|
|
|
|
</row>
|
|
|
|
|
2009-12-07 06:22:23 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>conexclop</structfield></entry>
|
|
|
|
<entry><type>oid[]</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</></entry>
|
|
|
|
<entry>If an exclusion constraint, list of the per-column exclusion operators</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-07-12 20:43:19 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>conbin</structfield></entry>
|
2010-09-03 03:34:55 +02:00
|
|
|
<entry><type>pg_node_tree</type></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry></entry>
|
|
|
|
<entry>If a check constraint, an internal representation of the expression</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>consrc</structfield></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>If a check constraint, a human-readable representation of the expression</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
2009-12-07 06:22:23 +01:00
|
|
|
<para>
|
|
|
|
In the case of an exclusion constraint, <structfield>conkey</structfield>
|
|
|
|
is only useful for constraint elements that are simple column references.
|
|
|
|
For other cases, a zero appears in <structfield>conkey</structfield>
|
|
|
|
and the associated index must be consulted to discover the expression
|
|
|
|
that is constrained. (<structfield>conkey</structfield> thus has the
|
|
|
|
same contents as <structname>pg_index</>.<structfield>indkey</> for the
|
|
|
|
index.)
|
|
|
|
</para>
|
|
|
|
|
2003-10-17 02:55:17 +02:00
|
|
|
<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>
|
|
|
|
|
2002-07-12 20:43:19 +02:00
|
|
|
<note>
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
<literal>pg_class.relchecks</literal> needs to agree with the
|
2007-02-14 02:58:58 +01:00
|
|
|
number of check-constraint entries found in this table for each
|
2011-01-25 23:51:59 +01:00
|
|
|
relation.
|
2002-07-12 20:43:19 +02:00
|
|
|
</para>
|
|
|
|
</note>
|
|
|
|
</sect1>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
2011-02-08 22:04:18 +01:00
|
|
|
|
2002-07-24 07:51:56 +02:00
|
|
|
<sect1 id="catalog-pg-conversion">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_conversion</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-conversion">
|
|
|
|
<primary>pg_conversion</primary>
|
|
|
|
</indexterm>
|
2002-07-24 07:51:56 +02:00
|
|
|
|
|
|
|
<para>
|
2011-01-28 00:42:12 +01:00
|
|
|
The catalog <structname>pg_conversion</structname> describes
|
|
|
|
encoding conversion procedures. See <xref linkend="sql-createconversion">
|
2005-01-06 00:42:03 +01:00
|
|
|
for more information.
|
2002-07-24 07:51:56 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_conversion</> Columns</title>
|
2002-07-24 07:51:56 +02:00
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2002-07-24 07:51:56 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
2012-12-15 06:42:47 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-07-24 07:51:56 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>conname</structfield></entry>
|
2002-07-24 07:51:56 +02:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Conversion name (unique within a namespace)</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>connamespace</structfield></entry>
|
2002-07-24 07:51:56 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
|
2002-07-24 07:51:56 +02:00
|
|
|
<entry>
|
|
|
|
The OID of the namespace that contains this conversion
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>conowner</structfield></entry>
|
2005-06-28 07:09:14 +02:00
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Owner of the conversion</entry>
|
2002-07-24 07:51:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>conforencoding</structfield></entry>
|
2002-07-24 07:51:56 +02:00
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Source encoding ID</entry>
|
2002-07-24 07:51:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>contoencoding</structfield></entry>
|
2002-07-24 07:51:56 +02:00
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Destination encoding ID</entry>
|
2002-07-24 07:51:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>conproc</structfield></entry>
|
2002-07-24 07:51:56 +02:00
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2002-07-24 07:51:56 +02:00
|
|
|
<entry>Conversion procedure</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>condefault</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
2002-07-24 07:51:56 +02:00
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>True if this is the default conversion</entry>
|
2002-07-24 07:51:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-database">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_database</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-database">
|
|
|
|
<primary>pg_database</primary>
|
|
|
|
</indexterm>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<para>
|
2006-11-12 07:25:37 +01:00
|
|
|
The catalog <structname>pg_database</structname> stores information about
|
|
|
|
the available databases. Databases are created with the <xref
|
2010-04-03 09:23:02 +02:00
|
|
|
linkend="sql-createdatabase"> command.
|
2006-11-12 07:25:37 +01:00
|
|
|
Consult <xref linkend="managing-databases"> for details about the meaning
|
|
|
|
of some of the parameters.
|
2000-11-29 21:15:59 +01:00
|
|
|
</para>
|
|
|
|
|
2001-10-16 00:47:47 +02:00
|
|
|
<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>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_database</> Columns</title>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2000-11-29 21:15:59 +01:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
2012-12-15 06:42:47 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>datname</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Database name</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>datdba</structfield></entry>
|
2005-06-28 07:09:14 +02:00
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
|
2002-09-24 23:26:44 +02:00
|
|
|
<entry>Owner of the database, usually the user who created it</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>encoding</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
2006-06-03 04:53:04 +02:00
|
|
|
<entry>Character encoding for this database
|
|
|
|
(<function>pg_encoding_to_char()</function> can translate
|
|
|
|
this number to the encoding name)</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
2008-09-23 11:20:39 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>datcollate</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>LC_COLLATE for this database</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>datctype</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>LC_CTYPE for this database</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>datistemplate</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2014-04-23 00:10:14 +02:00
|
|
|
If true, then this database can be cloned by
|
|
|
|
any user with <literal>CREATEDB</> privileges;
|
|
|
|
if false, then only superusers or the owner of
|
|
|
|
the database can clone it.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>datallowconn</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
If false then no one can connect to this database. This is
|
2010-08-17 06:37:21 +02:00
|
|
|
used to protect the <literal>template0</> database from being altered.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2005-07-31 19:19:22 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>datconnlimit</structfield></entry>
|
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
Replace the hard-wired type knowledge in TypeCategory() and IsPreferredType()
with system catalog lookups, as was foreseen to be necessary almost since
their creation. Instead put the information into two new pg_type columns,
typcategory and typispreferred. Add support for setting these when
creating a user-defined base type.
The category column is just a "char" (i.e. a poor man's enum), allowing
a crude form of user extensibility of the category list: just use an
otherwise-unused character. This seems sufficient for foreseen uses,
but we could upgrade to having an actual category catalog someday, if
there proves to be a huge demand for custom type categories.
In this patch I have attempted to hew exactly to the behavior of the
previous hardwired logic, except for introducing new type categories for
arrays, composites, and enums. In particular the default preferred state
for user-defined types remains TRUE. That seems worth revisiting, but it
should be done as a separate patch from introducing the infrastructure.
Likewise, any adjustment of the standard set of categories should be done
separately.
2008-07-30 19:05:05 +02:00
|
|
|
Sets maximum number of concurrent connections that can be made
|
2010-08-17 06:37:21 +02:00
|
|
|
to this database. -1 means no limit.
|
2005-07-31 19:19:22 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>datlastsysoid</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2001-08-26 18:56:03 +02:00
|
|
|
Last system OID in the database; useful
|
2000-11-29 21:15:59 +01:00
|
|
|
particularly to <application>pg_dump</application>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2001-08-26 18:56:03 +02:00
|
|
|
<row>
|
Fix recently-understood problems with handling of XID freezing, particularly
in PITR scenarios. We now WAL-log the replacement of old XIDs with
FrozenTransactionId, so that such replacement is guaranteed to propagate to
PITR slave databases. Also, rather than relying on hint-bit updates to be
preserved, pg_clog is not truncated until all instances of an XID are known to
have been replaced by FrozenTransactionId. Add new GUC variables and
pg_autovacuum columns to allow management of the freezing policy, so that
users can trade off the size of pg_clog against the amount of freezing work
done. Revise the already-existing code that forces autovacuum of tables
approaching the wraparound point to make it more bulletproof; also, revise the
autovacuum logic so that anti-wraparound vacuuming is done per-table rather
than per-database. initdb forced because of changes in pg_class, pg_database,
and pg_autovacuum catalogs. Heikki Linnakangas, Simon Riggs, and Tom Lane.
2006-11-05 23:42:10 +01:00
|
|
|
<entry><structfield>datfrozenxid</structfield></entry>
|
2001-08-26 18:56:03 +02:00
|
|
|
<entry><type>xid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
Fix recently-understood problems with handling of XID freezing, particularly
in PITR scenarios. We now WAL-log the replacement of old XIDs with
FrozenTransactionId, so that such replacement is guaranteed to propagate to
PITR slave databases. Also, rather than relying on hint-bit updates to be
preserved, pg_clog is not truncated until all instances of an XID are known to
have been replaced by FrozenTransactionId. Add new GUC variables and
pg_autovacuum columns to allow management of the freezing policy, so that
users can trade off the size of pg_clog against the amount of freezing work
done. Revise the already-existing code that forces autovacuum of tables
approaching the wraparound point to make it more bulletproof; also, revise the
autovacuum logic so that anti-wraparound vacuuming is done per-table rather
than per-database. initdb forced because of changes in pg_class, pg_database,
and pg_autovacuum catalogs. Heikki Linnakangas, Simon Riggs, and Tom Lane.
2006-11-05 23:42:10 +01:00
|
|
|
All transaction IDs before this one have been replaced with a permanent
|
|
|
|
(<quote>frozen</>) transaction ID in this database. This is used to
|
|
|
|
track whether the database needs to be vacuumed in order to prevent
|
|
|
|
transaction ID wraparound or to allow <literal>pg_clog</> to be shrunk.
|
|
|
|
It is the minimum of the per-table
|
2010-08-17 06:37:21 +02:00
|
|
|
<structname>pg_class</>.<structfield>relfrozenxid</> values.
|
2001-08-26 18:56:03 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2013-06-27 21:20:33 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>datminmxid</structfield></entry>
|
|
|
|
<entry><type>xid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2015-06-04 06:22:49 +02:00
|
|
|
All multixact IDs before this one have been replaced with a
|
2013-06-27 21:20:33 +02:00
|
|
|
transaction ID in this database. This is used to
|
|
|
|
track whether the database needs to be vacuumed in order to prevent
|
2015-06-04 06:22:49 +02:00
|
|
|
multixact ID wraparound or to allow <literal>pg_multixact</> to be shrunk.
|
2013-06-27 21:20:33 +02:00
|
|
|
It is the minimum of the per-table
|
|
|
|
<structname>pg_class</>.<structfield>relminmxid</> values.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2004-06-18 08:14:31 +02:00
|
|
|
<entry><structfield>dattablespace</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-tablespace"><structname>pg_tablespace</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>
|
2004-06-18 08:14:31 +02:00
|
|
|
The default tablespace for the database.
|
|
|
|
Within this database, all tables for which
|
|
|
|
<structname>pg_class</>.<structfield>reltablespace</> is zero
|
|
|
|
will be stored in this tablespace; in particular, all the non-shared
|
2010-08-17 06:37:21 +02:00
|
|
|
system catalogs will be there.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
2002-03-01 23:45:19 +01:00
|
|
|
|
2002-04-21 02:26:44 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>datacl</structfield></entry>
|
2002-04-21 02:26:44 +02:00
|
|
|
<entry><type>aclitem[]</type></entry>
|
|
|
|
<entry></entry>
|
2005-01-06 00:42:03 +01:00
|
|
|
<entry>
|
|
|
|
Access privileges; see
|
2010-04-03 09:23:02 +02:00
|
|
|
<xref linkend="sql-grant"> and
|
|
|
|
<xref linkend="sql-revoke">
|
2006-01-16 19:15:31 +01:00
|
|
|
for details
|
2005-01-06 00:42:03 +01:00
|
|
|
</entry>
|
2002-04-21 02:26:44 +02:00
|
|
|
</row>
|
2000-11-29 21:15:59 +01:00
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
|
2010-09-17 20:49:54 +02:00
|
|
|
<sect1 id="catalog-pg-db-role-setting">
|
|
|
|
<title><structname>pg_db_role_setting</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-db-role-setting">
|
|
|
|
<primary>pg_db_role_setting</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The catalog <structname>pg_db_role_setting</structname> records the default
|
|
|
|
values that have been set for run-time configuration variables,
|
|
|
|
for each role and database combination.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Unlike most system catalogs, <structname>pg_db_role_setting</structname>
|
|
|
|
is shared across all databases of a cluster: there is only one
|
|
|
|
copy of <structname>pg_db_role_setting</structname> per cluster, not
|
|
|
|
one per database.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_db_role_setting</> 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>setdatabase</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-database"><structname>pg_database</structname></link>.oid</literal></entry>
|
|
|
|
<entry>The OID of the database the setting is applicable to, or zero if not database-specific</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>setrole</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
|
|
|
|
<entry>The OID of the role the setting is applicable to, or zero if not role-specific</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>setconfig</structfield></entry>
|
|
|
|
<entry><type>text[]</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Defaults for run-time configuration variables</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
2009-10-05 21:24:49 +02:00
|
|
|
<sect1 id="catalog-pg-default-acl">
|
|
|
|
<title><structname>pg_default_acl</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-default-acl">
|
|
|
|
<primary>pg_default_acl</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The catalog <structname>pg_default_acl</> stores initial
|
|
|
|
privileges to be assigned to newly created objects.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_default_acl</> Columns</title>
|
|
|
|
|
|
|
|
<tgroup cols="4">
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
2012-12-15 06:42:47 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
|
|
|
</row>
|
|
|
|
|
2009-10-05 21:24:49 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>defaclrole</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
|
|
|
|
<entry>The OID of the role associated with this entry</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>defaclnamespace</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 associated with this entry,
|
|
|
|
or 0 if none</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>defaclobjtype</structfield></entry>
|
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
Type of object this entry is for:
|
|
|
|
<literal>r</> = relation (table, view),
|
|
|
|
<literal>S</> = sequence,
|
2012-12-09 06:08:23 +01:00
|
|
|
<literal>f</> = function,
|
|
|
|
<literal>T</> = type
|
2009-10-05 21:24:49 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>defaclacl</structfield></entry>
|
|
|
|
<entry><type>aclitem[]</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
Access privileges that this type of object should have on creation
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
A <structname>pg_default_acl</> entry shows the initial privileges to
|
|
|
|
be assigned to an object belonging to the indicated user. There are
|
|
|
|
currently two types of entry: <quote>global</> entries with
|
|
|
|
<structfield>defaclnamespace</> = 0, and <quote>per-schema</> entries
|
|
|
|
that reference a particular schema. If a global entry is present then
|
|
|
|
it <emphasis>overrides</> the normal hard-wired default privileges
|
|
|
|
for the object type. A per-schema entry, if present, represents privileges
|
|
|
|
to be <emphasis>added to</> the global or hard-wired default privileges.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2010-08-17 06:37:21 +02:00
|
|
|
Note that when an ACL entry in another catalog is null, it is taken
|
2009-10-05 21:24:49 +02:00
|
|
|
to represent the hard-wired default privileges for its object,
|
|
|
|
<emphasis>not</> whatever might be in <structname>pg_default_acl</>
|
|
|
|
at the moment. <structname>pg_default_acl</> is only consulted during
|
|
|
|
object creation.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
2002-07-12 20:43:19 +02:00
|
|
|
<sect1 id="catalog-pg-depend">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_depend</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-depend">
|
|
|
|
<primary>pg_depend</primary>
|
|
|
|
</indexterm>
|
2002-07-12 20:43:19 +02:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_depend</structname> records the dependency
|
2002-07-12 20:43:19 +02:00
|
|
|
relationships between database objects. This information allows
|
|
|
|
<command>DROP</> commands to find which other objects must be dropped
|
2003-04-15 15:23:35 +02:00
|
|
|
by <command>DROP CASCADE</> or prevent dropping in the <command>DROP
|
2002-07-12 20:43:19 +02:00
|
|
|
RESTRICT</> case.
|
|
|
|
</para>
|
|
|
|
|
2005-07-07 22:40:02 +02:00
|
|
|
<para>
|
|
|
|
See also <link linkend="catalog-pg-shdepend"><structname>pg_shdepend</structname></link>,
|
|
|
|
which performs a similar function for dependencies involving objects
|
|
|
|
that are shared across a database cluster.
|
|
|
|
</para>
|
|
|
|
|
2002-07-12 20:43:19 +02:00
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_depend</> Columns</title>
|
2002-07-12 20:43:19 +02:00
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2002-07-12 20:43:19 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>classid</structfield></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>The OID of the system catalog the dependent object is in</entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>objid</structfield></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>any OID column</entry>
|
|
|
|
<entry>The OID of the specific dependent object</entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>objsubid</structfield></entry>
|
2002-09-24 23:26:44 +02:00
|
|
|
<entry><type>int4</type></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>
|
|
|
|
For a table column, this is the column number (the
|
|
|
|
<structfield>objid</> and <structfield>classid</> refer to the
|
|
|
|
table itself). For all other object types, this column is
|
2010-08-17 06:37:21 +02:00
|
|
|
zero.
|
2002-07-12 20:43:19 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>refclassid</structfield></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-09-13 00:17:24 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>The OID of the system catalog the referenced object is in</entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>refobjid</structfield></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-11-01 02:56:29 +01:00
|
|
|
<entry>any OID column</entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>The OID of the specific referenced object</entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>refobjsubid</structfield></entry>
|
2002-09-24 23:26:44 +02:00
|
|
|
<entry><type>int4</type></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>
|
|
|
|
For a table column, this is the column number (the
|
|
|
|
<structfield>refobjid</> and <structfield>refclassid</> refer
|
|
|
|
to the table itself). For all other object types, this column
|
2010-08-17 06:37:21 +02:00
|
|
|
is zero.
|
2002-07-12 20:43:19 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>deptype</structfield></entry>
|
2002-07-12 20:43:19 +02:00
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2006-01-16 19:15:31 +01:00
|
|
|
A code defining the specific semantics of this dependency relationship; see text
|
2002-07-12 20:43:19 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
In all cases, a <structname>pg_depend</structname> entry indicates that the
|
Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
Also update two error messages mentioned in the documenation to match.
2007-01-31 21:56:20 +01:00
|
|
|
referenced object cannot be dropped without also dropping the dependent
|
2002-07-12 20:43:19 +02:00
|
|
|
object. However, there are several subflavors identified by
|
|
|
|
<structfield>deptype</>:
|
|
|
|
|
2003-04-15 15:23:35 +02:00
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><symbol>DEPENDENCY_NORMAL</> (<literal>n</>)</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
A normal relationship between separately-created objects. The
|
Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
Also update two error messages mentioned in the documenation to match.
2007-01-31 21:56:20 +01:00
|
|
|
dependent object can be dropped without affecting the
|
|
|
|
referenced object. The referenced object can only be dropped
|
2003-04-15 15:23:35 +02:00
|
|
|
by specifying <literal>CASCADE</>, in which case the dependent
|
|
|
|
object is dropped, too. Example: a table column has a normal
|
|
|
|
dependency on its data type.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><symbol>DEPENDENCY_AUTO</> (<literal>a</>)</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The dependent object can be dropped separately from the
|
|
|
|
referenced object, and should be automatically dropped
|
|
|
|
(regardless of <literal>RESTRICT</> or <literal>CASCADE</>
|
|
|
|
mode) if the referenced object is dropped. Example: a named
|
|
|
|
constraint on a table is made autodependent on the table, so
|
|
|
|
that it will go away if the table is dropped.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><symbol>DEPENDENCY_INTERNAL</> (<literal>i</>)</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The dependent object was created as part of creation of the
|
|
|
|
referenced object, and is really just a part of its internal
|
|
|
|
implementation. A <command>DROP</> of the dependent object
|
|
|
|
will be disallowed outright (we'll tell the user to issue a
|
|
|
|
<command>DROP</> against the referenced object, instead). A
|
|
|
|
<command>DROP</> of the referenced object will be propagated
|
|
|
|
through to drop the dependent object whether
|
|
|
|
<command>CASCADE</> is specified or not. Example: a trigger
|
|
|
|
that's created to enforce a foreign-key constraint is made
|
|
|
|
internally dependent on the constraint's
|
|
|
|
<structname>pg_constraint</> entry.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2011-02-08 22:08:41 +01:00
|
|
|
<varlistentry>
|
|
|
|
<term><symbol>DEPENDENCY_EXTENSION</> (<literal>e</>)</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The dependent object is a member of the <firstterm>extension</> that is
|
|
|
|
the referenced object (see
|
|
|
|
<link linkend="catalog-pg-extension"><structname>pg_extension</structname></link>).
|
|
|
|
The dependent object can be dropped only via
|
|
|
|
<command>DROP EXTENSION</> on the referenced object. Functionally
|
|
|
|
this dependency type acts the same as an internal dependency, but
|
|
|
|
it's kept separate for clarity and to simplify <application>pg_dump</>.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2003-04-15 15:23:35 +02:00
|
|
|
<varlistentry>
|
|
|
|
<term><symbol>DEPENDENCY_PIN</> (<literal>p</>)</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
There is no dependent object; this type of entry is a signal
|
|
|
|
that the system itself depends on the referenced object, and so
|
|
|
|
that object must never be deleted. Entries of this type are
|
|
|
|
created only by <command>initdb</command>. The columns for the
|
|
|
|
dependent object contain zeroes.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
2002-07-12 20:43:19 +02:00
|
|
|
|
Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
Also update two error messages mentioned in the documenation to match.
2007-01-31 21:56:20 +01:00
|
|
|
Other dependency flavors might be needed in future.
|
2002-07-12 20:43:19 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-description">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_description</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-description">
|
|
|
|
<primary>pg_description</primary>
|
|
|
|
</indexterm>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<para>
|
2005-01-06 00:42:03 +01:00
|
|
|
The catalog <structname>pg_description</> stores optional descriptions
|
|
|
|
(comments) for each database object. Descriptions can be manipulated
|
2010-04-03 09:23:02 +02:00
|
|
|
with the <xref linkend="sql-comment"> command and viewed with
|
2000-11-29 21:15:59 +01:00
|
|
|
<application>psql</application>'s <literal>\d</literal> commands.
|
2002-09-24 23:26:44 +02:00
|
|
|
Descriptions of many built-in system objects are provided in the initial
|
2003-04-15 15:23:35 +02:00
|
|
|
contents of <structname>pg_description</structname>.
|
2000-11-29 21:15:59 +01:00
|
|
|
</para>
|
|
|
|
|
2006-02-12 04:22:21 +01:00
|
|
|
<para>
|
|
|
|
See also <link linkend="catalog-pg-shdescription"><structname>pg_shdescription</structname></link>,
|
|
|
|
which performs a similar function for descriptions involving objects that
|
|
|
|
are shared across a database cluster.
|
|
|
|
</para>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_description</> Columns</title>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2000-11-29 21:15:59 +01:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>objoid</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>any OID column</entry>
|
|
|
|
<entry>The OID of the object this description pertains to</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
2001-08-10 20:57:42 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>classoid</structfield></entry>
|
2001-08-10 20:57:42 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>The OID of the system catalog this object appears in</entry>
|
2001-08-10 20:57:42 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>objsubid</structfield></entry>
|
2001-08-10 20:57:42 +02:00
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>
|
|
|
|
For a comment on a table column, this is the column number (the
|
|
|
|
<structfield>objoid</> and <structfield>classoid</> refer to
|
|
|
|
the table itself). For all other object types, this column is
|
2010-08-17 06:37:21 +02:00
|
|
|
zero.
|
2001-08-10 20:57:42 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>description</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
2006-01-16 19:15:31 +01:00
|
|
|
<entry>Arbitrary text that serves as the description of this object</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
|
2007-04-02 05:49:42 +02:00
|
|
|
<sect1 id="catalog-pg-enum">
|
|
|
|
<title><structname>pg_enum</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-enum">
|
|
|
|
<primary>pg_enum</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The <structname>pg_enum</structname> catalog contains entries
|
2010-10-25 05:04:37 +02:00
|
|
|
showing the values and labels for each enum type. The
|
2007-04-02 05:49:42 +02:00
|
|
|
internal representation of a given enum value is actually the OID
|
2010-10-25 05:04:37 +02:00
|
|
|
of its associated row in <structname>pg_enum</structname>.
|
2007-04-02 05:49:42 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_enum</> Columns</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2007-04-02 05:49:42 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
2012-12-15 06:42:47 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
|
|
|
</row>
|
|
|
|
|
2007-04-02 05:49:42 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>enumtypid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
|
|
|
<entry>The OID of the <structname>pg_type</> entry owning this enum value</entry>
|
|
|
|
</row>
|
|
|
|
|
2010-10-25 05:04:37 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>enumsortorder</structfield></entry>
|
|
|
|
<entry><type>float4</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>The sort position of this enum value within its enum type</entry>
|
|
|
|
</row>
|
|
|
|
|
2007-04-02 05:49:42 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>enumlabel</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>The textual label for this enum value</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
2010-10-25 05:04:37 +02:00
|
|
|
|
|
|
|
<para>
|
|
|
|
The OIDs for <structname>pg_enum</structname> rows follow a special
|
|
|
|
rule: even-numbered OIDs are guaranteed to be ordered in the same way
|
|
|
|
as the sort ordering of their enum type. That is, if two even OIDs
|
|
|
|
belong to the same enum type, the smaller OID must have the smaller
|
|
|
|
<structfield>enumsortorder</structfield> value. Odd-numbered OID values
|
|
|
|
need bear no relationship to the sort order. This rule allows the
|
|
|
|
enum comparison routines to avoid catalog lookups in many common cases.
|
|
|
|
The routines that create and alter enum types attempt to assign even
|
|
|
|
OIDs to enum values whenever possible.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
When an enum type is created, its members are assigned sort-order
|
|
|
|
positions 1..<replaceable>n</>. But members added later might be given
|
|
|
|
negative or fractional values of <structfield>enumsortorder</structfield>.
|
|
|
|
The only requirement on these values is that they be correctly
|
|
|
|
ordered and unique within each enum type.
|
|
|
|
</para>
|
2007-04-02 05:49:42 +02:00
|
|
|
</sect1>
|
|
|
|
|
2007-10-01 23:10:40 +02:00
|
|
|
|
2013-12-30 19:27:51 +01:00
|
|
|
<sect1 id="catalog-pg-event-trigger">
|
|
|
|
<title><structname>pg_event_trigger</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-event-trigger">
|
|
|
|
<primary>pg_event_trigger</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The catalog <structname>pg_event_trigger</structname> stores event triggers.
|
|
|
|
See <xref linkend="event-triggers"> for more information.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_event_trigger</> 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>evtname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Trigger name (must be unique)</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>evtevent</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Identifies the event for which this trigger fires</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>evtowner</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 event trigger</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>evtfoid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
|
|
|
<entry>The function to be called</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>evtenabled</structfield></entry>
|
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
Controls in which <xref linkend="guc-session-replication-role"> modes
|
|
|
|
the event trigger fires.
|
|
|
|
<literal>O</> = trigger fires in <quote>origin</> and <quote>local</> modes,
|
|
|
|
<literal>D</> = trigger is disabled,
|
|
|
|
<literal>R</> = trigger fires in <quote>replica</> mode,
|
|
|
|
<literal>A</> = trigger fires always.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>evttags</structfield></entry>
|
|
|
|
<entry><type>text[]</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
Command tags for which this trigger will fire. If NULL, the firing
|
|
|
|
of this trigger is not restricted on the basis of the command tag.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
2011-02-08 22:08:41 +01:00
|
|
|
<sect1 id="catalog-pg-extension">
|
|
|
|
<title><structname>pg_extension</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-extension">
|
|
|
|
<primary>pg_extension</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The catalog <structname>pg_extension</structname> stores information
|
|
|
|
about the installed extensions. See <xref linkend="extend-extensions">
|
|
|
|
for details about extensions.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_extension</> Columns</title>
|
|
|
|
|
|
|
|
<tgroup cols="4">
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
2012-12-15 06:42:47 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
|
|
|
</row>
|
|
|
|
|
2011-02-08 22:08:41 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>extname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Name of the extension</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>extowner</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 extension</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>extnamespace</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
|
|
|
|
<entry>Schema containing the extension's exported objects</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>extrelocatable</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>True if extension can be relocated to another schema</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>extversion</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
2011-02-12 03:25:20 +01:00
|
|
|
<entry>Version name for the extension</entry>
|
2011-02-08 22:08:41 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>extconfig</structfield></entry>
|
|
|
|
<entry><type>oid[]</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
|
|
|
<entry>Array of <type>regclass</> OIDs for the extension's configuration
|
|
|
|
table(s), or <literal>NULL</> if none</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>extcondition</structfield></entry>
|
|
|
|
<entry><type>text[]</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Array of <literal>WHERE</>-clause filter conditions for the
|
|
|
|
extension's configuration table(s), or <literal>NULL</> if none</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Note that unlike most catalogs with a <quote>namespace</> column,
|
|
|
|
<structfield>extnamespace</structfield> is not meant to imply
|
|
|
|
that the extension belongs to that schema. Extension names are never
|
|
|
|
schema-qualified. Rather, <structfield>extnamespace</structfield>
|
|
|
|
indicates the schema that contains most or all of the extension's
|
|
|
|
objects. If <structfield>extrelocatable</structfield> is true, then
|
|
|
|
this schema must in fact contain all schema-qualifiable objects
|
|
|
|
belonging to the extension.
|
|
|
|
</para>
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
2008-12-19 17:25:19 +01:00
|
|
|
<sect1 id="catalog-pg-foreign-data-wrapper">
|
|
|
|
<title><structname>pg_foreign_data_wrapper</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-foreign-data-wrapper">
|
|
|
|
<primary>pg_foreign_data_wrapper</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The catalog <structname>pg_foreign_data_wrapper</structname> stores
|
|
|
|
foreign-data wrapper definitions. A foreign-data wrapper is the
|
|
|
|
mechanism by which external data, residing on foreign servers, is
|
|
|
|
accessed.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_foreign_data_wrapper</> Columns</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2008-12-19 17:25:19 +01:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
2012-12-15 06:42:47 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
|
|
|
</row>
|
|
|
|
|
2008-12-19 17:25:19 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>fdwname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Name of the foreign-data wrapper</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>fdwowner</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 foreign-data wrapper</entry>
|
|
|
|
</row>
|
|
|
|
|
2011-02-19 06:06:18 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>fdwhandler</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
|
|
|
<entry>
|
|
|
|
References a handler function that is responsible for
|
|
|
|
supplying execution routines for the foreign-data wrapper.
|
|
|
|
Zero if no handler is provided
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2008-12-19 17:25:19 +01:00
|
|
|
<row>
|
2009-02-24 11:06:36 +01:00
|
|
|
<entry><structfield>fdwvalidator</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
|
|
|
<entry>
|
|
|
|
References a validator function that is responsible for
|
2011-02-19 06:06:18 +01:00
|
|
|
checking the validity of the options given to the
|
|
|
|
foreign-data wrapper, as well as options for foreign servers and user
|
2009-02-24 11:06:36 +01:00
|
|
|
mappings using the foreign-data wrapper. Zero if no validator
|
2011-02-19 06:06:18 +01:00
|
|
|
is provided
|
2009-02-24 11:06:36 +01:00
|
|
|
</entry>
|
2008-12-19 17:25:19 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>fdwacl</structfield></entry>
|
|
|
|
<entry><type>aclitem[]</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
Access privileges; see
|
2010-04-03 09:23:02 +02:00
|
|
|
<xref linkend="sql-grant"> and
|
|
|
|
<xref linkend="sql-revoke">
|
2008-12-19 17:25:19 +01:00
|
|
|
for details
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>fdwoptions</structfield></entry>
|
|
|
|
<entry><type>text[]</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
Foreign-data wrapper specific options, as <quote>keyword=value</> strings
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
|
|
|
<sect1 id="catalog-pg-foreign-server">
|
|
|
|
<title><structname>pg_foreign_server</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-foreign-server">
|
|
|
|
<primary>pg_foreign_server</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The catalog <structname>pg_foreign_server</structname> stores
|
2011-02-19 06:06:18 +01:00
|
|
|
foreign server definitions. A foreign server describes a source
|
|
|
|
of external data, such as a remote server. Foreign
|
2008-12-19 17:25:19 +01:00
|
|
|
servers are accessed via foreign-data wrappers.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_foreign_server</> Columns</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2008-12-19 17:25:19 +01:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
2012-12-15 06:42:47 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
|
|
|
</row>
|
|
|
|
|
2008-12-19 17:25:19 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>srvname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Name of the foreign server</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>srvowner</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 foreign server</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>srvfdw</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-foreign-data-wrapper"><structname>pg_foreign_data_wrapper</structname></link>.oid</literal></entry>
|
2011-02-19 06:06:18 +01:00
|
|
|
<entry>OID of the foreign-data wrapper of this foreign server</entry>
|
2008-12-19 17:25:19 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>srvtype</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Type of the server (optional)</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>srvversion</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Version of the server (optional)</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>srvacl</structfield></entry>
|
|
|
|
<entry><type>aclitem[]</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
Access privileges; see
|
2010-04-03 09:23:02 +02:00
|
|
|
<xref linkend="sql-grant"> and
|
|
|
|
<xref linkend="sql-revoke">
|
2008-12-19 17:25:19 +01:00
|
|
|
for details
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>srvoptions</structfield></entry>
|
|
|
|
<entry><type>text[]</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2010-08-17 06:37:21 +02:00
|
|
|
Foreign server specific options, as <quote>keyword=value</> strings
|
2008-12-19 17:25:19 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
2011-01-02 05:48:11 +01:00
|
|
|
<sect1 id="catalog-pg-foreign-table">
|
|
|
|
<title><structname>pg_foreign_table</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-foreign-table">
|
|
|
|
<primary>pg_foreign_table</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
2011-02-19 06:06:18 +01:00
|
|
|
The catalog <structname>pg_foreign_table</structname> contains
|
|
|
|
auxiliary information about foreign tables. A foreign table is
|
|
|
|
primarily represented by a <structname>pg_class</structname> entry,
|
|
|
|
just like a regular table. Its <structname>pg_foreign_table</structname>
|
|
|
|
entry contains the information that is pertinent only to foreign tables
|
|
|
|
and not any other kind of relation.
|
2011-01-02 05:48:11 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_foreign_table</> 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>ftrelid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2011-02-19 06:06:18 +01:00
|
|
|
<entry>OID of the <structname>pg_class</> entry for this foreign table</entry>
|
2011-01-02 05:48:11 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>ftserver</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-foreign-server"><structname>pg_foreign_server</structname></link>.oid</literal></entry>
|
2011-02-19 06:06:18 +01:00
|
|
|
<entry>OID of the foreign server for this foreign table</entry>
|
2011-01-02 05:48:11 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>ftoptions</structfield></entry>
|
|
|
|
<entry><type>text[]</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2011-02-19 06:06:18 +01:00
|
|
|
Foreign table options, as <quote>keyword=value</> strings
|
2011-01-02 05:48:11 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-index">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_index</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-index">
|
|
|
|
<primary>pg_index</primary>
|
|
|
|
</indexterm>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_index</structname> contains part of the information
|
2000-11-29 21:15:59 +01:00
|
|
|
about indexes. The rest is mostly in
|
|
|
|
<structname>pg_class</structname>.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_index</> Columns</title>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2000-11-29 21:15:59 +01:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>indexrelid</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>The OID of the <structname>pg_class</> entry for this index</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>indrelid</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>The OID of the <structname>pg_class</> entry for the table this index is for</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-05-28 18:04:02 +02:00
|
|
|
<entry><structfield>indnatts</structfield></entry>
|
|
|
|
<entry><type>int2</type></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry></entry>
|
2003-05-28 18:04:02 +02:00
|
|
|
<entry>The number of columns in the index (duplicates
|
|
|
|
<literal>pg_class.relnatts</literal>)</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>indisunique</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2006-01-16 19:15:31 +01:00
|
|
|
<entry>If true, this is a unique index</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>indisprimary</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2007-01-09 03:14:16 +01:00
|
|
|
<entry>If true, this index represents the primary key of the table
|
|
|
|
(<structfield>indisunique</> should always be true when this is true)</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
2011-01-25 23:51:59 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>indisexclusion</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>If true, this index supports an exclusion constraint</entry>
|
|
|
|
</row>
|
|
|
|
|
2009-07-29 22:56:21 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>indimmediate</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2011-01-25 23:51:59 +01:00
|
|
|
<entry>If true, the uniqueness check is enforced immediately on
|
|
|
|
insertion
|
|
|
|
(irrelevant if <structfield>indisunique</> is not true)</entry>
|
2009-07-29 22:56:21 +02:00
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-05-28 18:04:02 +02:00
|
|
|
<entry><structfield>indisclustered</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry></entry>
|
2006-01-16 19:15:31 +01:00
|
|
|
<entry>If true, the table was last clustered on this index</entry>
|
2003-05-28 18:04:02 +02:00
|
|
|
</row>
|
|
|
|
|
2006-08-25 06:06:58 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>indisvalid</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>
|
|
|
|
If true, the index is currently valid for queries. False means the
|
|
|
|
index is possibly incomplete: it must still be modified by
|
|
|
|
<command>INSERT</>/<command>UPDATE</> operations, but it cannot safely
|
|
|
|
be used for queries. If it is unique, the uniqueness property is not
|
Fix assorted bugs in CREATE/DROP INDEX CONCURRENTLY.
Commit 8cb53654dbdb4c386369eb988062d0bbb6de725e, which introduced DROP
INDEX CONCURRENTLY, managed to break CREATE INDEX CONCURRENTLY via a poor
choice of catalog state representation. The pg_index state for an index
that's reached the final pre-drop stage was the same as the state for an
index just created by CREATE INDEX CONCURRENTLY. This meant that the
(necessary) change to make RelationGetIndexList ignore about-to-die indexes
also made it ignore freshly-created indexes; which is catastrophic because
the latter do need to be considered in HOT-safety decisions. Failure to
do so leads to incorrect index entries and subsequently wrong results from
queries depending on the concurrently-created index.
To fix, add an additional boolean column "indislive" to pg_index, so that
the freshly-created and about-to-die states can be distinguished. (This
change obviously is only possible in HEAD. This patch will need to be
back-patched, but in 9.2 we'll use a kluge consisting of overloading the
formerly-impossible state of indisvalid = true and indisready = false.)
In addition, change CREATE/DROP INDEX CONCURRENTLY so that the pg_index
flag changes they make without exclusive lock on the index are made via
heap_inplace_update() rather than a normal transactional update. The
latter is not very safe because moving the pg_index tuple could result in
concurrent SnapshotNow scans finding it twice or not at all, thus possibly
resulting in index corruption. This is a pre-existing bug in CREATE INDEX
CONCURRENTLY, which was copied into the DROP code.
In addition, fix various places in the code that ought to check to make
sure that the indexes they are manipulating are valid and/or ready as
appropriate. These represent bugs that have existed since 8.2, since
a failed CREATE INDEX CONCURRENTLY could leave a corrupt or invalid
index behind, and we ought not try to do anything that might fail with
such an index.
Also fix RelationReloadIndexInfo to ensure it copies all the pg_index
columns that are allowed to change after initial creation. Previously we
could have been left with stale values of some fields in an index relcache
entry. It's not clear whether this actually had any user-visible
consequences, but it's at least a bug waiting to happen.
In addition, do some code and docs review for DROP INDEX CONCURRENTLY;
some cosmetic code cleanup but mostly addition and revision of comments.
This will need to be back-patched, but in a noticeably different form,
so I'm committing it to HEAD before working on the back-patch.
Problem reported by Amit Kapila, diagnosis by Pavan Deolassee,
fix by Tom Lane and Andres Freund.
2012-11-29 03:25:27 +01:00
|
|
|
guaranteed true either.
|
2006-11-12 07:25:37 +01:00
|
|
|
</entry>
|
2006-08-25 06:06:58 +02:00
|
|
|
</row>
|
|
|
|
|
2007-09-20 19:56:33 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>indcheckxmin</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
If true, queries must not use the index until the <structfield>xmin</>
|
2010-08-17 06:37:21 +02:00
|
|
|
of this <structname>pg_index</> row is below their <symbol>TransactionXmin</symbol>
|
2007-09-20 19:56:33 +02:00
|
|
|
event horizon, because the table may contain broken HOT chains with
|
|
|
|
incompatible rows that they can see
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>indisready</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
If true, the index is currently ready for inserts. False means the
|
|
|
|
index must be ignored by <command>INSERT</>/<command>UPDATE</>
|
2010-08-17 06:37:21 +02:00
|
|
|
operations.
|
2007-09-20 19:56:33 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
Fix assorted bugs in CREATE/DROP INDEX CONCURRENTLY.
Commit 8cb53654dbdb4c386369eb988062d0bbb6de725e, which introduced DROP
INDEX CONCURRENTLY, managed to break CREATE INDEX CONCURRENTLY via a poor
choice of catalog state representation. The pg_index state for an index
that's reached the final pre-drop stage was the same as the state for an
index just created by CREATE INDEX CONCURRENTLY. This meant that the
(necessary) change to make RelationGetIndexList ignore about-to-die indexes
also made it ignore freshly-created indexes; which is catastrophic because
the latter do need to be considered in HOT-safety decisions. Failure to
do so leads to incorrect index entries and subsequently wrong results from
queries depending on the concurrently-created index.
To fix, add an additional boolean column "indislive" to pg_index, so that
the freshly-created and about-to-die states can be distinguished. (This
change obviously is only possible in HEAD. This patch will need to be
back-patched, but in 9.2 we'll use a kluge consisting of overloading the
formerly-impossible state of indisvalid = true and indisready = false.)
In addition, change CREATE/DROP INDEX CONCURRENTLY so that the pg_index
flag changes they make without exclusive lock on the index are made via
heap_inplace_update() rather than a normal transactional update. The
latter is not very safe because moving the pg_index tuple could result in
concurrent SnapshotNow scans finding it twice or not at all, thus possibly
resulting in index corruption. This is a pre-existing bug in CREATE INDEX
CONCURRENTLY, which was copied into the DROP code.
In addition, fix various places in the code that ought to check to make
sure that the indexes they are manipulating are valid and/or ready as
appropriate. These represent bugs that have existed since 8.2, since
a failed CREATE INDEX CONCURRENTLY could leave a corrupt or invalid
index behind, and we ought not try to do anything that might fail with
such an index.
Also fix RelationReloadIndexInfo to ensure it copies all the pg_index
columns that are allowed to change after initial creation. Previously we
could have been left with stale values of some fields in an index relcache
entry. It's not clear whether this actually had any user-visible
consequences, but it's at least a bug waiting to happen.
In addition, do some code and docs review for DROP INDEX CONCURRENTLY;
some cosmetic code cleanup but mostly addition and revision of comments.
This will need to be back-patched, but in a noticeably different form,
so I'm committing it to HEAD before working on the back-patch.
Problem reported by Amit Kapila, diagnosis by Pavan Deolassee,
fix by Tom Lane and Andres Freund.
2012-11-29 03:25:27 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>indislive</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
If false, the index is in process of being dropped, and should be
|
|
|
|
ignored for all purposes (including HOT-safety decisions)
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2013-11-08 18:30:43 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>indisreplident</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
If true this index has been chosen as <quote>replica identity</>
|
|
|
|
using <command>ALTER TABLE ... REPLICA IDENTITY USING INDEX
|
|
|
|
...</>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2005-03-29 02:17:27 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>indkey</structfield></entry>
|
|
|
|
<entry><type>int2vector</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attnum</literal></entry>
|
|
|
|
<entry>
|
|
|
|
This is an array of <structfield>indnatts</structfield> values that
|
|
|
|
indicate which table columns this index indexes. For example a value
|
|
|
|
of <literal>1 3</literal> would mean that the first and the third table
|
|
|
|
columns make up the index key. A zero in this array indicates that the
|
|
|
|
corresponding index attribute is an expression over the table columns,
|
2010-08-17 06:37:21 +02:00
|
|
|
rather than a simple column reference.
|
2005-03-29 02:17:27 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2011-02-08 22:04:18 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>indcollation</structfield></entry>
|
|
|
|
<entry><type>oidvector</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-collation"><structname>pg_collation</structname></link>.oid</literal></entry>
|
|
|
|
<entry>
|
|
|
|
For each column in the index key, this contains the OID of the
|
|
|
|
collation to use for the index.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2005-03-29 02:17:27 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>indclass</structfield></entry>
|
|
|
|
<entry><type>oidvector</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link>.oid</literal></entry>
|
|
|
|
<entry>
|
2007-01-09 03:14:16 +01:00
|
|
|
For each column in the index key, this contains the OID of
|
2005-03-29 02:17:27 +02:00
|
|
|
the operator class to use. See
|
2010-08-17 06:37:21 +02:00
|
|
|
<link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link> for details.
|
2005-03-29 02:17:27 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2007-01-09 03:14:16 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>indoption</structfield></entry>
|
|
|
|
<entry><type>int2vector</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
This is an array of <structfield>indnatts</structfield> values that
|
|
|
|
store per-column flag bits. The meaning of the bits is defined by
|
2010-08-17 06:37:21 +02:00
|
|
|
the index's access method.
|
2007-01-09 03:14:16 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2003-05-28 18:04:02 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>indexprs</structfield></entry>
|
2010-09-03 03:34:55 +02:00
|
|
|
<entry><type>pg_node_tree</type></entry>
|
2003-05-28 18:04:02 +02:00
|
|
|
<entry></entry>
|
2010-08-17 06:37:21 +02:00
|
|
|
<entry>
|
|
|
|
Expression trees (in <function>nodeToString()</function>
|
|
|
|
representation) for index attributes that are not simple column
|
|
|
|
references. This is a list with one element for each zero
|
|
|
|
entry in <structfield>indkey</>. Null if all index attributes
|
|
|
|
are simple references.
|
|
|
|
</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>indpred</structfield></entry>
|
2010-09-03 03:34:55 +02:00
|
|
|
<entry><type>pg_node_tree</type></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry></entry>
|
2010-08-17 06:37:21 +02:00
|
|
|
<entry>
|
|
|
|
Expression tree (in <function>nodeToString()</function>
|
|
|
|
representation) for partial index predicate. Null if not a
|
|
|
|
partial index.
|
|
|
|
</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-inherits">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_inherits</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-inherits">
|
|
|
|
<primary>pg_inherits</primary>
|
|
|
|
</indexterm>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_inherits</> records information about
|
2005-01-06 00:42:03 +01:00
|
|
|
table inheritance hierarchies. There is one entry for each direct
|
|
|
|
child table in the database. (Indirect inheritance can be determined
|
|
|
|
by following chains of entries.)
|
2000-11-29 21:15:59 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_inherits</> Columns</title>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2000-11-29 21:15:59 +01:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>inhrelid</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>
|
2006-01-16 19:15:31 +01:00
|
|
|
The OID of the child table
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>inhparent</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>
|
2006-01-16 19:15:31 +01:00
|
|
|
The OID of the parent table
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>inhseqno</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2005-01-06 00:42:03 +01:00
|
|
|
If there is more than one direct parent for a child table (multiple
|
2000-11-29 21:15:59 +01:00
|
|
|
inheritance), this number tells the order in which the
|
2010-08-17 06:37:21 +02:00
|
|
|
inherited columns are to be arranged. The count starts at 1.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-language">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_language</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-language">
|
|
|
|
<primary>pg_language</primary>
|
|
|
|
</indexterm>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<para>
|
2005-01-06 00:42:03 +01:00
|
|
|
The catalog <structname>pg_language</structname> registers
|
2000-11-29 21:15:59 +01:00
|
|
|
languages in which you can write functions or stored procedures.
|
2010-04-03 09:23:02 +02:00
|
|
|
See <xref linkend="sql-createlanguage">
|
2005-01-06 00:42:03 +01:00
|
|
|
and <xref linkend="xplang"> for more information about language handlers.
|
2000-11-29 21:15:59 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_language</> Columns</title>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2000-11-29 21:15:59 +01:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
2012-12-15 06:42:47 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>lanname</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
2005-01-06 00:42:03 +01:00
|
|
|
<entry>Name of the language</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
2007-03-26 18:58:41 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>lanowner</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 language</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>lanispl</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2002-12-17 18:41:30 +01:00
|
|
|
This is false for internal languages (such as
|
|
|
|
<acronym>SQL</acronym>) and true for user-defined languages.
|
|
|
|
Currently, <application>pg_dump</application> still uses this
|
Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
Also update two error messages mentioned in the documenation to match.
2007-01-31 21:56:20 +01:00
|
|
|
to determine which languages need to be dumped, but this might be
|
2010-08-17 06:37:21 +02:00
|
|
|
replaced by a different mechanism in the future.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>lanpltrusted</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2005-05-06 16:28:53 +02:00
|
|
|
True if this is a trusted language, which means that it is believed
|
|
|
|
not to grant access to anything outside the normal SQL execution
|
Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
Also update two error messages mentioned in the documenation to match.
2007-01-31 21:56:20 +01:00
|
|
|
environment. Only superusers can create functions in untrusted
|
2010-08-17 06:37:21 +02:00
|
|
|
languages.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>lanplcallfoid</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
For noninternal languages this references the language
|
2000-11-29 21:15:59 +01:00
|
|
|
handler, which is a special function that is responsible for
|
|
|
|
executing all functions that are written in the particular
|
2006-11-12 07:25:37 +01:00
|
|
|
language
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2009-09-23 01:43:43 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>laninline</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
|
|
|
<entry>
|
|
|
|
This references a function that is responsible for executing
|
|
|
|
<quote>inline</> anonymous code blocks
|
2010-04-03 09:23:02 +02:00
|
|
|
(<xref linkend="sql-do"> blocks).
|
2010-08-17 06:37:21 +02:00
|
|
|
Zero if inline blocks are not supported.
|
2009-09-23 01:43:43 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-06-20 17:44:06 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>lanvalidator</structfield></entry>
|
2002-06-20 17:44:06 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2002-06-20 17:44:06 +02:00
|
|
|
<entry>
|
|
|
|
This references a language validator function that is responsible
|
|
|
|
for checking the syntax and validity of new functions when they
|
2010-08-17 06:37:21 +02:00
|
|
|
are created. Zero if no validator is provided.
|
2002-06-20 17:44:06 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-02-19 00:11:58 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>lanacl</structfield></entry>
|
2002-02-19 00:11:58 +01:00
|
|
|
<entry><type>aclitem[]</type></entry>
|
|
|
|
<entry></entry>
|
2005-01-06 00:42:03 +01:00
|
|
|
<entry>
|
|
|
|
Access privileges; see
|
2010-04-03 09:23:02 +02:00
|
|
|
<xref linkend="sql-grant"> and
|
|
|
|
<xref linkend="sql-revoke">
|
2006-01-16 19:15:31 +01:00
|
|
|
for details
|
2005-01-06 00:42:03 +01:00
|
|
|
</entry>
|
2002-02-19 00:11:58 +01:00
|
|
|
</row>
|
2000-11-29 21:15:59 +01:00
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-largeobject">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_largeobject</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-largeobject">
|
|
|
|
<primary>pg_largeobject</primary>
|
|
|
|
</indexterm>
|
2001-10-16 00:47:47 +02:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_largeobject</structname> holds the data making up
|
2009-12-17 15:36:16 +01:00
|
|
|
<quote>large objects</quote>. A large object is identified by an OID
|
|
|
|
assigned when it is created. Each large object is broken into
|
2001-10-16 00:47:47 +02:00
|
|
|
segments or <quote>pages</> small enough to be conveniently stored as rows
|
|
|
|
in <structname>pg_largeobject</structname>.
|
2006-11-12 07:25:37 +01:00
|
|
|
The amount of data per page is defined to be <symbol>LOBLKSIZE</> (which is currently
|
2003-04-15 15:23:35 +02:00
|
|
|
<literal>BLCKSZ/4</>, or typically 2 kB).
|
2001-10-16 00:47:47 +02:00
|
|
|
</para>
|
|
|
|
|
2009-12-11 04:34:57 +01:00
|
|
|
<para>
|
2010-02-17 05:19:41 +01:00
|
|
|
Prior to <productname>PostgreSQL</> 9.0, there was no permission structure
|
2009-12-17 15:36:16 +01:00
|
|
|
associated with large objects. As a result,
|
|
|
|
<structname>pg_largeobject</structname> was publicly readable and could be
|
|
|
|
used to obtain the OIDs (and contents) of all large objects in the system.
|
|
|
|
This is no longer the case; use
|
2010-08-17 06:37:21 +02:00
|
|
|
<link linkend="catalog-pg-largeobject-metadata"><structname>pg_largeobject_metadata</></link>
|
2009-12-17 15:36:16 +01:00
|
|
|
to obtain a list of large object OIDs.
|
2009-12-11 04:34:57 +01:00
|
|
|
</para>
|
|
|
|
|
2001-10-16 00:47:47 +02:00
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_largeobject</> Columns</title>
|
2001-10-16 00:47:47 +02:00
|
|
|
|
2009-12-11 04:34:57 +01:00
|
|
|
<tgroup cols="4">
|
2001-10-16 00:47:47 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
2009-12-11 04:34:57 +01:00
|
|
|
<entry>References</entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>loid</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2009-12-11 04:34:57 +01:00
|
|
|
<entry><literal><link linkend="catalog-pg-largeobject-metadata"><structname>pg_largeobject_metadata</structname></link>.oid</literal></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry>Identifier of the large object that includes this page</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>pageno</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>int4</type></entry>
|
2009-12-11 04:34:57 +01:00
|
|
|
<entry></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry>Page number of this page within its large object
|
|
|
|
(counting from zero)</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>data</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>bytea</type></entry>
|
2009-12-11 04:34:57 +01:00
|
|
|
<entry></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry>
|
|
|
|
Actual data stored in the large object.
|
2010-08-17 06:37:21 +02:00
|
|
|
This will never be more than <symbol>LOBLKSIZE</> bytes and might be less.
|
2001-10-16 00:47:47 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Each row of <structname>pg_largeobject</structname> holds data
|
|
|
|
for one page of a large object, beginning at
|
2003-04-15 15:23:35 +02:00
|
|
|
byte offset (<literal>pageno * LOBLKSIZE</>) within the object. The implementation
|
Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
Also update two error messages mentioned in the documenation to match.
2007-01-31 21:56:20 +01:00
|
|
|
allows sparse storage: pages might be missing, and might be shorter than
|
2003-04-15 15:23:35 +02:00
|
|
|
<literal>LOBLKSIZE</> bytes even if they are not the last page of the object.
|
2001-10-16 00:47:47 +02:00
|
|
|
Missing regions within a large object read as zeroes.
|
|
|
|
</para>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2001-10-16 00:47:47 +02:00
|
|
|
|
2009-12-11 04:34:57 +01:00
|
|
|
<sect1 id="catalog-pg-largeobject-metadata">
|
|
|
|
<title><structname>pg_largeobject_metadata</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-largeobject-metadata">
|
|
|
|
<primary>pg_largeobject_metadata</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
2009-12-17 15:36:16 +01:00
|
|
|
The catalog <structname>pg_largeobject_metadata</structname>
|
|
|
|
holds metadata associated with large objects. The actual large object
|
|
|
|
data is stored in
|
2010-08-17 06:37:21 +02:00
|
|
|
<link linkend="catalog-pg-largeobject"><structname>pg_largeobject</></link>.
|
2009-12-11 04:34:57 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_largeobject_metadata</> Columns</title>
|
|
|
|
|
|
|
|
<tgroup cols="4">
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
2012-12-15 06:42:47 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
|
|
|
</row>
|
|
|
|
|
2009-12-11 04:34:57 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>lomowner</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
|
2010-08-17 06:37:21 +02:00
|
|
|
<entry>Owner of the large object</entry>
|
2009-12-11 04:34:57 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>lomacl</structfield></entry>
|
|
|
|
<entry><type>aclitem[]</type></entry>
|
2009-12-17 15:36:16 +01:00
|
|
|
<entry></entry>
|
2009-12-11 04:34:57 +01:00
|
|
|
<entry>
|
|
|
|
Access privileges; see
|
2010-04-03 09:23:02 +02:00
|
|
|
<xref linkend="sql-grant"> and
|
|
|
|
<xref linkend="sql-revoke">
|
2009-12-11 04:34:57 +01:00
|
|
|
for details
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
</sect1>
|
2001-10-16 00:47:47 +02:00
|
|
|
|
2002-03-22 22:34:44 +01:00
|
|
|
<sect1 id="catalog-pg-namespace">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_namespace</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-namespace">
|
|
|
|
<primary>pg_namespace</primary>
|
|
|
|
</indexterm>
|
2002-03-22 22:34:44 +01:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_namespace</> stores namespaces.
|
|
|
|
A namespace is the structure underlying SQL schemas: each namespace
|
|
|
|
can have a separate collection of relations, types, etc. without name
|
2002-03-22 22:34:44 +01:00
|
|
|
conflicts.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_namespace</> Columns</title>
|
2002-03-22 22:34:44 +01:00
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2002-03-22 22:34:44 +01:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
2012-12-15 06:42:47 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-03-22 22:34:44 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>nspname</structfield></entry>
|
2002-03-22 22:34:44 +01:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Name of the namespace</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>nspowner</structfield></entry>
|
2005-06-28 07:09:14 +02:00
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Owner of the namespace</entry>
|
2002-03-22 22:34:44 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>nspacl</structfield></entry>
|
2002-03-22 22:34:44 +01:00
|
|
|
<entry><type>aclitem[]</type></entry>
|
|
|
|
<entry></entry>
|
2005-01-06 00:42:03 +01:00
|
|
|
<entry>
|
|
|
|
Access privileges; see
|
2010-04-03 09:23:02 +02:00
|
|
|
<xref linkend="sql-grant"> and
|
|
|
|
<xref linkend="sql-revoke">
|
2006-01-16 19:15:31 +01:00
|
|
|
for details
|
2005-01-06 00:42:03 +01:00
|
|
|
</entry>
|
2002-03-22 22:34:44 +01:00
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
2002-07-30 07:24:56 +02:00
|
|
|
<sect1 id="catalog-pg-opclass">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_opclass</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-opclass">
|
|
|
|
<primary>pg_opclass</primary>
|
|
|
|
</indexterm>
|
2002-07-30 07:24:56 +02:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_opclass</structname> defines
|
2002-07-30 07:24:56 +02:00
|
|
|
index access method operator classes. Each operator class defines
|
2003-04-15 15:23:35 +02:00
|
|
|
semantics for index columns of a particular data type and a particular
|
2006-12-23 01:43:13 +01:00
|
|
|
index access method. An operator class essentially specifies that a
|
|
|
|
particular operator family is applicable to a particular indexable column
|
|
|
|
data type. The set of operators from the family that are actually usable
|
|
|
|
with the indexed column are whichever ones accept the column's data type
|
2012-06-07 23:06:20 +02:00
|
|
|
as their left-hand input.
|
2002-07-30 07:24:56 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
Operator classes are described at length in <xref linkend="xindex">.
|
2002-07-30 07:24:56 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_opclass</> Columns</title>
|
2002-07-30 07:24:56 +02:00
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2002-07-30 07:24:56 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
|
2012-12-15 06:42:47 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-07-30 07:24:56 +02:00
|
|
|
<row>
|
2006-12-23 01:43:13 +01:00
|
|
|
<entry><structfield>opcmethod</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-am"><structname>pg_am</structname></link>.oid</literal></entry>
|
2003-11-01 02:56:29 +01:00
|
|
|
<entry>Index access method operator class is for</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>opcname</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Name of this operator class</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>opcnamespace</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Namespace of this operator class</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>opcowner</structfield></entry>
|
2005-06-28 07:09:14 +02:00
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
|
|
|
|
<entry>Owner of the operator class</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
2006-12-23 01:43:13 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>opcfamily</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-opfamily"><structname>pg_opfamily</structname></link>.oid</literal></entry>
|
|
|
|
<entry>Operator family containing the operator class</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-07-30 07:24:56 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>opcintype</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2003-11-12 22:15:59 +01:00
|
|
|
<entry>Data type that the operator class indexes</entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>opcdefault</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>True if this operator class is the default for <structfield>opcintype</></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>opckeytype</structfield></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2003-11-12 22:15:59 +01:00
|
|
|
<entry>Type of data stored in index, or zero if same as <structfield>opcintype</></entry>
|
2002-07-30 07:24:56 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<para>
|
2006-12-23 01:43:13 +01:00
|
|
|
An operator class's <structfield>opcmethod</> must match the
|
|
|
|
<structname>opfmethod</> of its containing operator family.
|
|
|
|
Also, there must be no more than one <structname>pg_opclass</structname>
|
|
|
|
row having <structname>opcdefault</> true for any given combination of
|
|
|
|
<structname>opcmethod</> and <structname>opcintype</>.
|
2002-07-30 07:24:56 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-operator">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_operator</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-operator">
|
|
|
|
<primary>pg_operator</primary>
|
|
|
|
</indexterm>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<para>
|
2005-01-06 00:42:03 +01:00
|
|
|
The catalog <structname>pg_operator</> stores information about operators.
|
2010-04-03 09:23:02 +02:00
|
|
|
See <xref linkend="sql-createoperator">
|
2005-01-06 00:42:03 +01:00
|
|
|
and <xref linkend="xoper"> for more information.
|
2000-11-29 21:15:59 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_operator</> Columns</title>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2000-11-29 21:15:59 +01:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
2012-12-15 06:42:47 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>oprname</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Name of the operator</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-04-17 01:08:12 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>oprnamespace</structfield></entry>
|
2002-04-17 01:08:12 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
|
2002-04-17 01:08:12 +02:00
|
|
|
<entry>
|
|
|
|
The OID of the namespace that contains this operator
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>oprowner</structfield></entry>
|
2005-06-28 07:09:14 +02:00
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Owner of the operator</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>oprkind</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<literal>b</> = infix (<quote>both</quote>), <literal>l</> = prefix
|
|
|
|
(<quote>left</quote>), <literal>r</> = postfix (<quote>right</quote>)
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2006-12-23 01:43:13 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oprcanmerge</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>This operator supports merge joins</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>oprcanhash</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2003-06-23 00:04:55 +02:00
|
|
|
<entry>This operator supports hash joins</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>oprleft</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>Type of the left operand</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>oprright</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>Type of the right operand</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>oprresult</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>Type of the result</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>oprcom</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>Commutator of this operator, if any</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>oprnegate</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry>
|
2000-12-11 19:26:37 +01:00
|
|
|
<entry>Negator of this operator, if any</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>oprcode</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>Function that implements this operator</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>oprrest</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>Restriction selectivity estimation function for this operator</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>oprjoin</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>Join selectivity estimation function for this operator</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
2002-09-24 23:26:44 +02:00
|
|
|
<para>
|
2006-01-16 19:15:31 +01:00
|
|
|
Unused column contain zeroes. For example, <structfield>oprleft</structfield>
|
|
|
|
is zero for a prefix operator.
|
2002-09-24 23:26:44 +02:00
|
|
|
</para>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
|
2006-12-23 01:43:13 +01:00
|
|
|
<sect1 id="catalog-pg-opfamily">
|
|
|
|
<title><structname>pg_opfamily</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-opfamily">
|
|
|
|
<primary>pg_opfamily</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The catalog <structname>pg_opfamily</structname> defines operator families.
|
|
|
|
Each operator family is a collection of operators and associated
|
|
|
|
support routines that implement the semantics specified for a particular
|
|
|
|
index access method. Furthermore, the operators in a family are all
|
2007-10-01 23:10:40 +02:00
|
|
|
<quote>compatible</>, in a way that is specified by the access method.
|
2006-12-23 01:43:13 +01:00
|
|
|
The operator family concept allows cross-data-type operators to be used
|
|
|
|
with indexes and to be reasoned about using knowledge of access method
|
|
|
|
semantics.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Operator families are described at length in <xref linkend="xindex">.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_opfamily</> Columns</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2006-12-23 01:43:13 +01:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
|
2012-12-15 06:42:47 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
|
|
|
</row>
|
|
|
|
|
2006-12-23 01:43:13 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>opfmethod</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-am"><structname>pg_am</structname></link>.oid</literal></entry>
|
|
|
|
<entry>Index access method operator family is for</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>opfname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Name of this operator family</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>opfnamespace</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
|
|
|
|
<entry>Namespace of this operator family</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>opfowner</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 operator family</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The majority of the information defining an operator family is not in its
|
|
|
|
<structname>pg_opfamily</structname> row, but in the associated rows in
|
|
|
|
<link linkend="catalog-pg-amop"><structname>pg_amop</structname></link>,
|
|
|
|
<link linkend="catalog-pg-amproc"><structname>pg_amproc</structname></link>,
|
|
|
|
and
|
|
|
|
<link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link>.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
2005-09-08 22:07:42 +02:00
|
|
|
<sect1 id="catalog-pg-pltemplate">
|
|
|
|
<title><structname>pg_pltemplate</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-pltemplate">
|
|
|
|
<primary>pg_pltemplate</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The catalog <structname>pg_pltemplate</structname> stores
|
|
|
|
<quote>template</> information for procedural languages.
|
|
|
|
A template for a language allows the language to be created in a
|
|
|
|
particular database by a simple <command>CREATE LANGUAGE</> command,
|
|
|
|
with no need to specify implementation details.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Unlike most system catalogs, <structname>pg_pltemplate</structname>
|
|
|
|
is shared across all databases of a cluster: there is only one
|
|
|
|
copy of <structname>pg_pltemplate</structname> per cluster, not
|
|
|
|
one per database. This allows the information to be accessible in
|
|
|
|
each database as it is needed.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_pltemplate</> Columns</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="3">
|
2005-09-08 22:07:42 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>tmplname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry>Name of the language this template is for</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>tmpltrusted</structfield></entry>
|
|
|
|
<entry><type>boolean</type></entry>
|
|
|
|
<entry>True if language is considered trusted</entry>
|
|
|
|
</row>
|
|
|
|
|
2007-03-26 18:58:41 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>tmpldbacreate</structfield></entry>
|
|
|
|
<entry><type>boolean</type></entry>
|
|
|
|
<entry>True if language may be created by a database owner</entry>
|
|
|
|
</row>
|
|
|
|
|
2005-09-08 22:07:42 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>tmplhandler</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry>Name of call handler function</entry>
|
|
|
|
</row>
|
|
|
|
|
2009-09-23 01:43:43 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>tmplinline</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
2010-08-17 06:37:21 +02:00
|
|
|
<entry>Name of anonymous-block handler function, or null if none</entry>
|
2009-09-23 01:43:43 +02:00
|
|
|
</row>
|
|
|
|
|
2005-09-08 22:07:42 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>tmplvalidator</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
2010-08-17 06:37:21 +02:00
|
|
|
<entry>Name of validator function, or null if none</entry>
|
2005-09-08 22:07:42 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>tmpllibrary</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry>Path of shared library that implements language</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>tmplacl</structfield></entry>
|
|
|
|
<entry><type>aclitem[]</type></entry>
|
2011-03-05 21:34:10 +01:00
|
|
|
<entry>Access privileges for template (not actually used)</entry>
|
2005-09-08 22:07:42 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
There are not currently any commands that manipulate procedural language
|
|
|
|
templates; to change the built-in information, a superuser must modify
|
2006-01-16 19:15:31 +01:00
|
|
|
the table using ordinary <command>INSERT</command>, <command>DELETE</command>,
|
2011-03-05 21:34:10 +01:00
|
|
|
or <command>UPDATE</command> commands.
|
2005-09-08 22:07:42 +02:00
|
|
|
</para>
|
|
|
|
|
2011-03-05 21:34:10 +01:00
|
|
|
<note>
|
|
|
|
<para>
|
|
|
|
It is likely that <structname>pg_pltemplate</> will be removed in some
|
|
|
|
future release of <productname>PostgreSQL</productname>, in favor of
|
|
|
|
keeping this knowledge about procedural languages in their respective
|
|
|
|
extension installation scripts.
|
|
|
|
</para>
|
|
|
|
</note>
|
2005-09-08 22:07:42 +02:00
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
2015-01-24 22:16:22 +01:00
|
|
|
<sect1 id="catalog-pg-policy">
|
|
|
|
<title><structname>pg_policy</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-policy">
|
|
|
|
<primary>pg_policy</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
2015-01-29 03:47:15 +01:00
|
|
|
The catalog <structname>pg_policy</structname> stores row level
|
2015-01-24 22:16:22 +01:00
|
|
|
security policies for tables. A policy includes the kind of
|
|
|
|
command that it applies to (possibly all commands), the roles that it
|
|
|
|
applies to, the expression to be added as a security-barrier
|
|
|
|
qualification to queries that include the table, and the expression
|
|
|
|
to be added as a <literal>WITH CHECK</> option for queries that attempt to
|
|
|
|
add new records to the table.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
|
|
|
|
<title><structname>pg_policy</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>polname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>The name of the policy</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>polrelid</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 to which the policy applies</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>polcmd</structfield></entry>
|
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>The command type to which the policy is applied:
|
|
|
|
<literal>r</> for <command>SELECT</>,
|
|
|
|
<literal>a</> for <command>INSERT</>,
|
|
|
|
<literal>w</> for <command>UPDATE</>,
|
|
|
|
<literal>d</> for <command>DELETE</>,
|
|
|
|
or <literal>*</> for all</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>polroles</structfield></entry>
|
|
|
|
<entry><type>oid[]</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
|
|
|
|
<entry>The roles to which the policy is applied</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>polqual</structfield></entry>
|
|
|
|
<entry><type>pg_node_tree</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>The expression tree to be added to the security barrier qualifications for queries that use the table</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>polwithcheck</structfield></entry>
|
|
|
|
<entry><type>pg_node_tree</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>The expression tree to be added to the WITH CHECK qualifications for queries that attempt to add rows to the table</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<note>
|
|
|
|
<para>
|
|
|
|
Policies stored in <structname>pg_policy</> are applied only when
|
|
|
|
<structname>pg_class</>.<structfield>relrowsecurity</> is set for
|
|
|
|
their table.
|
|
|
|
</para>
|
|
|
|
</note>
|
|
|
|
|
|
|
|
</sect1>
|
2005-09-08 22:07:42 +02:00
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-proc">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_proc</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-proc">
|
|
|
|
<primary>pg_proc</primary>
|
|
|
|
</indexterm>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_proc</> stores information about functions (or procedures).
|
2010-04-03 09:23:02 +02:00
|
|
|
See <xref linkend="sql-createfunction">
|
2005-01-06 00:42:03 +01:00
|
|
|
and <xref linkend="xfunc"> for more information.
|
2000-11-29 21:15:59 +01:00
|
|
|
</para>
|
|
|
|
|
2002-04-11 22:00:18 +02:00
|
|
|
<para>
|
|
|
|
The table contains data for aggregate functions as well as plain functions.
|
|
|
|
If <structfield>proisagg</structfield> is true, there should be a matching
|
2003-04-15 15:23:35 +02:00
|
|
|
row in <structfield>pg_aggregate</structfield>.
|
2002-04-11 22:00:18 +02:00
|
|
|
</para>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_proc</> Columns</title>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2000-11-29 21:15:59 +01:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
2012-12-15 06:42:47 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>proname</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Name of the function</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-04-05 02:31:36 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>pronamespace</structfield></entry>
|
2002-04-05 02:31:36 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
|
2002-04-05 02:31:36 +02:00
|
|
|
<entry>
|
|
|
|
The OID of the namespace that contains this function
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>proowner</structfield></entry>
|
2005-06-28 07:09:14 +02:00
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Owner of the function</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>prolang</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2004-07-05 01:34:24 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-language"><structname>pg_language</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>Implementation language or call interface of this function</entry>
|
|
|
|
</row>
|
|
|
|
|
2007-01-22 02:35:23 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>procost</structfield></entry>
|
|
|
|
<entry><type>float4</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Estimated execution cost (in units of
|
|
|
|
<xref linkend="guc-cpu-operator-cost">); if <structfield>proretset</>,
|
|
|
|
this is cost per row returned</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>prorows</structfield></entry>
|
|
|
|
<entry><type>float4</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Estimated number of result rows (zero if not <structfield>proretset</>)</entry>
|
|
|
|
</row>
|
|
|
|
|
2008-07-16 18:55:24 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>provariadic</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
|
|
|
<entry>Data type of the variadic array parameter's elements,
|
|
|
|
or zero if the function does not have a variadic parameter</entry>
|
|
|
|
</row>
|
|
|
|
|
2011-06-22 04:15:24 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>protransform</structfield></entry>
|
|
|
|
<entry><type>regproc</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2012-03-23 22:29:57 +01:00
|
|
|
<entry>Calls to this function can be simplified by this other function
|
|
|
|
(see <xref linkend="xfunc-transform-functions">)</entry>
|
2011-06-22 04:15:24 +02:00
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>proisagg</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2002-04-11 22:00:18 +02:00
|
|
|
<entry>Function is an aggregate function</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
2008-12-19 19:25:20 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>proiswindow</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Function is a window function</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>prosecdef</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2002-09-24 23:26:44 +02:00
|
|
|
<entry>Function is a security definer (i.e., a <quote>setuid</>
|
|
|
|
function)</entry>
|
2012-02-14 04:20:27 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>proleakproof</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
The function has no side effects. No information about the
|
|
|
|
arguments is conveyed except via the return value. Any function
|
|
|
|
that might throw an error depending on the values of its arguments
|
2012-06-07 23:06:20 +02:00
|
|
|
is not leak-proof.
|
2012-02-14 04:20:27 +01:00
|
|
|
</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>proisstrict</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
Function returns null if any call argument is null. In that
|
|
|
|
case the function won't actually be called at all. Functions
|
|
|
|
that are not <quote>strict</quote> must be prepared to handle
|
2010-08-17 06:37:21 +02:00
|
|
|
null inputs.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-04-11 22:00:18 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>proretset</structfield></entry>
|
2002-04-11 22:00:18 +02:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Function returns a set (i.e., multiple values of the specified
|
2002-04-11 22:00:18 +02:00
|
|
|
data type)</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-04-05 02:31:36 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>provolatile</structfield></entry>
|
2002-04-05 02:31:36 +02:00
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
<structfield>provolatile</structfield> tells whether the function's
|
|
|
|
result depends only on its input arguments, or is affected by outside
|
|
|
|
factors.
|
|
|
|
It is <literal>i</literal> for <quote>immutable</> functions,
|
|
|
|
which always deliver the same result for the same inputs.
|
|
|
|
It is <literal>s</literal> for <quote>stable</> functions,
|
|
|
|
whose results (for fixed inputs) do not change within a scan.
|
|
|
|
It is <literal>v</literal> for <quote>volatile</> functions,
|
Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
Also update two error messages mentioned in the documenation to match.
2007-01-31 21:56:20 +01:00
|
|
|
whose results might change at any time. (Use <literal>v</literal> also
|
2002-04-05 02:31:36 +02:00
|
|
|
for functions with side-effects, so that calls to them cannot get
|
|
|
|
optimized away.)
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2015-09-16 21:38:47 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>proparallel</structfield></entry>
|
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
<structfield>proparallel</structfield> tells whether the function
|
|
|
|
can be safely run in parallel mode.
|
|
|
|
It is <literal>s</literal> for functions which are safe to run in
|
|
|
|
parallel mode without restriction.
|
|
|
|
It is <literal>r</literal> for functions which can be run in parallel
|
|
|
|
mode, but their execution is restricted to the parallel group leader;
|
|
|
|
parallel worker processes cannot invoke these functions.
|
|
|
|
It is <literal>u</literal> for functions which are unsafe in parallel
|
|
|
|
mode; the presence of such a function forces a serial execution plan.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>pronargs</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int2</type></entry>
|
|
|
|
<entry></entry>
|
2008-12-18 19:20:35 +01:00
|
|
|
<entry>Number of input arguments</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>pronargdefaults</structfield></entry>
|
|
|
|
<entry><type>int2</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Number of arguments that have defaults</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>prorettype</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2002-09-24 23:26:44 +02:00
|
|
|
<entry>Data type of the return value</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>proargtypes</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oidvector</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2005-03-29 21:44:23 +02:00
|
|
|
<entry>
|
|
|
|
An array with the data types of the function arguments. This includes
|
2008-07-16 03:30:23 +02:00
|
|
|
only input arguments (including <literal>INOUT</literal> and
|
|
|
|
<literal>VARIADIC</> arguments), and thus represents
|
2010-08-17 06:37:21 +02:00
|
|
|
the call signature of the function.
|
2005-03-29 21:44:23 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>proallargtypes</structfield></entry>
|
|
|
|
<entry><type>oid[]</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
|
|
|
<entry>
|
|
|
|
An array with the data types of the function arguments. This includes
|
2008-07-16 03:30:23 +02:00
|
|
|
all arguments (including <literal>OUT</literal> and
|
|
|
|
<literal>INOUT</literal> arguments); however, if all the
|
|
|
|
arguments are <literal>IN</literal> arguments, this field will be null.
|
2005-03-29 21:44:23 +02:00
|
|
|
Note that subscripting is 1-based, whereas for historical reasons
|
2010-08-17 06:37:21 +02:00
|
|
|
<structfield>proargtypes</> is subscripted from 0.
|
2005-03-29 21:44:23 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>proargmodes</structfield></entry>
|
2005-07-07 22:40:02 +02:00
|
|
|
<entry><type>char[]</type></entry>
|
2005-03-29 21:44:23 +02:00
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
An array with the modes of the function arguments, encoded as
|
2006-10-23 20:10:32 +02:00
|
|
|
<literal>i</literal> for <literal>IN</> arguments,
|
|
|
|
<literal>o</literal> for <literal>OUT</> arguments,
|
2008-07-16 03:30:23 +02:00
|
|
|
<literal>b</literal> for <literal>INOUT</> arguments,
|
2008-07-18 05:32:53 +02:00
|
|
|
<literal>v</literal> for <literal>VARIADIC</> arguments,
|
|
|
|
<literal>t</literal> for <literal>TABLE</> arguments.
|
2008-07-16 03:30:23 +02:00
|
|
|
If all the arguments are <literal>IN</literal> arguments,
|
|
|
|
this field will be null.
|
2005-03-29 21:44:23 +02:00
|
|
|
Note that subscripts correspond to positions of
|
2010-08-17 06:37:21 +02:00
|
|
|
<structfield>proallargtypes</> not <structfield>proargtypes</>.
|
2005-03-29 21:44:23 +02:00
|
|
|
</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
2004-01-07 00:55:19 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>proargnames</structfield></entry>
|
|
|
|
<entry><type>text[]</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
An array with the names of the function arguments.
|
|
|
|
Arguments without a name are set to empty strings in the array.
|
2005-03-29 21:44:23 +02:00
|
|
|
If none of the arguments have a name, this field will be null.
|
|
|
|
Note that subscripts correspond to positions of
|
2010-08-17 06:37:21 +02:00
|
|
|
<structfield>proallargtypes</> not <structfield>proargtypes</>.
|
2004-01-07 00:55:19 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2008-12-18 19:20:35 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>proargdefaults</structfield></entry>
|
2010-09-03 03:34:55 +02:00
|
|
|
<entry><type>pg_node_tree</type></entry>
|
2008-12-18 19:20:35 +01:00
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
Expression trees (in <function>nodeToString()</function> representation)
|
|
|
|
for default values. This is a list with
|
|
|
|
<structfield>pronargdefaults</> elements, corresponding to the last
|
|
|
|
<replaceable>N</> <emphasis>input</> arguments (i.e., the last
|
|
|
|
<replaceable>N</> <structfield>proargtypes</> positions).
|
2010-08-17 06:37:21 +02:00
|
|
|
If none of the arguments have defaults, this field will be null.
|
2008-12-18 19:20:35 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2015-04-26 16:33:14 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>protrftypes</structfield></entry>
|
|
|
|
<entry><type>oid[]</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
Data type OIDs for which to apply transforms.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>prosrc</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
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
|
2010-08-17 06:37:21 +02:00
|
|
|
else, depending on the implementation language/call convention.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>probin</structfield></entry>
|
2009-08-04 06:04:12 +02:00
|
|
|
<entry><type>text</type></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>
|
|
|
|
Additional information about how to invoke the function.
|
2010-08-17 06:37:21 +02:00
|
|
|
Again, the interpretation is language-specific.
|
2001-10-16 00:47:47 +02:00
|
|
|
</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
2002-02-19 00:11:58 +01:00
|
|
|
|
2007-09-03 02:39:26 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>proconfig</structfield></entry>
|
|
|
|
<entry><type>text[]</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Function's local settings for run-time configuration variables</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-02-19 00:11:58 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>proacl</structfield></entry>
|
2002-02-19 00:11:58 +01:00
|
|
|
<entry><type>aclitem[]</type></entry>
|
|
|
|
<entry></entry>
|
2005-01-06 00:42:03 +01:00
|
|
|
<entry>
|
|
|
|
Access privileges; see
|
2010-04-03 09:23:02 +02:00
|
|
|
<xref linkend="sql-grant"> and
|
|
|
|
<xref linkend="sql-revoke">
|
2006-01-16 19:15:31 +01:00
|
|
|
for details
|
2005-01-06 00:42:03 +01:00
|
|
|
</entry>
|
2002-02-19 00:11:58 +01:00
|
|
|
</row>
|
2000-11-29 21:15:59 +01:00
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
2001-10-16 00:47:47 +02:00
|
|
|
<para>
|
2005-01-06 00:42:03 +01:00
|
|
|
For compiled functions, both built-in and dynamically loaded,
|
2003-04-15 15:23:35 +02:00
|
|
|
<structfield>prosrc</structfield> contains the function's C-language
|
2005-01-06 00:42:03 +01:00
|
|
|
name (link symbol). For all other currently-known language types,
|
2003-04-15 15:23:35 +02:00
|
|
|
<structfield>prosrc</structfield> contains the function's source
|
|
|
|
text. <structfield>probin</structfield> is unused except for
|
|
|
|
dynamically-loaded C functions, for which it gives the name of the
|
|
|
|
shared library file containing the function.
|
2001-10-16 00:47:47 +02:00
|
|
|
</para>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
2011-11-03 12:16:28 +01:00
|
|
|
<sect1 id="catalog-pg-range">
|
|
|
|
<title><structname>pg_range</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-range">
|
|
|
|
<primary>pg_range</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
2011-11-19 00:23:55 +01:00
|
|
|
The catalog <structname>pg_range</structname> stores information about
|
|
|
|
range types. This is in addition to the types' entries in
|
|
|
|
<link linkend="catalog-pg-type"><structname>pg_type</structname></link>.
|
2011-11-03 12:16:28 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_range</> 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>rngtypid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2011-11-19 00:23:55 +01:00
|
|
|
<entry>OID of the range type</entry>
|
2011-11-03 12:16:28 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>rngsubtype</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2011-11-19 00:23:55 +01:00
|
|
|
<entry>OID of the element type (subtype) of this range type</entry>
|
2011-11-03 12:16:28 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>rngcollation</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-collation"><structname>pg_collation</structname></link>.oid</literal></entry>
|
2011-11-19 00:23:55 +01:00
|
|
|
<entry>OID of the collation used for range comparisons, or 0 if none</entry>
|
2011-11-03 12:16:28 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>rngsubopc</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link>.oid</literal></entry>
|
2011-11-19 00:23:55 +01:00
|
|
|
<entry>OID of the subtype's operator class used for range comparisons</entry>
|
2011-11-03 12:16:28 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>rngcanonical</structfield></entry>
|
|
|
|
<entry><type>regproc</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2011-11-19 00:23:55 +01:00
|
|
|
<entry>OID of the function to convert a range value into canonical form,
|
|
|
|
or 0 if none</entry>
|
2011-11-03 12:16:28 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>rngsubdiff</structfield></entry>
|
|
|
|
<entry><type>regproc</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2011-11-19 00:23:55 +01:00
|
|
|
<entry>OID of the function to return the difference between two element
|
|
|
|
values as <type>double precision</type>, or 0 if none</entry>
|
2011-11-03 12:16:28 +01:00
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
2011-11-19 00:23:55 +01:00
|
|
|
<para>
|
|
|
|
<structfield>rngsubopc</> (plus <structfield>rngcollation</>, if the
|
|
|
|
element type is collatable) determines the sort ordering used by the range
|
|
|
|
type. <structfield>rngcanonical</> is used when the element type is
|
|
|
|
discrete. <structfield>rngsubdiff</> is optional but should be supplied to
|
|
|
|
improve performance of GiST indexes on the range type.
|
|
|
|
</para>
|
|
|
|
|
2011-11-03 12:16:28 +01:00
|
|
|
</sect1>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-rewrite">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_rewrite</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-rewrite">
|
|
|
|
<primary>pg_rewrite</primary>
|
|
|
|
</indexterm>
|
2001-10-16 00:47:47 +02:00
|
|
|
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
The catalog <structname>pg_rewrite</structname> stores rewrite rules for tables and views.
|
2001-10-16 00:47:47 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_rewrite</> Columns</title>
|
2001-10-16 00:47:47 +02:00
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2001-10-16 00:47:47 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
2012-12-15 06:42:47 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
|
|
|
</row>
|
|
|
|
|
2001-10-16 00:47:47 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>rulename</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Rule name</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>ev_class</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry>The table this rule is for</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-09-24 23:26:44 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>ev_type</structfield></entry>
|
2002-09-24 23:26:44 +02:00
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>
|
|
|
|
Event type that the rule is for: 1 = <command>SELECT</>, 2 =
|
|
|
|
<command>UPDATE</>, 3 = <command>INSERT</>, 4 =
|
|
|
|
<command>DELETE</>
|
|
|
|
</entry>
|
2002-09-24 23:26:44 +02:00
|
|
|
</row>
|
|
|
|
|
2007-03-20 00:38:32 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>ev_enabled</structfield></entry>
|
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2007-03-22 16:46:56 +01:00
|
|
|
Controls in which <xref linkend="guc-session-replication-role"> modes
|
|
|
|
the rule fires.
|
|
|
|
<literal>O</> = rule fires in <quote>origin</> and <quote>local</> modes,
|
|
|
|
<literal>D</> = rule is disabled,
|
|
|
|
<literal>R</> = rule fires in <quote>replica</> mode,
|
|
|
|
<literal>A</> = rule fires always.
|
|
|
|
</entry>
|
2007-03-20 00:38:32 +01:00
|
|
|
</row>
|
|
|
|
|
2001-10-16 00:47:47 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>is_instead</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>True if the rule is an <literal>INSTEAD</literal> rule</entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>ev_qual</structfield></entry>
|
2010-09-03 03:34:55 +02:00
|
|
|
<entry><type>pg_node_tree</type></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>
|
|
|
|
Expression tree (in the form of a
|
|
|
|
<function>nodeToString()</function> representation) for the
|
|
|
|
rule's qualifying condition
|
|
|
|
</entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>ev_action</structfield></entry>
|
2010-09-03 03:34:55 +02:00
|
|
|
<entry><type>pg_node_tree</type></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>
|
|
|
|
Query tree (in the form of a
|
|
|
|
<function>nodeToString()</function> representation) for the
|
|
|
|
rule's action
|
|
|
|
</entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<note>
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
<literal>pg_class.relhasrules</literal>
|
2001-10-16 00:47:47 +02:00
|
|
|
must be true if a table has any rules in this catalog.
|
|
|
|
</para>
|
|
|
|
</note>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2001-10-16 00:47:47 +02:00
|
|
|
|
Introduce replication progress tracking infrastructure.
When implementing a replication solution ontop of logical decoding, two
related problems exist:
* How to safely keep track of replication progress
* How to change replication behavior, based on the origin of a row;
e.g. to avoid loops in bi-directional replication setups
The solution to these problems, as implemented here, consist out of
three parts:
1) 'replication origins', which identify nodes in a replication setup.
2) 'replication progress tracking', which remembers, for each
replication origin, how far replay has progressed in a efficient and
crash safe manner.
3) The ability to filter out changes performed on the behest of a
replication origin during logical decoding; this allows complex
replication topologies. E.g. by filtering all replayed changes out.
Most of this could also be implemented in "userspace", e.g. by inserting
additional rows contain origin information, but that ends up being much
less efficient and more complicated. We don't want to require various
replication solutions to reimplement logic for this independently. The
infrastructure is intended to be generic enough to be reusable.
This infrastructure also replaces the 'nodeid' infrastructure of commit
timestamps. It is intended to provide all the former capabilities,
except that there's only 2^16 different origins; but now they integrate
with logical decoding. Additionally more functionality is accessible via
SQL. Since the commit timestamp infrastructure has also been introduced
in 9.5 (commit 73c986add) changing the API is not a problem.
For now the number of origins for which the replication progress can be
tracked simultaneously is determined by the max_replication_slots
GUC. That GUC is not a perfect match to configure this, but there
doesn't seem to be sufficient reason to introduce a separate new one.
Bumps both catversion and wal page magic.
Author: Andres Freund, with contributions from Petr Jelinek and Craig Ringer
Reviewed-By: Heikki Linnakangas, Petr Jelinek, Robert Haas, Steve Singer
Discussion: 20150216002155.GI15326@awork2.anarazel.de,
20140923182422.GA15776@alap3.anarazel.de,
20131114172632.GE7522@alap2.anarazel.de
2015-04-29 19:30:53 +02:00
|
|
|
<sect1 id="catalog-pg-replication-origin">
|
|
|
|
<title><structname>pg_replication_origin</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-replication-origin">
|
|
|
|
<primary>pg_replication_origin</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The <structname>pg_replication_origin</structname> catalog contains
|
|
|
|
all replication origins created. For more on replication origins
|
|
|
|
see <xref linkend="replication-origins">.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
|
|
|
|
<title><structname>pg_replication_origin</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>roident</structfield></entry>
|
|
|
|
<entry><type>Oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>A unique, cluster-wide identifier for the replication
|
|
|
|
origin. Should never leave the system.</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>roname</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>The external, user defined, name of a replication
|
|
|
|
origin.</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
<sect1 id="catalog-pg-replication-origin-status">
|
|
|
|
<title><structname>pg_replication_origin_status</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-replication-origin-status">
|
|
|
|
<primary>pg_replication_origin_status</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The <structname>pg_replication_origin_status</structname> view
|
|
|
|
contains information about how far replay for a certain origin has
|
|
|
|
progressed. For more on replication origins
|
|
|
|
see <xref linkend="replication-origins">.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
|
|
|
|
<title><structname>pg_replication_origin_status</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>local_id</structfield></entry>
|
|
|
|
<entry><type>Oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-replication-origin"><structname>pg_replication_origin</structname></link>.roident</literal></entry>
|
|
|
|
<entry>internal node identifier</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>external_id</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-replication-origin"><structname>pg_replication_origin</structname></link>.roname</literal></entry>
|
|
|
|
<entry>external node identifier</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>remote_lsn</structfield></entry>
|
|
|
|
<entry><type>pg_lsn</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>The origin node's LSN up to which data has been replicated.</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>local_lsn</structfield></entry>
|
|
|
|
<entry><type>pg_lsn</type></entry>
|
|
|
|
<entry></entry>
|
2015-08-07 15:08:51 +02:00
|
|
|
<entry>
|
|
|
|
This node's LSN at which <literal>remote_lsn</literal> has
|
|
|
|
been replicated. Used to flush commit records before persisting
|
|
|
|
data to disk when using asynchronous commits.
|
|
|
|
</entry>
|
Introduce replication progress tracking infrastructure.
When implementing a replication solution ontop of logical decoding, two
related problems exist:
* How to safely keep track of replication progress
* How to change replication behavior, based on the origin of a row;
e.g. to avoid loops in bi-directional replication setups
The solution to these problems, as implemented here, consist out of
three parts:
1) 'replication origins', which identify nodes in a replication setup.
2) 'replication progress tracking', which remembers, for each
replication origin, how far replay has progressed in a efficient and
crash safe manner.
3) The ability to filter out changes performed on the behest of a
replication origin during logical decoding; this allows complex
replication topologies. E.g. by filtering all replayed changes out.
Most of this could also be implemented in "userspace", e.g. by inserting
additional rows contain origin information, but that ends up being much
less efficient and more complicated. We don't want to require various
replication solutions to reimplement logic for this independently. The
infrastructure is intended to be generic enough to be reusable.
This infrastructure also replaces the 'nodeid' infrastructure of commit
timestamps. It is intended to provide all the former capabilities,
except that there's only 2^16 different origins; but now they integrate
with logical decoding. Additionally more functionality is accessible via
SQL. Since the commit timestamp infrastructure has also been introduced
in 9.5 (commit 73c986add) changing the API is not a problem.
For now the number of origins for which the replication progress can be
tracked simultaneously is determined by the max_replication_slots
GUC. That GUC is not a perfect match to configure this, but there
doesn't seem to be sufficient reason to introduce a separate new one.
Bumps both catversion and wal page magic.
Author: Andres Freund, with contributions from Petr Jelinek and Craig Ringer
Reviewed-By: Heikki Linnakangas, Petr Jelinek, Robert Haas, Steve Singer
Discussion: 20150216002155.GI15326@awork2.anarazel.de,
20140923182422.GA15776@alap3.anarazel.de,
20131114172632.GE7522@alap2.anarazel.de
2015-04-29 19:30:53 +02:00
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
</sect1>
|
|
|
|
|
2014-02-01 04:45:17 +01:00
|
|
|
<sect1 id="catalog-pg-replication-slots">
|
|
|
|
<title><structname>pg_replication_slots</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-replication-slots">
|
|
|
|
<primary>pg_replication_slots</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The <structname>pg_replication_slots</structname> view provides a listing
|
|
|
|
of all replication slots that currently exist on the database cluster,
|
|
|
|
along with their current state.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
For more on replication slots,
|
2014-03-18 18:20:01 +01:00
|
|
|
see <xref linkend="streaming-replication-slots"> and <xref linkend="logicaldecoding">.
|
2014-02-01 04:45:17 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
|
|
|
|
<title><structname>pg_replication_slots</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>slot_name</structfield></entry>
|
2014-05-01 04:55:16 +02:00
|
|
|
<entry><type>name</type></entry>
|
2014-02-01 04:45:17 +01:00
|
|
|
<entry></entry>
|
|
|
|
<entry>A unique, cluster-wide identifier for the replication slot</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2014-05-01 04:55:16 +02:00
|
|
|
<entry><structfield>plugin</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
2014-02-01 04:45:17 +01:00
|
|
|
<entry></entry>
|
2014-07-17 04:20:15 +02:00
|
|
|
<entry>The base name of the shared object containing the output plugin this logical slot is using, or null for physical slots.</entry>
|
2014-02-01 04:45:17 +01:00
|
|
|
</row>
|
|
|
|
|
2014-03-18 18:20:01 +01:00
|
|
|
<row>
|
2014-05-01 04:55:16 +02:00
|
|
|
<entry><structfield>slot_type</structfield></entry>
|
2014-03-18 18:20:01 +01:00
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
2014-05-01 04:55:16 +02:00
|
|
|
<entry>The slot type - <literal>physical</> or <literal>logical</></entry>
|
2014-03-18 18:20:01 +01:00
|
|
|
</row>
|
|
|
|
|
2014-02-01 04:45:17 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>datoid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-database"><structname>pg_database</structname></link>.oid</literal></entry>
|
2014-07-17 04:20:15 +02:00
|
|
|
<entry>The OID of the database this slot is associated with, or
|
2014-02-01 04:45:17 +01:00
|
|
|
null. Only logical slots have an associated database.</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>database</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-database"><structname>pg_database</structname></link>.datname</literal></entry>
|
|
|
|
<entry>The name of the database this slot is associated with, or
|
|
|
|
null. Only logical slots have an associated database.</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>active</structfield></entry>
|
|
|
|
<entry><type>boolean</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>True if this slot is currently actively being used</entry>
|
|
|
|
</row>
|
|
|
|
|
2015-04-21 11:51:06 +02:00
|
|
|
<row>
|
2015-04-22 09:42:36 +02:00
|
|
|
<entry><structfield>active_pid</structfield></entry>
|
2015-04-21 11:51:06 +02:00
|
|
|
<entry><type>integer</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>The process ID of the session using this slot if the slot
|
|
|
|
is currently actively being used. <literal>NULL</literal> if
|
|
|
|
inactive.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2014-02-01 04:45:17 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>xmin</structfield></entry>
|
|
|
|
<entry><type>xid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>The oldest transaction that this slot needs the database to
|
|
|
|
retain. <literal>VACUUM</literal> cannot remove tuples deleted
|
|
|
|
by any later transaction.
|
|
|
|
</entry>
|
2014-03-18 18:20:01 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>catalog_xmin</structfield></entry>
|
|
|
|
<entry><type>xid</type></entry>
|
|
|
|
<entry></entry>
|
2014-05-01 04:55:16 +02:00
|
|
|
<entry>The oldest transaction affecting the system catalogs that this
|
|
|
|
slot needs the database to retain. <literal>VACUUM</literal> cannot
|
|
|
|
remove catalog tuples deleted by any later transaction.
|
|
|
|
</entry>
|
2014-02-01 04:45:17 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>restart_lsn</structfield></entry>
|
2014-02-19 17:13:44 +01:00
|
|
|
<entry><type>pg_lsn</type></entry>
|
2014-02-01 04:45:17 +01:00
|
|
|
<entry></entry>
|
|
|
|
<entry>The address (<literal>LSN</literal>) of oldest WAL which still
|
|
|
|
might be required by the consumer of this slot and thus won't be
|
|
|
|
automatically removed during checkpoints.
|
|
|
|
</entry>
|
|
|
|
</row>
|
2015-08-10 13:28:18 +02:00
|
|
|
|
|
|
|
<row>
|
2015-08-17 11:51:52 +02:00
|
|
|
<entry><structfield>confirmed_flush_lsn</structfield></entry>
|
2015-08-10 13:28:18 +02:00
|
|
|
<entry><type>pg_lsn</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>The address (<literal>LSN</literal>) up to which the logical
|
|
|
|
slot's consumer has confirmed receiving data. Data older than this is
|
|
|
|
not available anymore. <literal>NULL</> for physical slots.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2014-02-01 04:45:17 +01:00
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
</sect1>
|
|
|
|
|
2010-09-28 02:55:27 +02:00
|
|
|
<sect1 id="catalog-pg-seclabel">
|
|
|
|
<title><structname>pg_seclabel</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-seclabel">
|
|
|
|
<primary>pg_seclabel</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The catalog <structname>pg_seclabel</structname> stores security
|
2011-07-20 15:12:42 +02:00
|
|
|
labels on database objects. Security labels can be manipulated
|
|
|
|
with the <xref linkend="sql-security-label"> command. For an easier
|
|
|
|
way to view security labels, see <xref linkend="view-pg-seclabels">.
|
2010-09-28 02:55:27 +02:00
|
|
|
</para>
|
|
|
|
|
2011-07-20 19:18:24 +02:00
|
|
|
<para>
|
|
|
|
See also <link linkend="catalog-pg-shseclabel"><structname>pg_shseclabel</structname></link>,
|
|
|
|
which performs a similar function for security labels of database objects
|
|
|
|
that are shared across a database cluster.
|
|
|
|
</para>
|
|
|
|
|
2010-09-28 02:55:27 +02:00
|
|
|
<table>
|
|
|
|
<title><structname>pg_seclabel</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>objoid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry>any OID column</entry>
|
|
|
|
<entry>The OID of the object this security label pertains to</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>classoid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
|
|
|
<entry>The OID of the system catalog this object appears in</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>objsubid</structfield></entry>
|
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
For a security label on a table column, this is the column number (the
|
|
|
|
<structfield>objoid</> and <structfield>classoid</> refer to
|
|
|
|
the table itself). For all other object types, this column is
|
|
|
|
zero.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>provider</structfield></entry>
|
2015-05-19 16:40:04 +02:00
|
|
|
<entry><type>text</type></entry>
|
2010-09-28 02:55:27 +02:00
|
|
|
<entry></entry>
|
|
|
|
<entry>The label provider associated with this label.</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>label</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>The security label applied to this object.</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
</sect1>
|
|
|
|
|
2005-07-07 22:40:02 +02:00
|
|
|
<sect1 id="catalog-pg-shdepend">
|
|
|
|
<title><structname>pg_shdepend</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-shdepend">
|
|
|
|
<primary>pg_shdepend</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The catalog <structname>pg_shdepend</structname> records the
|
|
|
|
dependency relationships between database objects and shared objects,
|
|
|
|
such as roles. This information allows
|
|
|
|
<productname>PostgreSQL</productname> to ensure that those objects are
|
|
|
|
unreferenced before attempting to delete them.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
See also <link linkend="catalog-pg-depend"><structname>pg_depend</structname></link>,
|
|
|
|
which performs a similar function for dependencies involving objects
|
|
|
|
within a single database.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Unlike most system catalogs, <structname>pg_shdepend</structname>
|
|
|
|
is shared across all databases of a cluster: there is only one
|
|
|
|
copy of <structname>pg_shdepend</structname> per cluster, not
|
|
|
|
one per database.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_shdepend</> Columns</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2005-07-07 22:40:02 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>dbid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-database"><structname>pg_database</structname></link>.oid</literal></entry>
|
|
|
|
<entry>The OID of the database the dependent object is in,
|
|
|
|
or zero for a shared object</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>classid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
|
|
|
<entry>The OID of the system catalog the dependent object is in</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>objid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry>any OID column</entry>
|
|
|
|
<entry>The OID of the specific dependent object</entry>
|
|
|
|
</row>
|
|
|
|
|
2009-01-22 21:16:10 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>objsubid</structfield></entry>
|
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
For a table column, this is the column number (the
|
|
|
|
<structfield>objid</> and <structfield>classid</> refer to the
|
2010-08-17 06:37:21 +02:00
|
|
|
table itself). For all other object types, this column is zero.
|
2009-01-22 21:16:10 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2005-07-07 22:40:02 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>refclassid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
|
|
|
<entry>The OID of the system catalog the referenced object is in
|
|
|
|
(must be a shared catalog)</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>refobjid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry>any OID column</entry>
|
|
|
|
<entry>The OID of the specific referenced object</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>deptype</structfield></entry>
|
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2006-01-16 19:15:31 +01:00
|
|
|
A code defining the specific semantics of this dependency relationship; see text
|
2005-07-07 22:40:02 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
In all cases, a <structname>pg_shdepend</structname> entry indicates that
|
Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
Also update two error messages mentioned in the documenation to match.
2007-01-31 21:56:20 +01:00
|
|
|
the referenced object cannot be dropped without also dropping the dependent
|
2005-07-07 22:40:02 +02:00
|
|
|
object. However, there are several subflavors identified by
|
|
|
|
<structfield>deptype</>:
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><symbol>SHARED_DEPENDENCY_OWNER</> (<literal>o</>)</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The referenced object (which must be a role) is the owner of the
|
|
|
|
dependent object.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><symbol>SHARED_DEPENDENCY_ACL</> (<literal>a</>)</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The referenced object (which must be a role) is mentioned in the
|
|
|
|
ACL (access control list, i.e., privileges list) of the
|
|
|
|
dependent object. (A <symbol>SHARED_DEPENDENCY_ACL</> entry is
|
|
|
|
not made for the owner of the object, since the owner will have
|
|
|
|
a <symbol>SHARED_DEPENDENCY_OWNER</> entry anyway.)
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2015-07-29 01:01:53 +02:00
|
|
|
<varlistentry>
|
|
|
|
<term><symbol>SHARED_DEPENDENCY_POLICY</> (<literal>r</>)</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The referenced object (which must be a role) is mentioned as the
|
|
|
|
target of a dependent policy object.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2005-07-07 22:40:02 +02:00
|
|
|
<varlistentry>
|
|
|
|
<term><symbol>SHARED_DEPENDENCY_PIN</> (<literal>p</>)</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
There is no dependent object; this type of entry is a signal
|
|
|
|
that the system itself depends on the referenced object, and so
|
|
|
|
that object must never be deleted. Entries of this type are
|
|
|
|
created only by <command>initdb</command>. The columns for the
|
|
|
|
dependent object contain zeroes.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
|
Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
Also update two error messages mentioned in the documenation to match.
2007-01-31 21:56:20 +01:00
|
|
|
Other dependency flavors might be needed in future. Note in particular
|
2005-07-07 22:40:02 +02:00
|
|
|
that the current definition only supports roles as referenced objects.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
2006-02-12 04:22:21 +01:00
|
|
|
<sect1 id="catalog-pg-shdescription">
|
|
|
|
<title><structname>pg_shdescription</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-shdescription">
|
|
|
|
<primary>pg_shdescription</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The catalog <structname>pg_shdescription</structname> stores optional
|
2006-11-12 07:25:37 +01:00
|
|
|
descriptions (comments) for shared database objects. Descriptions can be
|
2010-04-03 09:23:02 +02:00
|
|
|
manipulated with the <xref linkend="sql-comment"> command and viewed with
|
2006-11-12 07:25:37 +01:00
|
|
|
<application>psql</application>'s <literal>\d</literal> commands.
|
2006-02-12 04:22:21 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
See also <link linkend="catalog-pg-description"><structname>pg_description</structname></link>,
|
|
|
|
which performs a similar function for descriptions involving objects
|
|
|
|
within a single database.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Unlike most system catalogs, <structname>pg_shdescription</structname>
|
|
|
|
is shared across all databases of a cluster: there is only one
|
|
|
|
copy of <structname>pg_shdescription</structname> per cluster, not
|
|
|
|
one per database.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_shdescription</> Columns</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2006-02-12 04:22:21 +01:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>objoid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry>any OID column</entry>
|
|
|
|
<entry>The OID of the object this description pertains to</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>classoid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
|
|
|
<entry>The OID of the system catalog this object appears in</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>description</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>Arbitrary text that serves as the description of this object</entry>
|
2006-02-12 04:22:21 +01:00
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
2011-07-20 19:18:24 +02:00
|
|
|
<sect1 id="catalog-pg-shseclabel">
|
|
|
|
<title><structname>pg_shseclabel</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-shseclabel">
|
|
|
|
<primary>pg_shseclabel</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The catalog <structname>pg_shseclabel</structname> stores security
|
2012-04-12 16:43:39 +02:00
|
|
|
labels on shared database objects. Security labels can be manipulated
|
2011-07-20 19:18:24 +02:00
|
|
|
with the <xref linkend="sql-security-label"> command. For an easier
|
|
|
|
way to view security labels, see <xref linkend="view-pg-seclabels">.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
See also <link linkend="catalog-pg-seclabel"><structname>pg_seclabel</structname></link>,
|
|
|
|
which performs a similar function for security labels involving objects
|
|
|
|
within a single database.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Unlike most system catalogs, <structname>pg_shseclabel</structname>
|
|
|
|
is shared across all databases of a cluster: there is only one
|
|
|
|
copy of <structname>pg_shseclabel</structname> per cluster, not
|
|
|
|
one per database.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_shseclabel</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>objoid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry>any OID column</entry>
|
|
|
|
<entry>The OID of the object this security label pertains to</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>classoid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
|
|
|
<entry>The OID of the system catalog this object appears in</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>provider</structfield></entry>
|
2015-05-19 16:40:04 +02:00
|
|
|
<entry><type>text</type></entry>
|
2011-07-20 19:18:24 +02:00
|
|
|
<entry></entry>
|
|
|
|
<entry>The label provider associated with this label.</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>label</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>The security label applied to this object.</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
</sect1>
|
2005-07-07 22:40:02 +02:00
|
|
|
|
2005-06-28 07:09:14 +02:00
|
|
|
<sect1 id="catalog-pg-statistic">
|
|
|
|
<title><structname>pg_statistic</structname></title>
|
2003-04-15 15:23:35 +02:00
|
|
|
|
2005-06-28 07:09:14 +02:00
|
|
|
<indexterm zone="catalog-pg-statistic">
|
|
|
|
<primary>pg_statistic</primary>
|
2003-04-15 15:23:35 +02:00
|
|
|
</indexterm>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
|
|
|
<para>
|
2007-05-15 21:13:55 +02:00
|
|
|
The catalog <structname>pg_statistic</structname> stores
|
|
|
|
statistical data about the contents of the database. Entries are
|
2010-04-03 09:23:02 +02:00
|
|
|
created by <xref linkend="sql-analyze">
|
2009-12-29 21:11:45 +01:00
|
|
|
and subsequently used by the query planner. Note that all the
|
2007-05-15 21:13:55 +02:00
|
|
|
statistical data is inherently approximate, even assuming that it
|
|
|
|
is up-to-date.
|
2000-11-29 21:15:59 +01:00
|
|
|
</para>
|
|
|
|
|
2009-12-29 21:11:45 +01:00
|
|
|
<para>
|
|
|
|
Normally there is one entry, with <structfield>stainherit</> =
|
|
|
|
<literal>false</>, for each table column that has been analyzed.
|
|
|
|
If the table has inheritance children, a second entry with
|
|
|
|
<structfield>stainherit</> = <literal>true</> is also created. This row
|
|
|
|
represents the column's statistics over the inheritance tree, i.e.,
|
|
|
|
statistics for the data you'd see with
|
|
|
|
<literal>SELECT <replaceable>column</> FROM <replaceable>table</>*</literal>,
|
|
|
|
whereas the <structfield>stainherit</> = <literal>false</> row represents
|
|
|
|
the results of
|
|
|
|
<literal>SELECT <replaceable>column</> FROM ONLY <replaceable>table</></literal>.
|
|
|
|
</para>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<para>
|
2005-06-28 07:09:14 +02:00
|
|
|
<structname>pg_statistic</structname> also stores statistical data about
|
|
|
|
the values of index expressions. These are described as if they were
|
|
|
|
actual data columns; in particular, <structfield>starelid</structfield>
|
|
|
|
references the index. No entry is made for an ordinary non-expression
|
|
|
|
index column, however, since it would be redundant with the entry
|
2009-12-29 21:11:45 +01:00
|
|
|
for the underlying table column. Currently, entries for index expressions
|
|
|
|
always have <structfield>stainherit</> = <literal>false</>.
|
2000-11-29 21:15:59 +01:00
|
|
|
</para>
|
|
|
|
|
2001-10-16 00:47:47 +02:00
|
|
|
<para>
|
Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
Also update two error messages mentioned in the documenation to match.
2007-01-31 21:56:20 +01:00
|
|
|
Since different kinds of statistics might be appropriate for different
|
2005-06-28 07:09:14 +02:00
|
|
|
kinds of data, <structname>pg_statistic</structname> is designed not
|
|
|
|
to assume very much about what sort of statistics it stores. Only
|
|
|
|
extremely general statistics (such as nullness) are given dedicated
|
|
|
|
columns in <structname>pg_statistic</structname>. Everything else
|
|
|
|
is stored in <quote>slots</quote>, which are groups of associated columns
|
|
|
|
whose content is identified by a code number in one of the slot's columns.
|
|
|
|
For more information see
|
|
|
|
<filename>src/include/catalog/pg_statistic.h</filename>.
|
2001-05-07 02:43:27 +02:00
|
|
|
</para>
|
|
|
|
|
2001-10-16 00:47:47 +02:00
|
|
|
<para>
|
|
|
|
<structname>pg_statistic</structname> should not be readable by the
|
|
|
|
public, since even statistical information about a table's contents
|
Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
Also update two error messages mentioned in the documenation to match.
2007-01-31 21:56:20 +01:00
|
|
|
might be considered sensitive. (Example: minimum and maximum values
|
2001-10-16 00:47:47 +02:00
|
|
|
of a salary column might be quite interesting.)
|
2003-10-18 00:38:20 +02:00
|
|
|
<link linkend="view-pg-stats"><structname>pg_stats</structname></link>
|
|
|
|
is a publicly readable view on
|
2001-10-16 00:47:47 +02:00
|
|
|
<structname>pg_statistic</structname> that only exposes information
|
|
|
|
about those tables that are readable by the current user.
|
|
|
|
</para>
|
|
|
|
|
2001-05-07 02:43:27 +02:00
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_statistic</> Columns</title>
|
2001-05-07 02:43:27 +02:00
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2001-05-07 02:43:27 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>starelid</structfield></entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2004-02-15 22:01:39 +01:00
|
|
|
<entry>The table or index that the described column belongs to</entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>staattnum</structfield></entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
<entry><type>int2</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attnum</literal></entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
<entry>The number of the described column</entry>
|
|
|
|
</row>
|
|
|
|
|
2009-12-29 21:11:45 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>stainherit</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>If true, the stats include inheritance child columns, not just the
|
|
|
|
values in the specified relation</entry>
|
|
|
|
</row>
|
|
|
|
|
2001-05-07 02:43:27 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>stanullfrac</structfield></entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
<entry><type>float4</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>The fraction of the column's entries that are null</entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>stawidth</structfield></entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>The average stored width, in bytes, of nonnull entries</entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>stadistinct</structfield></entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
<entry><type>float4</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>The number of distinct nonnull data values in the column.
|
2001-05-07 02:43:27 +02:00
|
|
|
A value greater than zero is the actual number of distinct values.
|
2009-08-03 00:14:53 +02:00
|
|
|
A value less than zero is the negative of a multiplier for the number
|
|
|
|
of rows in the table; for example, a column in which values appear about
|
|
|
|
twice on the average could be represented by
|
|
|
|
<structfield>stadistinct</> = -0.5.
|
2010-08-17 06:37:21 +02:00
|
|
|
A zero value means the number of distinct values is unknown.
|
2001-05-07 02:43:27 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>stakind<replaceable>N</></structfield></entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
<entry><type>int2</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>
|
|
|
|
A code number indicating the kind of statistics stored in the
|
|
|
|
<replaceable>N</>th <quote>slot</quote> of the
|
2010-08-17 06:37:21 +02:00
|
|
|
<structname>pg_statistic</structname> row.
|
2001-05-07 02:43:27 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>staop<replaceable>N</></structfield></entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>
|
|
|
|
An operator used to derive the statistics stored in the
|
|
|
|
<replaceable>N</>th <quote>slot</quote>. For example, a
|
|
|
|
histogram slot would show the <literal><</literal> operator
|
2010-08-17 06:37:21 +02:00
|
|
|
that defines the sort order of the data.
|
2001-05-07 02:43:27 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>stanumbers<replaceable>N</></structfield></entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
<entry><type>float4[]</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>
|
|
|
|
Numerical statistics of the appropriate kind for the
|
2010-08-17 06:37:21 +02:00
|
|
|
<replaceable>N</>th <quote>slot</quote>, or null if the slot
|
2006-01-16 19:15:31 +01:00
|
|
|
kind does not involve numerical values
|
2001-05-07 02:43:27 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>stavalues<replaceable>N</></structfield></entry>
|
2003-03-23 06:14:37 +01:00
|
|
|
<entry><type>anyarray</type></entry>
|
2001-05-07 02:43:27 +02:00
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>
|
|
|
|
Column data values of the appropriate kind for the
|
2010-08-17 06:37:21 +02:00
|
|
|
<replaceable>N</>th <quote>slot</quote>, or null if the slot
|
2003-04-15 15:23:35 +02:00
|
|
|
kind does not store any data values. Each array's element
|
2012-03-04 02:20:19 +01:00
|
|
|
values are actually of the specific column's data type, or a related
|
|
|
|
type such as an array's element type, so there is no way to define
|
|
|
|
these columns' type more specifically than <type>anyarray</>.
|
2001-05-07 02:43:27 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2001-05-07 02:43:27 +02:00
|
|
|
|
|
|
|
|
2004-06-18 08:14:31 +02:00
|
|
|
<sect1 id="catalog-pg-tablespace">
|
|
|
|
<title><structname>pg_tablespace</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-tablespace">
|
|
|
|
<primary>pg_tablespace</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The catalog <structname>pg_tablespace</structname> stores information
|
|
|
|
about the available tablespaces. Tables can be placed in particular
|
|
|
|
tablespaces to aid administration of disk layout.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Unlike most system catalogs, <structname>pg_tablespace</structname>
|
|
|
|
is shared across all databases of a cluster: there is only one
|
|
|
|
copy of <structname>pg_tablespace</structname> per cluster, not
|
|
|
|
one per database.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_tablespace</> Columns</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2004-06-18 08:14:31 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
2012-12-15 06:42:47 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
|
|
|
</row>
|
|
|
|
|
2004-06-18 08:14:31 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>spcname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Tablespace name</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>spcowner</structfield></entry>
|
2005-06-28 07:09:14 +02:00
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
|
2004-06-18 08:14:31 +02:00
|
|
|
<entry>Owner of the tablespace, usually the user who created it</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>spcacl</structfield></entry>
|
|
|
|
<entry><type>aclitem[]</type></entry>
|
|
|
|
<entry></entry>
|
2005-01-06 00:42:03 +01:00
|
|
|
<entry>
|
|
|
|
Access privileges; see
|
2010-04-03 09:23:02 +02:00
|
|
|
<xref linkend="sql-grant"> and
|
|
|
|
<xref linkend="sql-revoke">
|
2006-01-16 19:15:31 +01:00
|
|
|
for details
|
2005-01-06 00:42:03 +01:00
|
|
|
</entry>
|
2004-06-18 08:14:31 +02:00
|
|
|
</row>
|
2010-01-10 02:23:08 +01:00
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>spcoptions</structfield></entry>
|
|
|
|
<entry><type>text[]</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
Tablespace-level options, as <quote>keyword=value</> strings
|
|
|
|
</entry>
|
|
|
|
</row>
|
2004-06-18 08:14:31 +02:00
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
2015-04-26 16:33:14 +02:00
|
|
|
<sect1 id="catalog-pg-transform">
|
|
|
|
<title><structname>pg_transform</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-transform">
|
|
|
|
<primary>pg_transform</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The catalog <structname>pg_transform</structname> stores information about
|
|
|
|
transforms, which are a mechanism to adapt data types to procedural
|
|
|
|
languages. See <xref linkend="sql-createtransform"> for more information.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_transform</> 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>trftype</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
|
|
|
<entry>OID of the data type this transform is for</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>trflang</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-language"><structname>pg_language</structname></link>.oid</literal></entry>
|
|
|
|
<entry>OID of the language this transform is for</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>trffromsql</structfield></entry>
|
|
|
|
<entry><type>regproc</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
|
|
|
<entry>
|
|
|
|
The OID of the function to use when converting the data type for input
|
|
|
|
to the procedural language (e.g., function parameters). Zero is stored
|
|
|
|
if this operation is not supported.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>trftosql</structfield></entry>
|
|
|
|
<entry><type>regproc</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
|
|
|
<entry>
|
|
|
|
The OID of the function to use when converting output from the
|
|
|
|
procedural language (e.g., return values) to the data type. Zero is
|
|
|
|
stored if this operation is not supported.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-trigger">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_trigger</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-trigger">
|
|
|
|
<primary>pg_trigger</primary>
|
|
|
|
</indexterm>
|
2001-10-16 00:47:47 +02:00
|
|
|
|
|
|
|
<para>
|
2010-10-10 19:43:33 +02:00
|
|
|
The catalog <structname>pg_trigger</structname> stores triggers on tables
|
|
|
|
and views.
|
2010-04-03 09:23:02 +02:00
|
|
|
See <xref linkend="sql-createtrigger">
|
2005-01-06 00:42:03 +01:00
|
|
|
for more information.
|
2001-10-16 00:47:47 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_trigger</> Columns</title>
|
2001-10-16 00:47:47 +02:00
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2001-10-16 00:47:47 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
2012-12-15 06:42:47 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
|
|
|
</row>
|
|
|
|
|
2001-10-16 00:47:47 +02:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>tgrelid</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry>The table this trigger is on</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>tgname</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
2002-09-24 23:26:44 +02:00
|
|
|
<entry>Trigger name (must be unique among triggers of same table)</entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>tgfoid</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry>The function to be called</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>tgtype</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>int2</type></entry>
|
|
|
|
<entry></entry>
|
2010-10-10 19:43:33 +02:00
|
|
|
<entry>Bit mask identifying trigger firing conditions</entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>tgenabled</structfield></entry>
|
2007-03-20 00:38:32 +01:00
|
|
|
<entry><type>char</type></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry></entry>
|
2007-03-20 00:38:32 +01:00
|
|
|
<entry>
|
2007-03-22 16:46:56 +01:00
|
|
|
Controls in which <xref linkend="guc-session-replication-role"> modes
|
|
|
|
the trigger fires.
|
|
|
|
<literal>O</> = trigger fires in <quote>origin</> and <quote>local</> modes,
|
|
|
|
<literal>D</> = trigger is disabled,
|
|
|
|
<literal>R</> = trigger fires in <quote>replica</> mode,
|
|
|
|
<literal>A</> = trigger fires always.
|
|
|
|
</entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2010-01-17 23:56:23 +01:00
|
|
|
<entry><structfield>tgisinternal</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2010-01-17 23:56:23 +01:00
|
|
|
<entry>True if trigger is internally generated (usually, to enforce
|
|
|
|
the constraint identified by <structfield>tgconstraint</>)</entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>tgconstrrelid</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2007-02-14 02:58:58 +01:00
|
|
|
<entry>The table referenced by a referential integrity constraint</entry>
|
|
|
|
</row>
|
|
|
|
|
2009-07-28 04:56:31 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>tgconstrindid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2014-01-31 23:44:18 +01:00
|
|
|
<entry>The index supporting a unique, primary key, referential integrity,
|
|
|
|
or exclusion constraint</entry>
|
2009-07-28 04:56:31 +02:00
|
|
|
</row>
|
|
|
|
|
2007-02-14 02:58:58 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>tgconstraint</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-constraint"><structname>pg_constraint</structname></link>.oid</literal></entry>
|
2010-01-17 23:56:23 +01:00
|
|
|
<entry>The <structname>pg_constraint</> entry associated with the trigger, if any</entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>tgdeferrable</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2007-02-14 02:58:58 +01:00
|
|
|
<entry>True if constraint trigger is deferrable</entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>tginitdeferred</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2007-02-14 02:58:58 +01:00
|
|
|
<entry>True if constraint trigger is initially deferred</entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>tgnargs</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>int2</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Number of argument strings passed to trigger function</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>tgattr</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>int2vector</type></entry>
|
2009-10-15 00:14:25 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attnum</literal></entry>
|
2010-08-17 06:37:21 +02:00
|
|
|
<entry>Column numbers, if trigger is column-specific; otherwise an
|
2009-10-15 00:14:25 +02:00
|
|
|
empty array</entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>tgargs</structfield></entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
<entry><type>bytea</type></entry>
|
|
|
|
<entry></entry>
|
2006-01-16 19:15:31 +01:00
|
|
|
<entry>Argument strings to pass to trigger, each NULL-terminated</entry>
|
2001-10-16 00:47:47 +02:00
|
|
|
</row>
|
2009-11-20 21:38:12 +01:00
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>tgqual</structfield></entry>
|
2010-09-03 03:34:55 +02:00
|
|
|
<entry><type>pg_node_tree</type></entry>
|
2009-11-20 21:38:12 +01:00
|
|
|
<entry></entry>
|
|
|
|
<entry>Expression tree (in <function>nodeToString()</function>
|
2010-08-17 06:37:21 +02:00
|
|
|
representation) for the trigger's <literal>WHEN</> condition, or null
|
2009-11-20 21:38:12 +01:00
|
|
|
if none</entry>
|
|
|
|
</row>
|
2001-10-16 00:47:47 +02:00
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
2009-10-15 00:14:25 +02:00
|
|
|
<para>
|
|
|
|
Currently, column-specific triggering is supported only for
|
|
|
|
<literal>UPDATE</> events, and so <structfield>tgattr</> is relevant
|
|
|
|
only for that event type. <structfield>tgtype</structfield> might
|
|
|
|
contain bits for other event types as well, but those are presumed
|
|
|
|
to be table-wide regardless of what is in <structfield>tgattr</>.
|
|
|
|
</para>
|
|
|
|
|
2007-02-14 02:58:58 +01:00
|
|
|
<note>
|
|
|
|
<para>
|
|
|
|
When <structfield>tgconstraint</> is nonzero,
|
2010-01-17 23:56:23 +01:00
|
|
|
<structfield>tgconstrrelid</>, <structfield>tgconstrindid</>,
|
|
|
|
<structfield>tgdeferrable</>, and <structfield>tginitdeferred</> are
|
|
|
|
largely redundant with the referenced <structname>pg_constraint</> entry.
|
|
|
|
However, it is possible for a non-deferrable trigger to be associated
|
|
|
|
with a deferrable constraint: foreign key constraints can have some
|
|
|
|
deferrable and some non-deferrable triggers.
|
2007-02-14 02:58:58 +01:00
|
|
|
</para>
|
|
|
|
</note>
|
|
|
|
|
2008-11-10 01:49:37 +01:00
|
|
|
<note>
|
|
|
|
<para>
|
|
|
|
<literal>pg_class.relhastriggers</literal>
|
2010-10-10 19:43:33 +02:00
|
|
|
must be true if a relation has any triggers in this catalog.
|
2008-11-10 01:49:37 +01:00
|
|
|
</para>
|
|
|
|
</note>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2001-10-16 00:47:47 +02:00
|
|
|
|
|
|
|
|
2007-10-01 23:10:40 +02:00
|
|
|
<sect1 id="catalog-pg-ts-config">
|
|
|
|
<title><structname>pg_ts_config</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-ts-config">
|
|
|
|
<primary>pg_ts_config</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The <structname>pg_ts_config</structname> catalog contains entries
|
|
|
|
representing text search configurations. A configuration specifies
|
|
|
|
a particular text search parser and a list of dictionaries to use
|
|
|
|
for each of the parser's output token types. The parser is shown
|
|
|
|
in the <structname>pg_ts_config</structname> entry, but the
|
|
|
|
token-to-dictionary mapping is defined by subsidiary entries in <link
|
|
|
|
linkend="catalog-pg-ts-config-map"><structname>pg_ts_config_map</structname></link>.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<productname>PostgreSQL</productname>'s text search features are
|
|
|
|
described at length in <xref linkend="textsearch">.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_ts_config</> Columns</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2007-10-01 23:10:40 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
2012-12-15 06:42:47 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
|
|
|
</row>
|
|
|
|
|
2007-10-01 23:10:40 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>cfgname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Text search configuration name</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>cfgnamespace</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 configuration
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>cfgowner</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 configuration</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>cfgparser</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-ts-parser"><structname>pg_ts_parser</structname></link>.oid</literal></entry>
|
|
|
|
<entry>The OID of the text search parser for this configuration</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
|
|
|
<sect1 id="catalog-pg-ts-config-map">
|
|
|
|
<title><structname>pg_ts_config_map</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-ts-config-map">
|
|
|
|
<primary>pg_ts_config_map</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The <structname>pg_ts_config_map</structname> catalog contains entries
|
|
|
|
showing which text search dictionaries should be consulted, and in
|
|
|
|
what order, for each output token type of each text search configuration's
|
|
|
|
parser.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<productname>PostgreSQL</productname>'s text search features are
|
|
|
|
described at length in <xref linkend="textsearch">.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_ts_config_map</> Columns</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2007-10-01 23:10:40 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>mapcfg</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-ts-config"><structname>pg_ts_config</structname></link>.oid</literal></entry>
|
|
|
|
<entry>The OID of the <structname>pg_ts_config</> entry owning this map entry</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>maptokentype</structfield></entry>
|
|
|
|
<entry><type>integer</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>A token type emitted by the configuration's parser</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>mapseqno</structfield></entry>
|
|
|
|
<entry><type>integer</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Order in which to consult this entry (lower
|
|
|
|
<structfield>mapseqno</>s first)</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>mapdict</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-ts-dict"><structname>pg_ts_dict</structname></link>.oid</literal></entry>
|
|
|
|
<entry>The OID of the text search dictionary to consult</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
|
|
|
<sect1 id="catalog-pg-ts-dict">
|
|
|
|
<title><structname>pg_ts_dict</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-ts-dict">
|
|
|
|
<primary>pg_ts_dict</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The <structname>pg_ts_dict</structname> catalog contains entries
|
|
|
|
defining text search dictionaries. A dictionary depends on a text
|
|
|
|
search template, which specifies all the implementation functions
|
|
|
|
needed; the dictionary itself provides values for the user-settable
|
|
|
|
parameters supported by the template. This division of labor allows
|
|
|
|
dictionaries to be created by unprivileged users. The parameters
|
|
|
|
are specified by a text string <structfield>dictinitoption</>,
|
|
|
|
whose format and meaning vary depending on the template.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<productname>PostgreSQL</productname>'s text search features are
|
|
|
|
described at length in <xref linkend="textsearch">.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_ts_dict</> Columns</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2007-10-01 23:10:40 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
2012-12-15 06:42:47 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
|
|
|
</row>
|
|
|
|
|
2007-10-01 23:10:40 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>dictname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Text search dictionary name</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>dictnamespace</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 dictionary
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>dictowner</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 dictionary</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>dicttemplate</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-ts-template"><structname>pg_ts_template</structname></link>.oid</literal></entry>
|
|
|
|
<entry>The OID of the text search template for this dictionary</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>dictinitoption</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Initialization option string for the template</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
|
|
|
<sect1 id="catalog-pg-ts-parser">
|
|
|
|
<title><structname>pg_ts_parser</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-ts-parser">
|
|
|
|
<primary>pg_ts_parser</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The <structname>pg_ts_parser</structname> catalog contains entries
|
|
|
|
defining text search parsers. A parser is responsible for splitting
|
|
|
|
input text into lexemes and assigning a token type to each lexeme.
|
|
|
|
Since a parser must be implemented by C-language-level functions,
|
|
|
|
creation of new parsers is restricted to database superusers.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<productname>PostgreSQL</productname>'s text search features are
|
|
|
|
described at length in <xref linkend="textsearch">.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_ts_parser</> Columns</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2007-10-01 23:10:40 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
2012-12-15 06:42:47 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
|
|
|
</row>
|
|
|
|
|
2007-10-01 23:10:40 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>prsname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Text search parser name</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>prsnamespace</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 parser
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>prsstart</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 parser's startup function</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>prstoken</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 parser's next-token function</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>prsend</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 parser's shutdown function</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>prsheadline</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 parser's headline function</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>prslextype</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 parser's lextype function</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
|
|
|
<sect1 id="catalog-pg-ts-template">
|
|
|
|
<title><structname>pg_ts_template</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-ts-template">
|
|
|
|
<primary>pg_ts_template</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The <structname>pg_ts_template</structname> catalog contains entries
|
|
|
|
defining text search templates. A template is the implementation
|
|
|
|
skeleton for a class of text search dictionaries.
|
|
|
|
Since a template must be implemented by C-language-level functions,
|
|
|
|
creation of new templates is restricted to database superusers.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<productname>PostgreSQL</productname>'s text search features are
|
|
|
|
described at length in <xref linkend="textsearch">.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_ts_template</> Columns</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2007-10-01 23:10:40 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
2012-12-15 06:42:47 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
|
|
|
</row>
|
|
|
|
|
2007-10-01 23:10:40 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>tmplname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Text search template name</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>tmplnamespace</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 template
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>tmplinit</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 template's initialization function</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>tmpllexize</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 template's lexize function</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
<sect1 id="catalog-pg-type">
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_type</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-type">
|
|
|
|
<primary>pg_type</primary>
|
|
|
|
</indexterm>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
2001-10-16 00:47:47 +02:00
|
|
|
<para>
|
2005-01-06 00:42:03 +01:00
|
|
|
The catalog <structname>pg_type</structname> stores information about data
|
Replace the hard-wired type knowledge in TypeCategory() and IsPreferredType()
with system catalog lookups, as was foreseen to be necessary almost since
their creation. Instead put the information into two new pg_type columns,
typcategory and typispreferred. Add support for setting these when
creating a user-defined base type.
The category column is just a "char" (i.e. a poor man's enum), allowing
a crude form of user extensibility of the category list: just use an
otherwise-unused character. This seems sufficient for foreseen uses,
but we could upgrade to having an actual category catalog someday, if
there proves to be a huge demand for custom type categories.
In this patch I have attempted to hew exactly to the behavior of the
previous hardwired logic, except for introducing new type categories for
arrays, composites, and enums. In particular the default preferred state
for user-defined types remains TRUE. That seems worth revisiting, but it
should be done as a separate patch from introducing the infrastructure.
Likewise, any adjustment of the standard set of categories should be done
separately.
2008-07-30 19:05:05 +02:00
|
|
|
types. Base types and enum types (scalar types) are created with
|
2010-04-03 09:23:02 +02:00
|
|
|
<xref linkend="sql-createtype">, and
|
2005-01-06 00:42:03 +01:00
|
|
|
domains with
|
2010-04-03 09:23:02 +02:00
|
|
|
<xref linkend="sql-createdomain">.
|
2003-05-09 00:19:58 +02:00
|
|
|
A composite type is automatically created for each table in the database, to
|
2002-03-20 20:45:13 +01:00
|
|
|
represent the row structure of the table. It is also possible to create
|
2005-01-06 00:42:03 +01:00
|
|
|
composite types with <command>CREATE TYPE AS</command>.
|
2001-10-16 00:47:47 +02:00
|
|
|
</para>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<table>
|
2003-04-15 15:23:35 +02:00
|
|
|
<title><structname>pg_type</> Columns</title>
|
2000-11-29 21:15:59 +01:00
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2000-11-29 21:15:59 +01:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
2012-12-15 06:42:47 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typname</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Data type name</entry>
|
|
|
|
</row>
|
|
|
|
|
2002-03-29 20:06:29 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typnamespace</structfield></entry>
|
2002-03-29 20:06:29 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry>
|
2002-03-29 20:06:29 +01:00
|
|
|
<entry>
|
|
|
|
The OID of the namespace that contains this type
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typowner</structfield></entry>
|
2005-06-28 07:09:14 +02:00
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>Owner of the type</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typlen</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>int2</type></entry>
|
|
|
|
<entry></entry>
|
2002-08-24 17:00:47 +02:00
|
|
|
<entry>
|
|
|
|
For a fixed-size type, <structfield>typlen</structfield> is the number
|
|
|
|
of bytes in the internal representation of the type. But for a
|
|
|
|
variable-length type, <structfield>typlen</structfield> is negative.
|
|
|
|
-1 indicates a <quote>varlena</> type (one that has a length word),
|
|
|
|
-2 indicates a null-terminated C string.
|
|
|
|
</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typbyval</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
<structfield>typbyval</structfield> determines whether internal
|
|
|
|
routines pass a value of this type by value or by reference.
|
2003-05-09 00:19:58 +02:00
|
|
|
<structfield>typbyval</structfield> had better be false if
|
|
|
|
<structfield>typlen</structfield> is not 1, 2, or 4 (or 8 on machines
|
|
|
|
where Datum is 8 bytes).
|
2000-11-29 21:15:59 +01:00
|
|
|
Variable-length types are always passed by reference. Note that
|
|
|
|
<structfield>typbyval</structfield> can be false even if the
|
2010-08-17 06:37:21 +02:00
|
|
|
length would allow pass-by-value.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typtype</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2007-04-02 05:49:42 +02:00
|
|
|
<structfield>typtype</structfield> is
|
|
|
|
<literal>b</literal> for a base type,
|
|
|
|
<literal>c</literal> for a composite type (e.g., a table's row type),
|
|
|
|
<literal>d</literal> for a domain,
|
|
|
|
<literal>e</literal> for an enum type,
|
2011-11-19 00:23:55 +01:00
|
|
|
<literal>p</literal> for a pseudo-type, or
|
|
|
|
<literal>r</literal> for a range type.
|
2007-04-02 05:49:42 +02:00
|
|
|
See also <structfield>typrelid</structfield> and
|
2010-08-17 06:37:21 +02:00
|
|
|
<structfield>typbasetype</structfield>.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
Replace the hard-wired type knowledge in TypeCategory() and IsPreferredType()
with system catalog lookups, as was foreseen to be necessary almost since
their creation. Instead put the information into two new pg_type columns,
typcategory and typispreferred. Add support for setting these when
creating a user-defined base type.
The category column is just a "char" (i.e. a poor man's enum), allowing
a crude form of user extensibility of the category list: just use an
otherwise-unused character. This seems sufficient for foreseen uses,
but we could upgrade to having an actual category catalog someday, if
there proves to be a huge demand for custom type categories.
In this patch I have attempted to hew exactly to the behavior of the
previous hardwired logic, except for introducing new type categories for
arrays, composites, and enums. In particular the default preferred state
for user-defined types remains TRUE. That seems worth revisiting, but it
should be done as a separate patch from introducing the infrastructure.
Likewise, any adjustment of the standard set of categories should be done
separately.
2008-07-30 19:05:05 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>typcategory</structfield></entry>
|
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
<structfield>typcategory</structfield> is an arbitrary classification
|
|
|
|
of data types that is used by the parser to determine which implicit
|
|
|
|
casts should be <quote>preferred</>.
|
2010-08-17 06:37:21 +02:00
|
|
|
See <xref linkend="catalog-typcategory-table">.
|
Replace the hard-wired type knowledge in TypeCategory() and IsPreferredType()
with system catalog lookups, as was foreseen to be necessary almost since
their creation. Instead put the information into two new pg_type columns,
typcategory and typispreferred. Add support for setting these when
creating a user-defined base type.
The category column is just a "char" (i.e. a poor man's enum), allowing
a crude form of user extensibility of the category list: just use an
otherwise-unused character. This seems sufficient for foreseen uses,
but we could upgrade to having an actual category catalog someday, if
there proves to be a huge demand for custom type categories.
In this patch I have attempted to hew exactly to the behavior of the
previous hardwired logic, except for introducing new type categories for
arrays, composites, and enums. In particular the default preferred state
for user-defined types remains TRUE. That seems worth revisiting, but it
should be done as a separate patch from introducing the infrastructure.
Likewise, any adjustment of the standard set of categories should be done
separately.
2008-07-30 19:05:05 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>typispreferred</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
True if the type is a preferred cast target within its
|
|
|
|
<structfield>typcategory</structfield>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typisdefined</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry>
|
|
|
|
True if the type is defined, false if this is a placeholder
|
|
|
|
entry for a not-yet-defined type. When
|
|
|
|
<structfield>typisdefined</structfield> is false, nothing
|
2010-08-17 06:37:21 +02:00
|
|
|
except the type name, namespace, and OID can be relied on.
|
2001-10-16 00:47:47 +02:00
|
|
|
</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typdelim</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>
|
|
|
|
Character that separates two values of this type when parsing
|
|
|
|
array input. Note that the delimiter is associated with the array
|
2010-08-17 06:37:21 +02:00
|
|
|
element data type, not the array data type.
|
2006-11-12 07:25:37 +01:00
|
|
|
</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typrelid</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>
|
2003-05-09 00:19:58 +02:00
|
|
|
If this is a composite type (see
|
2003-04-15 15:23:35 +02:00
|
|
|
<structfield>typtype</structfield>), then this column points to
|
2002-08-28 17:02:55 +02:00
|
|
|
the <structname>pg_class</structname> entry that defines the
|
|
|
|
corresponding table. (For a free-standing composite type, the
|
|
|
|
<structname>pg_class</structname> entry doesn't really represent
|
|
|
|
a table, but it is needed anyway for the type's
|
|
|
|
<structname>pg_attribute</structname> entries to link to.)
|
2010-08-17 06:37:21 +02:00
|
|
|
Zero for non-composite types.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typelem</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry>
|
|
|
|
If <structfield>typelem</structfield> is not 0 then it
|
|
|
|
identifies another row in <structname>pg_type</structname>.
|
|
|
|
The current type can then be subscripted like an array yielding
|
2001-11-03 22:42:47 +01:00
|
|
|
values of type <structfield>typelem</structfield>. A
|
|
|
|
<quote>true</quote> array type is variable length
|
|
|
|
(<structfield>typlen</structfield> = -1),
|
|
|
|
but some fixed-length (<structfield>typlen</structfield> > 0) types
|
|
|
|
also have nonzero <structfield>typelem</structfield>, for example
|
2005-03-29 02:17:27 +02:00
|
|
|
<type>name</type> and <type>point</type>.
|
2001-11-03 22:42:47 +01:00
|
|
|
If a fixed-length type has a <structfield>typelem</structfield> then
|
2003-04-15 15:23:35 +02:00
|
|
|
its internal representation must be some number of values of the
|
2002-03-22 20:20:45 +01:00
|
|
|
<structfield>typelem</structfield> data type with no other data.
|
2001-11-03 22:42:47 +01:00
|
|
|
Variable-length array types have a header defined by the array
|
2010-08-17 06:37:21 +02:00
|
|
|
subroutines.
|
2000-11-29 21:15:59 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
Support arrays of composite types, including the rowtypes of regular tables
and views (but not system catalogs, nor sequences or toast tables). Get rid
of the hardwired convention that a type's array type is named exactly "_type",
instead using a new column pg_type.typarray to provide the linkage. (It still
will be named "_type", though, except in odd corner cases such as
maximum-length type names.)
Along the way, make tracking of owner and schema dependencies for types more
uniform: a type directly created by the user has these dependencies, while a
table rowtype or auto-generated array type does not have them, but depends on
its parent object instead.
David Fetter, Andrew Dunstan, Tom Lane
2007-05-11 19:57:14 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>typarray</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
|
|
|
<entry>
|
|
|
|
If <structfield>typarray</structfield> is not 0 then it
|
|
|
|
identifies another row in <structname>pg_type</structname>, which
|
|
|
|
is the <quote>true</quote> array type having this type as element
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typinput</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2003-05-09 00:19:58 +02:00
|
|
|
<entry>Input conversion function (text format)</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typoutput</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2003-05-09 00:19:58 +02:00
|
|
|
<entry>Output conversion function (text format)</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>typreceive</structfield></entry>
|
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2003-05-09 00:19:58 +02:00
|
|
|
<entry>Input conversion function (binary format), or 0 if none</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>typsend</structfield></entry>
|
|
|
|
<entry><type>regproc</type></entry>
|
2003-06-25 03:14:37 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2003-05-09 00:19:58 +02:00
|
|
|
<entry>Output conversion function (binary format), or 0 if none</entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
|
|
|
|
2006-12-30 22:21:56 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>typmodin</structfield></entry>
|
|
|
|
<entry><type>regproc</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
|
|
|
<entry>Type modifier input function, or 0 if type does not support modifiers</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>typmodout</structfield></entry>
|
|
|
|
<entry><type>regproc</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
|
|
|
<entry>Type modifier output function, or 0 to use the standard format</entry>
|
|
|
|
</row>
|
|
|
|
|
2004-02-13 00:41:04 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>typanalyze</structfield></entry>
|
|
|
|
<entry><type>regproc</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.oid</literal></entry>
|
2010-08-17 06:37:21 +02:00
|
|
|
<entry>Custom <command>ANALYZE</command> function, or 0 to use the standard function</entry>
|
2004-02-13 00:41:04 +01:00
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typalign</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry><para>
|
|
|
|
|
|
|
|
<structfield>typalign</structfield> is the alignment required
|
|
|
|
when storing a value of this type. It applies to storage on
|
|
|
|
disk as well as most representations of the value inside
|
2001-11-21 06:53:41 +01:00
|
|
|
<productname>PostgreSQL</>.
|
2002-09-22 21:42:52 +02:00
|
|
|
When multiple values are stored consecutively, such
|
2000-11-29 21:15:59 +01:00
|
|
|
as in the representation of a complete row on disk, padding is
|
|
|
|
inserted before a datum of this type so that it begins on the
|
|
|
|
specified boundary. The alignment reference is the beginning
|
|
|
|
of the first datum in the sequence.
|
2010-02-03 18:25:06 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2000-11-29 21:15:59 +01:00
|
|
|
Possible values are:
|
|
|
|
<itemizedlist>
|
|
|
|
<listitem>
|
2003-04-15 15:23:35 +02:00
|
|
|
<para><literal>c</> = <type>char</type> alignment, i.e., no alignment needed.</para>
|
2000-11-29 21:15:59 +01:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2003-04-15 15:23:35 +02:00
|
|
|
<para><literal>s</> = <type>short</type> alignment (2 bytes on most machines).</para>
|
2000-11-29 21:15:59 +01:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2003-04-15 15:23:35 +02:00
|
|
|
<para><literal>i</> = <type>int</type> alignment (4 bytes on most machines).</para>
|
2000-11-29 21:15:59 +01:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2003-04-15 15:23:35 +02:00
|
|
|
<para><literal>d</> = <type>double</type> alignment (8 bytes on many machines, but by no means all).</para>
|
2000-11-29 21:15:59 +01:00
|
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
|
|
|
</para><note>
|
|
|
|
<para>
|
|
|
|
For types used in system tables, it is critical that the size
|
|
|
|
and alignment defined in <structname>pg_type</structname>
|
2003-04-15 15:23:35 +02:00
|
|
|
agree with the way that the compiler will lay out the column in
|
2003-11-01 02:56:29 +01:00
|
|
|
a structure representing a table row.
|
2000-11-29 21:15:59 +01:00
|
|
|
</para>
|
|
|
|
</note></entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typstorage</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>char</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry><para>
|
2002-08-24 17:00:47 +02:00
|
|
|
<structfield>typstorage</structfield> tells for varlena
|
2000-11-29 21:15:59 +01:00
|
|
|
types (those with <structfield>typlen</structfield> = -1) if
|
|
|
|
the type is prepared for toasting and what the default strategy
|
|
|
|
for attributes of this type should be.
|
|
|
|
Possible values are
|
|
|
|
<itemizedlist>
|
|
|
|
<listitem>
|
2003-04-15 15:23:35 +02:00
|
|
|
<para><literal>p</>: Value must always be stored plain.</para>
|
2000-11-29 21:15:59 +01:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2003-04-15 15:23:35 +02:00
|
|
|
<literal>e</>: Value can be stored in a <quote>secondary</quote>
|
2000-11-29 21:15:59 +01:00
|
|
|
relation (if relation has one, see
|
2003-04-15 15:23:35 +02:00
|
|
|
<literal>pg_class.reltoastrelid</literal>).
|
2000-11-29 21:15:59 +01:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2003-04-15 15:23:35 +02:00
|
|
|
<para><literal>m</>: Value can be stored compressed inline.</para>
|
2000-11-29 21:15:59 +01:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2003-04-15 15:23:35 +02:00
|
|
|
<para><literal>x</>: Value can be stored compressed inline or stored in <quote>secondary</quote> storage.</para>
|
2000-11-29 21:15:59 +01:00
|
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
2003-04-15 15:23:35 +02:00
|
|
|
Note that <literal>m</> columns can also be moved out to secondary
|
|
|
|
storage, but only as a last resort (<literal>e</> and <literal>x</> columns are
|
2000-11-29 21:15:59 +01:00
|
|
|
moved first).
|
|
|
|
</para></entry>
|
|
|
|
</row>
|
|
|
|
|
2002-03-19 03:18:25 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typnotnull</structfield></entry>
|
2002-03-20 20:45:13 +01:00
|
|
|
<entry><type>bool</type></entry>
|
2002-03-19 03:18:25 +01:00
|
|
|
<entry></entry>
|
|
|
|
<entry><para>
|
2003-04-15 15:23:35 +02:00
|
|
|
<structfield>typnotnull</structfield> represents a not-null
|
2010-08-17 06:37:21 +02:00
|
|
|
constraint on a type. Used for domains only.
|
2002-03-19 03:18:25 +01:00
|
|
|
</para></entry>
|
|
|
|
</row>
|
|
|
|
|
2002-03-20 20:45:13 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typbasetype</structfield></entry>
|
2002-03-20 20:45:13 +01:00
|
|
|
<entry><type>oid</type></entry>
|
2003-09-13 00:17:24 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
2002-03-20 20:45:13 +01:00
|
|
|
<entry><para>
|
2006-11-12 07:25:37 +01:00
|
|
|
If this is a domain (see <structfield>typtype</structfield>), then
|
|
|
|
<structfield>typbasetype</structfield> identifies the type that this
|
2010-08-17 06:37:21 +02:00
|
|
|
one is based on. Zero if this type is not a domain.
|
2002-03-20 20:45:13 +01:00
|
|
|
</para></entry>
|
|
|
|
</row>
|
2002-03-19 03:18:25 +01:00
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typtypmod</structfield></entry>
|
2002-03-20 20:45:13 +01:00
|
|
|
<entry><type>int4</type></entry>
|
2002-03-19 03:18:25 +01:00
|
|
|
<entry></entry>
|
|
|
|
<entry><para>
|
2003-04-15 15:23:35 +02:00
|
|
|
Domains use <structfield>typtypmod</structfield> to record the <literal>typmod</>
|
2002-09-24 23:26:44 +02:00
|
|
|
to be applied to their base type (-1 if base type does not use a
|
2010-08-17 06:37:21 +02:00
|
|
|
<literal>typmod</>). -1 if this type is not a domain.
|
2002-09-24 23:26:44 +02:00
|
|
|
</para></entry>
|
2002-03-20 20:45:13 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typndims</structfield></entry>
|
2002-03-20 20:45:13 +01:00
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry><para>
|
|
|
|
<structfield>typndims</structfield> is the number of array dimensions
|
Improve handling of domains over arrays.
This patch eliminates various bizarre behaviors caused by sloppy thinking
about the difference between a domain type and its underlying array type.
In particular, the operation of updating one element of such an array
has to be considered as yielding a value of the underlying array type,
*not* a value of the domain, because there's no assurance that the
domain's CHECK constraints are still satisfied. If we're intending to
store the result back into a domain column, we have to re-cast to the
domain type so that constraints are re-checked.
For similar reasons, such a domain can't be blindly matched to an ANYARRAY
polymorphic parameter, because the polymorphic function is likely to apply
array-ish operations that could invalidate the domain constraints. For the
moment, we just forbid such matching. We might later wish to insert an
automatic downcast to the underlying array type, but such a change should
also change matching of domains to ANYELEMENT for consistency.
To ensure that all such logic is rechecked, this patch removes the original
hack of setting a domain's pg_type.typelem field to match its base type;
the typelem will always be zero instead. In those places where it's really
okay to look through the domain type with no other logic changes, use the
newly added get_base_element_type function in place of get_element_type.
catversion bumped due to change in pg_type contents.
Per bug #5717 from Richard Huxton and subsequent discussion.
2010-10-21 22:07:17 +02:00
|
|
|
for a domain over an array (that is, <structfield>typbasetype</> is
|
|
|
|
an array type).
|
2010-08-17 06:37:21 +02:00
|
|
|
Zero for types other than domains over array types.
|
2002-03-19 03:18:25 +01:00
|
|
|
</para></entry>
|
|
|
|
</row>
|
|
|
|
|
2011-02-08 22:04:18 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>typcollation</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-collation"><structname>pg_collation</structname></link>.oid</literal></entry>
|
|
|
|
<entry><para>
|
|
|
|
<structfield>typcollation</structfield> specifies the collation
|
2011-03-08 23:10:34 +01:00
|
|
|
of the type. If the type does not support collations, this will
|
|
|
|
be zero. A base type that supports collations will have
|
|
|
|
<symbol>DEFAULT_COLLATION_OID</symbol> here. A domain over a
|
2011-04-22 23:43:18 +02:00
|
|
|
collatable type can have some other collation OID, if one was
|
|
|
|
specified for the domain.
|
2011-02-08 22:04:18 +01:00
|
|
|
</para></entry>
|
|
|
|
</row>
|
|
|
|
|
2002-03-19 03:18:25 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typdefaultbin</structfield></entry>
|
2010-09-03 03:34:55 +02:00
|
|
|
<entry><type>pg_node_tree</type></entry>
|
2002-03-19 03:18:25 +01:00
|
|
|
<entry></entry>
|
|
|
|
<entry><para>
|
2010-09-03 03:34:55 +02:00
|
|
|
If <structfield>typdefaultbin</> is not null, it is the
|
|
|
|
<function>nodeToString()</function>
|
2003-04-15 15:23:35 +02:00
|
|
|
representation of a default expression for the type. This is
|
2010-08-17 06:37:21 +02:00
|
|
|
only used for domains.
|
2002-03-19 03:18:25 +01:00
|
|
|
</para></entry>
|
|
|
|
</row>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
<row>
|
2003-04-15 15:23:35 +02:00
|
|
|
<entry><structfield>typdefault</structfield></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
2001-09-06 04:07:42 +02:00
|
|
|
<entry><para>
|
2003-04-15 15:23:35 +02:00
|
|
|
<structfield>typdefault</> is null if the type has no associated
|
|
|
|
default value. If <structfield>typdefaultbin</> is not null,
|
2002-03-20 20:45:13 +01:00
|
|
|
<structfield>typdefault</> must contain a human-readable version of the
|
|
|
|
default expression represented by <structfield>typdefaultbin</>. If
|
2003-04-15 15:23:35 +02:00
|
|
|
<structfield>typdefaultbin</> is null and <structfield>typdefault</> is
|
2002-03-20 20:45:13 +01:00
|
|
|
not, then <structfield>typdefault</> is the external representation of
|
2010-09-03 03:34:55 +02:00
|
|
|
the type's default value, which can be fed to the type's input
|
2010-08-17 06:37:21 +02:00
|
|
|
converter to produce a constant.
|
2001-09-06 04:07:42 +02:00
|
|
|
</para></entry>
|
2000-11-29 21:15:59 +01:00
|
|
|
</row>
|
2012-04-06 22:54:27 +02:00
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>typacl</structfield></entry>
|
|
|
|
<entry><type>aclitem[]</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
Access privileges; see
|
|
|
|
<xref linkend="sql-grant"> and
|
|
|
|
<xref linkend="sql-revoke">
|
|
|
|
for details
|
|
|
|
</entry>
|
|
|
|
</row>
|
2000-11-29 21:15:59 +01:00
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
Replace the hard-wired type knowledge in TypeCategory() and IsPreferredType()
with system catalog lookups, as was foreseen to be necessary almost since
their creation. Instead put the information into two new pg_type columns,
typcategory and typispreferred. Add support for setting these when
creating a user-defined base type.
The category column is just a "char" (i.e. a poor man's enum), allowing
a crude form of user extensibility of the category list: just use an
otherwise-unused character. This seems sufficient for foreseen uses,
but we could upgrade to having an actual category catalog someday, if
there proves to be a huge demand for custom type categories.
In this patch I have attempted to hew exactly to the behavior of the
previous hardwired logic, except for introducing new type categories for
arrays, composites, and enums. In particular the default preferred state
for user-defined types remains TRUE. That seems worth revisiting, but it
should be done as a separate patch from introducing the infrastructure.
Likewise, any adjustment of the standard set of categories should be done
separately.
2008-07-30 19:05:05 +02:00
|
|
|
|
|
|
|
<para>
|
|
|
|
<xref linkend="catalog-typcategory-table"> lists the system-defined values
|
|
|
|
of <structfield>typcategory</>. Any future additions to this list will
|
|
|
|
also be upper-case ASCII letters. All other ASCII characters are reserved
|
|
|
|
for user-defined categories.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table id="catalog-typcategory-table">
|
|
|
|
<title><structfield>typcategory</> Codes</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="2">
|
Replace the hard-wired type knowledge in TypeCategory() and IsPreferredType()
with system catalog lookups, as was foreseen to be necessary almost since
their creation. Instead put the information into two new pg_type columns,
typcategory and typispreferred. Add support for setting these when
creating a user-defined base type.
The category column is just a "char" (i.e. a poor man's enum), allowing
a crude form of user extensibility of the category list: just use an
otherwise-unused character. This seems sufficient for foreseen uses,
but we could upgrade to having an actual category catalog someday, if
there proves to be a huge demand for custom type categories.
In this patch I have attempted to hew exactly to the behavior of the
previous hardwired logic, except for introducing new type categories for
arrays, composites, and enums. In particular the default preferred state
for user-defined types remains TRUE. That seems worth revisiting, but it
should be done as a separate patch from introducing the infrastructure.
Likewise, any adjustment of the standard set of categories should be done
separately.
2008-07-30 19:05:05 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Code</entry>
|
|
|
|
<entry>Category</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><literal>A</literal></entry>
|
|
|
|
<entry>Array types</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>B</literal></entry>
|
|
|
|
<entry>Boolean types</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>C</literal></entry>
|
|
|
|
<entry>Composite types</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>D</literal></entry>
|
|
|
|
<entry>Date/time types</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>E</literal></entry>
|
|
|
|
<entry>Enum types</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>G</literal></entry>
|
|
|
|
<entry>Geometric types</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>I</literal></entry>
|
|
|
|
<entry>Network address types</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>N</literal></entry>
|
|
|
|
<entry>Numeric types</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>P</literal></entry>
|
|
|
|
<entry>Pseudo-types</entry>
|
|
|
|
</row>
|
2011-11-19 00:23:55 +01:00
|
|
|
<row>
|
|
|
|
<entry><literal>R</literal></entry>
|
|
|
|
<entry>Range types</entry>
|
|
|
|
</row>
|
Replace the hard-wired type knowledge in TypeCategory() and IsPreferredType()
with system catalog lookups, as was foreseen to be necessary almost since
their creation. Instead put the information into two new pg_type columns,
typcategory and typispreferred. Add support for setting these when
creating a user-defined base type.
The category column is just a "char" (i.e. a poor man's enum), allowing
a crude form of user extensibility of the category list: just use an
otherwise-unused character. This seems sufficient for foreseen uses,
but we could upgrade to having an actual category catalog someday, if
there proves to be a huge demand for custom type categories.
In this patch I have attempted to hew exactly to the behavior of the
previous hardwired logic, except for introducing new type categories for
arrays, composites, and enums. In particular the default preferred state
for user-defined types remains TRUE. That seems worth revisiting, but it
should be done as a separate patch from introducing the infrastructure.
Likewise, any adjustment of the standard set of categories should be done
separately.
2008-07-30 19:05:05 +02:00
|
|
|
<row>
|
|
|
|
<entry><literal>S</literal></entry>
|
|
|
|
<entry>String types</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>T</literal></entry>
|
|
|
|
<entry>Timespan types</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>U</literal></entry>
|
|
|
|
<entry>User-defined types</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>V</literal></entry>
|
|
|
|
<entry>Bit-string types</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><literal>X</literal></entry>
|
|
|
|
<entry><type>unknown</> type</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
2001-11-09 00:44:01 +01:00
|
|
|
</sect1>
|
2003-10-18 00:38:20 +02:00
|
|
|
|
2009-02-02 10:49:29 +01:00
|
|
|
|
|
|
|
<sect1 id="catalog-pg-user-mapping">
|
|
|
|
<title><structname>pg_user_mapping</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="catalog-pg-user-mapping">
|
|
|
|
<primary>pg_user_mapping</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The catalog <structname>pg_user_mapping</structname> stores
|
|
|
|
the mappings from local user to remote. Access to this catalog is
|
|
|
|
restricted from normal users, use the view
|
|
|
|
<link linkend="view-pg-user-mappings"><structname>pg_user_mappings</structname></link>
|
|
|
|
instead.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_user_mapping</> Columns</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2009-02-02 10:49:29 +01:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
2012-12-15 06:42:47 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Row identifier (hidden attribute; must be explicitly selected)</entry>
|
|
|
|
</row>
|
|
|
|
|
2009-02-02 10:49:29 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>umuser</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
|
|
|
|
<entry>OID of the local role being mapped, 0 if the user mapping is public</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>umserver</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-foreign-server"><structname>pg_foreign_server</structname></link>.oid</literal></entry>
|
|
|
|
<entry>
|
|
|
|
The OID of the foreign server that contains this mapping
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>umoptions</structfield></entry>
|
|
|
|
<entry><type>text[]</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2010-08-17 06:37:21 +02:00
|
|
|
User mapping specific options, as <quote>keyword=value</> strings
|
2009-02-02 10:49:29 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
2003-10-18 00:38:20 +02:00
|
|
|
<sect1 id="views-overview">
|
|
|
|
<title>System Views</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
In addition to the system catalogs, <productname>PostgreSQL</productname>
|
2005-01-06 00:42:03 +01:00
|
|
|
provides a number of built-in views. Some system views provide convenient
|
|
|
|
access to some commonly used queries on the system catalogs. Other views
|
|
|
|
provide access to internal server state.
|
2003-10-18 00:38:20 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The information schema (<xref linkend="information-schema">) provides
|
|
|
|
an alternative set of views which overlap the functionality of the system
|
|
|
|
views. Since the information schema is SQL-standard whereas the views
|
|
|
|
described here are <productname>PostgreSQL</productname>-specific,
|
|
|
|
it's usually better to use the information schema if it provides all
|
|
|
|
the information you need.
|
|
|
|
</para>
|
|
|
|
|
2005-01-06 00:42:03 +01:00
|
|
|
<para>
|
|
|
|
<xref linkend="view-table"> lists the system views described here.
|
|
|
|
More detailed documentation of each view follows below.
|
|
|
|
There are some additional views that provide access to the results of
|
|
|
|
the statistics collector; they are described in <xref
|
|
|
|
linkend="monitoring-stats-views-table">.
|
|
|
|
</para>
|
|
|
|
|
2003-10-18 00:38:20 +02:00
|
|
|
<para>
|
|
|
|
Except where noted, all the views described here are read-only.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table id="view-table">
|
|
|
|
<title>System Views</title>
|
|
|
|
|
|
|
|
<tgroup cols="2">
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>View Name</entry>
|
|
|
|
<entry>Purpose</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
2011-02-08 22:08:41 +01:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="view-pg-available-extensions"><structname>pg_available_extensions</structname></link></entry>
|
|
|
|
<entry>available extensions</entry>
|
|
|
|
</row>
|
|
|
|
|
2011-02-14 22:07:00 +01:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="view-pg-available-extension-versions"><structname>pg_available_extension_versions</structname></link></entry>
|
|
|
|
<entry>available versions of extensions</entry>
|
|
|
|
</row>
|
|
|
|
|
2006-01-18 07:49:30 +01:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="view-pg-cursors"><structname>pg_cursors</structname></link></entry>
|
|
|
|
<entry>open cursors</entry>
|
|
|
|
</row>
|
|
|
|
|
2015-06-12 05:59:29 +02:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="view-pg-file-settings"><structname>pg_file_settings</structname></link></entry>
|
Improve design and implementation of pg_file_settings view.
As first committed, this view reported on the file contents as they were
at the last SIGHUP event. That's not as useful as reporting on the current
contents, and what's more, it didn't work right on Windows unless the
current session had serviced at least one SIGHUP. Therefore, arrange to
re-read the files when pg_show_all_settings() is called. This requires
only minor refactoring so that we can pass changeVal = false to
set_config_option() so that it won't actually apply any changes locally.
In addition, add error reporting so that errors that would prevent the
configuration files from being loaded, or would prevent individual settings
from being applied, are visible directly in the view. This makes the view
usable for pre-testing whether edits made in the config files will have the
desired effect, before one actually issues a SIGHUP.
I also added an "applied" column so that it's easy to identify entries that
are superseded by later entries; this was the main use-case for the original
design, but it seemed unnecessarily hard to use for that.
Also fix a 9.4.1 regression that allowed multiple entries for a
PGC_POSTMASTER variable to cause bogus complaints in the postmaster log.
(The issue here was that commit bf007a27acd7b2fb unintentionally reverted
3e3f65973a3c94a6, which suppressed any duplicate entries within
ParseConfigFp. However, since the original coding of the pg_file_settings
view depended on such suppression *not* happening, we couldn't have fixed
this issue now without first doing something with pg_file_settings.
Now we suppress duplicates by marking them "ignored" within
ProcessConfigFileInternal, which doesn't hide them in the view.)
Lesser changes include:
Drive the view directly off the ConfigVariable list, instead of making a
basically-equivalent second copy of the data. There's no longer any need
to hang onto the data permanently, anyway.
Convert show_all_file_settings() to do its work in one call and return a
tuplestore; this avoids risks associated with assuming that the GUC state
will hold still over the course of query execution. (I think there were
probably latent bugs here, though you might need something like a cursor
on the view to expose them.)
Arrange to run SIGHUP processing in a short-lived memory context, to
forestall process-lifespan memory leaks. (There is one known leak in this
code, in ProcessConfigDirectory; it seems minor enough to not be worth
back-patching a specific fix for.)
Remove mistaken assignment to ConfigFileLineno that caused line counting
after an include_dir directive to be completely wrong.
Add missed failure check in AlterSystemSetConfigFile(). We don't really
expect ParseConfigFp() to fail, but that's not an excuse for not checking.
2015-06-29 00:06:14 +02:00
|
|
|
<entry>summary of configuration file contents</entry>
|
2015-06-12 05:59:29 +02:00
|
|
|
</row>
|
|
|
|
|
2005-06-28 07:09:14 +02:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="view-pg-group"><structname>pg_group</structname></link></entry>
|
|
|
|
<entry>groups of database users</entry>
|
|
|
|
</row>
|
|
|
|
|
2003-10-18 00:38:20 +02:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="view-pg-indexes"><structname>pg_indexes</structname></link></entry>
|
|
|
|
<entry>indexes</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><link linkend="view-pg-locks"><structname>pg_locks</structname></link></entry>
|
|
|
|
<entry>currently held locks</entry>
|
|
|
|
</row>
|
|
|
|
|
2013-03-06 22:35:59 +01:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="view-pg-matviews"><structname>pg_matviews</structname></link></entry>
|
|
|
|
<entry>materialized views</entry>
|
|
|
|
</row>
|
|
|
|
|
2014-10-03 22:31:53 +02:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="view-pg-policies"><structname>pg_policies</structname></link></entry>
|
|
|
|
<entry>policies</entry>
|
|
|
|
</row>
|
|
|
|
|
2006-01-08 08:00:27 +01:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="view-pg-prepared-statements"><structname>pg_prepared_statements</structname></link></entry>
|
2006-01-16 19:15:31 +01:00
|
|
|
<entry>prepared statements</entry>
|
2006-01-08 08:00:27 +01:00
|
|
|
</row>
|
|
|
|
|
2005-06-18 00:32:51 +02:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="view-pg-prepared-xacts"><structname>pg_prepared_xacts</structname></link></entry>
|
2006-01-16 19:15:31 +01:00
|
|
|
<entry>prepared transactions</entry>
|
2005-06-18 00:32:51 +02:00
|
|
|
</row>
|
|
|
|
|
2005-06-28 07:09:14 +02:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="view-pg-roles"><structname>pg_roles</structname></link></entry>
|
|
|
|
<entry>database roles</entry>
|
|
|
|
</row>
|
|
|
|
|
2003-10-18 00:38:20 +02:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="view-pg-rules"><structname>pg_rules</structname></link></entry>
|
|
|
|
<entry>rules</entry>
|
|
|
|
</row>
|
|
|
|
|
2010-09-28 02:55:27 +02:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="view-pg-seclabels"><structname>pg_seclabels</structname></link></entry>
|
|
|
|
<entry>security labels</entry>
|
|
|
|
</row>
|
|
|
|
|
2003-10-18 00:38:20 +02:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="view-pg-settings"><structname>pg_settings</structname></link></entry>
|
|
|
|
<entry>parameter settings</entry>
|
|
|
|
</row>
|
|
|
|
|
2005-06-28 07:09:14 +02:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="view-pg-shadow"><structname>pg_shadow</structname></link></entry>
|
|
|
|
<entry>database users</entry>
|
|
|
|
</row>
|
|
|
|
|
2003-10-18 00:38:20 +02:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="view-pg-stats"><structname>pg_stats</structname></link></entry>
|
|
|
|
<entry>planner statistics</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><link linkend="view-pg-tables"><structname>pg_tables</structname></link></entry>
|
|
|
|
<entry>tables</entry>
|
|
|
|
</row>
|
|
|
|
|
2006-07-25 05:51:23 +02:00
|
|
|
<row>
|
2006-09-16 22:14:34 +02:00
|
|
|
<entry><link linkend="view-pg-timezone-abbrevs"><structname>pg_timezone_abbrevs</structname></link></entry>
|
2006-07-25 05:51:23 +02:00
|
|
|
<entry>time zone abbreviations</entry>
|
|
|
|
</row>
|
|
|
|
|
2006-09-16 22:14:34 +02:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="view-pg-timezone-names"><structname>pg_timezone_names</structname></link></entry>
|
|
|
|
<entry>time zone names</entry>
|
|
|
|
</row>
|
|
|
|
|
2003-10-18 00:38:20 +02:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="view-pg-user"><structname>pg_user</structname></link></entry>
|
|
|
|
<entry>database users</entry>
|
|
|
|
</row>
|
|
|
|
|
2010-10-15 01:12:24 +02:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="view-pg-user-mappings"><structname>pg_user_mappings</structname></link></entry>
|
|
|
|
<entry>user mappings</entry>
|
|
|
|
</row>
|
|
|
|
|
2003-10-18 00:38:20 +02:00
|
|
|
<row>
|
|
|
|
<entry><link linkend="view-pg-views"><structname>pg_views</structname></link></entry>
|
|
|
|
<entry>views</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
</sect1>
|
|
|
|
|
2011-02-08 22:08:41 +01:00
|
|
|
<sect1 id="view-pg-available-extensions">
|
|
|
|
<title><structname>pg_available_extensions</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="view-pg-available-extensions">
|
|
|
|
<primary>pg_available_extensions</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The <structname>pg_available_extensions</structname> view lists the
|
2011-03-04 22:08:24 +01:00
|
|
|
extensions that are available for installation.
|
|
|
|
See also the
|
2011-02-08 22:08:41 +01:00
|
|
|
<link linkend="catalog-pg-extension"><structname>pg_extension</structname></link>
|
|
|
|
catalog, which shows the extensions currently installed.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_available_extensions</> Columns</title>
|
|
|
|
|
|
|
|
<tgroup cols="3">
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>name</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry>Extension name</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2011-02-14 22:07:00 +01:00
|
|
|
<entry><structfield>default_version</structfield></entry>
|
2011-02-08 22:08:41 +01:00
|
|
|
<entry><type>text</type></entry>
|
2011-02-14 22:07:00 +01:00
|
|
|
<entry>Name of default version, or <literal>NULL</literal> if none is
|
|
|
|
specified</entry>
|
2011-02-08 22:08:41 +01:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2011-02-14 22:07:00 +01:00
|
|
|
<entry><structfield>installed_version</structfield></entry>
|
2011-02-08 22:08:41 +01:00
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry>Currently installed version of the extension,
|
|
|
|
or <literal>NULL</literal> if not installed</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
2011-02-14 22:07:00 +01:00
|
|
|
<entry><structfield>comment</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry>Comment string from the extension's control file</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The <structname>pg_available_extensions</structname> view is read only.
|
|
|
|
</para>
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
<sect1 id="view-pg-available-extension-versions">
|
|
|
|
<title><structname>pg_available_extension_versions</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="view-pg-available-extension-versions">
|
|
|
|
<primary>pg_available_extension_versions</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The <structname>pg_available_extension_versions</structname> view lists the
|
2011-03-04 22:08:24 +01:00
|
|
|
specific extension versions that are available for installation.
|
|
|
|
See also the <link
|
2011-02-14 22:07:00 +01:00
|
|
|
linkend="catalog-pg-extension"><structname>pg_extension</structname></link>
|
|
|
|
catalog, which shows the extensions currently installed.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_available_extension_versions</> Columns</title>
|
|
|
|
|
|
|
|
<tgroup cols="3">
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>name</structfield></entry>
|
2011-02-08 22:08:41 +01:00
|
|
|
<entry><type>name</type></entry>
|
2011-02-14 22:07:00 +01:00
|
|
|
<entry>Extension name</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>version</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry>Version name</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>installed</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry>True if this version of this extension is currently
|
|
|
|
installed</entry>
|
2011-02-08 22:08:41 +01:00
|
|
|
</row>
|
|
|
|
|
2011-03-04 22:08:24 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>superuser</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry>True if only superusers are allowed to install this extension</entry>
|
|
|
|
</row>
|
|
|
|
|
2011-02-08 22:08:41 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>relocatable</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry>True if extension can be relocated to another schema</entry>
|
|
|
|
</row>
|
|
|
|
|
2011-02-14 22:07:00 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>schema</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry>Name of the schema that the extension must be installed into,
|
|
|
|
or <literal>NULL</literal> if partially or fully relocatable</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>requires</structfield></entry>
|
|
|
|
<entry><type>name[]</type></entry>
|
|
|
|
<entry>Names of prerequisite extensions,
|
|
|
|
or <literal>NULL</literal> if none</entry>
|
|
|
|
</row>
|
|
|
|
|
2011-02-08 22:08:41 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>comment</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry>Comment string from the extension's control file</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<para>
|
2011-02-14 22:07:00 +01:00
|
|
|
The <structname>pg_available_extension_versions</structname> view is read
|
|
|
|
only.
|
2011-02-08 22:08:41 +01:00
|
|
|
</para>
|
|
|
|
</sect1>
|
|
|
|
|
2006-01-18 07:49:30 +01:00
|
|
|
<sect1 id="view-pg-cursors">
|
|
|
|
<title><structname>pg_cursors</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="view-pg-cursors">
|
|
|
|
<primary>pg_cursors</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The <structname>pg_cursors</structname> view lists the cursors that
|
|
|
|
are currently available. Cursors can be defined in several ways:
|
|
|
|
<itemizedlist>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2010-04-03 09:23:02 +02:00
|
|
|
via the <xref linkend="sql-declare">
|
2006-01-18 07:49:30 +01:00
|
|
|
statement in SQL
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
via the Bind message in the frontend/backend protocol, as
|
|
|
|
described in <xref linkend="protocol-flow-ext-query">
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
via the Server Programming Interface (SPI), as described in
|
|
|
|
<xref linkend="spi-interface">
|
2006-01-21 20:05:59 +01:00
|
|
|
</para>
|
|
|
|
</listitem>
|
2006-01-18 07:49:30 +01:00
|
|
|
</itemizedlist>
|
|
|
|
|
|
|
|
The <structname>pg_cursors</structname> view displays cursors
|
|
|
|
created by any of these means. Cursors only exist for the duration
|
|
|
|
of the transaction that defines them, unless they have been
|
|
|
|
declared <literal>WITH HOLD</literal>. Therefore non-holdable
|
|
|
|
cursors are only present in the view until the end of their
|
|
|
|
creating transaction.
|
|
|
|
|
|
|
|
<note>
|
|
|
|
<para>
|
|
|
|
Cursors are used internally to implement some of the components
|
|
|
|
of <productname>PostgreSQL</>, such as procedural languages.
|
Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
Also update two error messages mentioned in the documenation to match.
2007-01-31 21:56:20 +01:00
|
|
|
Therefore, the <structname>pg_cursors</> view might include cursors
|
2006-01-18 07:49:30 +01:00
|
|
|
that have not been explicitly created by the user.
|
|
|
|
</para>
|
|
|
|
</note>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_cursors</> Columns</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="3">
|
2006-01-18 07:49:30 +01:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>name</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry>The name of the cursor</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>statement</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry>The verbatim query string submitted to declare this cursor</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>is_holdable</structfield></entry>
|
|
|
|
<entry><type>boolean</type></entry>
|
|
|
|
<entry>
|
|
|
|
<literal>true</literal> if the cursor is holdable (that is, it
|
|
|
|
can be accessed after the transaction that declared the cursor
|
|
|
|
has committed); <literal>false</literal> otherwise
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>is_binary</structfield></entry>
|
|
|
|
<entry><type>boolean</type></entry>
|
|
|
|
<entry>
|
|
|
|
<literal>true</literal> if the cursor was declared
|
|
|
|
<literal>BINARY</literal>; <literal>false</literal>
|
|
|
|
otherwise
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>is_scrollable</structfield></entry>
|
|
|
|
<entry><type>boolean</type></entry>
|
|
|
|
<entry>
|
|
|
|
<literal>true</> if the cursor is scrollable (that is, it
|
|
|
|
allows rows to be retrieved in a nonsequential manner);
|
|
|
|
<literal>false</literal> otherwise
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>creation_time</structfield></entry>
|
|
|
|
<entry><type>timestamptz</type></entry>
|
|
|
|
<entry>The time at which the cursor was declared</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The <structname>pg_cursors</structname> view is read only.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
2015-06-12 05:59:29 +02:00
|
|
|
<sect1 id="view-pg-file-settings">
|
|
|
|
<title><structname>pg_file_settings</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="view-pg-file-settings">
|
|
|
|
<primary>pg_file_settings</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
Improve design and implementation of pg_file_settings view.
As first committed, this view reported on the file contents as they were
at the last SIGHUP event. That's not as useful as reporting on the current
contents, and what's more, it didn't work right on Windows unless the
current session had serviced at least one SIGHUP. Therefore, arrange to
re-read the files when pg_show_all_settings() is called. This requires
only minor refactoring so that we can pass changeVal = false to
set_config_option() so that it won't actually apply any changes locally.
In addition, add error reporting so that errors that would prevent the
configuration files from being loaded, or would prevent individual settings
from being applied, are visible directly in the view. This makes the view
usable for pre-testing whether edits made in the config files will have the
desired effect, before one actually issues a SIGHUP.
I also added an "applied" column so that it's easy to identify entries that
are superseded by later entries; this was the main use-case for the original
design, but it seemed unnecessarily hard to use for that.
Also fix a 9.4.1 regression that allowed multiple entries for a
PGC_POSTMASTER variable to cause bogus complaints in the postmaster log.
(The issue here was that commit bf007a27acd7b2fb unintentionally reverted
3e3f65973a3c94a6, which suppressed any duplicate entries within
ParseConfigFp. However, since the original coding of the pg_file_settings
view depended on such suppression *not* happening, we couldn't have fixed
this issue now without first doing something with pg_file_settings.
Now we suppress duplicates by marking them "ignored" within
ProcessConfigFileInternal, which doesn't hide them in the view.)
Lesser changes include:
Drive the view directly off the ConfigVariable list, instead of making a
basically-equivalent second copy of the data. There's no longer any need
to hang onto the data permanently, anyway.
Convert show_all_file_settings() to do its work in one call and return a
tuplestore; this avoids risks associated with assuming that the GUC state
will hold still over the course of query execution. (I think there were
probably latent bugs here, though you might need something like a cursor
on the view to expose them.)
Arrange to run SIGHUP processing in a short-lived memory context, to
forestall process-lifespan memory leaks. (There is one known leak in this
code, in ProcessConfigDirectory; it seems minor enough to not be worth
back-patching a specific fix for.)
Remove mistaken assignment to ConfigFileLineno that caused line counting
after an include_dir directive to be completely wrong.
Add missed failure check in AlterSystemSetConfigFile(). We don't really
expect ParseConfigFp() to fail, but that's not an excuse for not checking.
2015-06-29 00:06:14 +02:00
|
|
|
The view <structname>pg_file_settings</structname> provides a summary of
|
|
|
|
the contents of the server's configuration file(s). A row appears in
|
|
|
|
this view for each <quote>name = value</> entry appearing in the files,
|
|
|
|
with annotations indicating whether the value could be applied
|
|
|
|
successfully. Additional row(s) may appear for problems not linked to
|
|
|
|
a <quote>name = value</> entry, such as syntax errors in the files.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
This view is helpful for checking whether planned changes in the
|
|
|
|
configuration files will work, or for diagnosing a previous failure.
|
|
|
|
Note that this view reports on the <emphasis>current</> contents of the
|
|
|
|
files, not on what was last applied by the server. (The
|
|
|
|
<link linkend="view-pg-settings"><structname>pg_settings</structname></link>
|
|
|
|
view is usually sufficient to determine that.)
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The <structname>pg_file_settings</structname> view can be read only by
|
|
|
|
superusers.
|
2015-06-12 05:59:29 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_file_settings</> Columns</title>
|
|
|
|
|
|
|
|
<tgroup cols="3">
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>sourcefile</structfield></entry>
|
|
|
|
<entry><structfield>text</structfield></entry>
|
2015-09-11 03:22:21 +02:00
|
|
|
<entry>Full path name of the configuration file</entry>
|
2015-06-12 05:59:29 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>sourceline</structfield></entry>
|
|
|
|
<entry><structfield>integer</structfield></entry>
|
|
|
|
<entry>
|
Improve design and implementation of pg_file_settings view.
As first committed, this view reported on the file contents as they were
at the last SIGHUP event. That's not as useful as reporting on the current
contents, and what's more, it didn't work right on Windows unless the
current session had serviced at least one SIGHUP. Therefore, arrange to
re-read the files when pg_show_all_settings() is called. This requires
only minor refactoring so that we can pass changeVal = false to
set_config_option() so that it won't actually apply any changes locally.
In addition, add error reporting so that errors that would prevent the
configuration files from being loaded, or would prevent individual settings
from being applied, are visible directly in the view. This makes the view
usable for pre-testing whether edits made in the config files will have the
desired effect, before one actually issues a SIGHUP.
I also added an "applied" column so that it's easy to identify entries that
are superseded by later entries; this was the main use-case for the original
design, but it seemed unnecessarily hard to use for that.
Also fix a 9.4.1 regression that allowed multiple entries for a
PGC_POSTMASTER variable to cause bogus complaints in the postmaster log.
(The issue here was that commit bf007a27acd7b2fb unintentionally reverted
3e3f65973a3c94a6, which suppressed any duplicate entries within
ParseConfigFp. However, since the original coding of the pg_file_settings
view depended on such suppression *not* happening, we couldn't have fixed
this issue now without first doing something with pg_file_settings.
Now we suppress duplicates by marking them "ignored" within
ProcessConfigFileInternal, which doesn't hide them in the view.)
Lesser changes include:
Drive the view directly off the ConfigVariable list, instead of making a
basically-equivalent second copy of the data. There's no longer any need
to hang onto the data permanently, anyway.
Convert show_all_file_settings() to do its work in one call and return a
tuplestore; this avoids risks associated with assuming that the GUC state
will hold still over the course of query execution. (I think there were
probably latent bugs here, though you might need something like a cursor
on the view to expose them.)
Arrange to run SIGHUP processing in a short-lived memory context, to
forestall process-lifespan memory leaks. (There is one known leak in this
code, in ProcessConfigDirectory; it seems minor enough to not be worth
back-patching a specific fix for.)
Remove mistaken assignment to ConfigFileLineno that caused line counting
after an include_dir directive to be completely wrong.
Add missed failure check in AlterSystemSetConfigFile(). We don't really
expect ParseConfigFp() to fail, but that's not an excuse for not checking.
2015-06-29 00:06:14 +02:00
|
|
|
Line number within the configuration file where the entry appears
|
2015-06-12 05:59:29 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>seqno</structfield></entry>
|
|
|
|
<entry><structfield>integer</structfield></entry>
|
Improve design and implementation of pg_file_settings view.
As first committed, this view reported on the file contents as they were
at the last SIGHUP event. That's not as useful as reporting on the current
contents, and what's more, it didn't work right on Windows unless the
current session had serviced at least one SIGHUP. Therefore, arrange to
re-read the files when pg_show_all_settings() is called. This requires
only minor refactoring so that we can pass changeVal = false to
set_config_option() so that it won't actually apply any changes locally.
In addition, add error reporting so that errors that would prevent the
configuration files from being loaded, or would prevent individual settings
from being applied, are visible directly in the view. This makes the view
usable for pre-testing whether edits made in the config files will have the
desired effect, before one actually issues a SIGHUP.
I also added an "applied" column so that it's easy to identify entries that
are superseded by later entries; this was the main use-case for the original
design, but it seemed unnecessarily hard to use for that.
Also fix a 9.4.1 regression that allowed multiple entries for a
PGC_POSTMASTER variable to cause bogus complaints in the postmaster log.
(The issue here was that commit bf007a27acd7b2fb unintentionally reverted
3e3f65973a3c94a6, which suppressed any duplicate entries within
ParseConfigFp. However, since the original coding of the pg_file_settings
view depended on such suppression *not* happening, we couldn't have fixed
this issue now without first doing something with pg_file_settings.
Now we suppress duplicates by marking them "ignored" within
ProcessConfigFileInternal, which doesn't hide them in the view.)
Lesser changes include:
Drive the view directly off the ConfigVariable list, instead of making a
basically-equivalent second copy of the data. There's no longer any need
to hang onto the data permanently, anyway.
Convert show_all_file_settings() to do its work in one call and return a
tuplestore; this avoids risks associated with assuming that the GUC state
will hold still over the course of query execution. (I think there were
probably latent bugs here, though you might need something like a cursor
on the view to expose them.)
Arrange to run SIGHUP processing in a short-lived memory context, to
forestall process-lifespan memory leaks. (There is one known leak in this
code, in ProcessConfigDirectory; it seems minor enough to not be worth
back-patching a specific fix for.)
Remove mistaken assignment to ConfigFileLineno that caused line counting
after an include_dir directive to be completely wrong.
Add missed failure check in AlterSystemSetConfigFile(). We don't really
expect ParseConfigFp() to fail, but that's not an excuse for not checking.
2015-06-29 00:06:14 +02:00
|
|
|
<entry>Order in which the entries are processed (1..<replaceable>n</>)</entry>
|
2015-06-12 05:59:29 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>name</structfield></entry>
|
|
|
|
<entry><structfield>text</structfield></entry>
|
Improve design and implementation of pg_file_settings view.
As first committed, this view reported on the file contents as they were
at the last SIGHUP event. That's not as useful as reporting on the current
contents, and what's more, it didn't work right on Windows unless the
current session had serviced at least one SIGHUP. Therefore, arrange to
re-read the files when pg_show_all_settings() is called. This requires
only minor refactoring so that we can pass changeVal = false to
set_config_option() so that it won't actually apply any changes locally.
In addition, add error reporting so that errors that would prevent the
configuration files from being loaded, or would prevent individual settings
from being applied, are visible directly in the view. This makes the view
usable for pre-testing whether edits made in the config files will have the
desired effect, before one actually issues a SIGHUP.
I also added an "applied" column so that it's easy to identify entries that
are superseded by later entries; this was the main use-case for the original
design, but it seemed unnecessarily hard to use for that.
Also fix a 9.4.1 regression that allowed multiple entries for a
PGC_POSTMASTER variable to cause bogus complaints in the postmaster log.
(The issue here was that commit bf007a27acd7b2fb unintentionally reverted
3e3f65973a3c94a6, which suppressed any duplicate entries within
ParseConfigFp. However, since the original coding of the pg_file_settings
view depended on such suppression *not* happening, we couldn't have fixed
this issue now without first doing something with pg_file_settings.
Now we suppress duplicates by marking them "ignored" within
ProcessConfigFileInternal, which doesn't hide them in the view.)
Lesser changes include:
Drive the view directly off the ConfigVariable list, instead of making a
basically-equivalent second copy of the data. There's no longer any need
to hang onto the data permanently, anyway.
Convert show_all_file_settings() to do its work in one call and return a
tuplestore; this avoids risks associated with assuming that the GUC state
will hold still over the course of query execution. (I think there were
probably latent bugs here, though you might need something like a cursor
on the view to expose them.)
Arrange to run SIGHUP processing in a short-lived memory context, to
forestall process-lifespan memory leaks. (There is one known leak in this
code, in ProcessConfigDirectory; it seems minor enough to not be worth
back-patching a specific fix for.)
Remove mistaken assignment to ConfigFileLineno that caused line counting
after an include_dir directive to be completely wrong.
Add missed failure check in AlterSystemSetConfigFile(). We don't really
expect ParseConfigFp() to fail, but that's not an excuse for not checking.
2015-06-29 00:06:14 +02:00
|
|
|
<entry>Configuration parameter name</entry>
|
2015-06-12 05:59:29 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>setting</structfield></entry>
|
|
|
|
<entry><structfield>text</structfield></entry>
|
Improve design and implementation of pg_file_settings view.
As first committed, this view reported on the file contents as they were
at the last SIGHUP event. That's not as useful as reporting on the current
contents, and what's more, it didn't work right on Windows unless the
current session had serviced at least one SIGHUP. Therefore, arrange to
re-read the files when pg_show_all_settings() is called. This requires
only minor refactoring so that we can pass changeVal = false to
set_config_option() so that it won't actually apply any changes locally.
In addition, add error reporting so that errors that would prevent the
configuration files from being loaded, or would prevent individual settings
from being applied, are visible directly in the view. This makes the view
usable for pre-testing whether edits made in the config files will have the
desired effect, before one actually issues a SIGHUP.
I also added an "applied" column so that it's easy to identify entries that
are superseded by later entries; this was the main use-case for the original
design, but it seemed unnecessarily hard to use for that.
Also fix a 9.4.1 regression that allowed multiple entries for a
PGC_POSTMASTER variable to cause bogus complaints in the postmaster log.
(The issue here was that commit bf007a27acd7b2fb unintentionally reverted
3e3f65973a3c94a6, which suppressed any duplicate entries within
ParseConfigFp. However, since the original coding of the pg_file_settings
view depended on such suppression *not* happening, we couldn't have fixed
this issue now without first doing something with pg_file_settings.
Now we suppress duplicates by marking them "ignored" within
ProcessConfigFileInternal, which doesn't hide them in the view.)
Lesser changes include:
Drive the view directly off the ConfigVariable list, instead of making a
basically-equivalent second copy of the data. There's no longer any need
to hang onto the data permanently, anyway.
Convert show_all_file_settings() to do its work in one call and return a
tuplestore; this avoids risks associated with assuming that the GUC state
will hold still over the course of query execution. (I think there were
probably latent bugs here, though you might need something like a cursor
on the view to expose them.)
Arrange to run SIGHUP processing in a short-lived memory context, to
forestall process-lifespan memory leaks. (There is one known leak in this
code, in ProcessConfigDirectory; it seems minor enough to not be worth
back-patching a specific fix for.)
Remove mistaken assignment to ConfigFileLineno that caused line counting
after an include_dir directive to be completely wrong.
Add missed failure check in AlterSystemSetConfigFile(). We don't really
expect ParseConfigFp() to fail, but that's not an excuse for not checking.
2015-06-29 00:06:14 +02:00
|
|
|
<entry>Value to be assigned to the parameter</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>applied</structfield></entry>
|
|
|
|
<entry><structfield>boolean</structfield></entry>
|
|
|
|
<entry>True if the value can be applied successfully</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>error</structfield></entry>
|
|
|
|
<entry><structfield>text</structfield></entry>
|
|
|
|
<entry>If not null, an error message indicating why this entry could
|
|
|
|
not be applied</entry>
|
2015-06-12 05:59:29 +02:00
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
Improve design and implementation of pg_file_settings view.
As first committed, this view reported on the file contents as they were
at the last SIGHUP event. That's not as useful as reporting on the current
contents, and what's more, it didn't work right on Windows unless the
current session had serviced at least one SIGHUP. Therefore, arrange to
re-read the files when pg_show_all_settings() is called. This requires
only minor refactoring so that we can pass changeVal = false to
set_config_option() so that it won't actually apply any changes locally.
In addition, add error reporting so that errors that would prevent the
configuration files from being loaded, or would prevent individual settings
from being applied, are visible directly in the view. This makes the view
usable for pre-testing whether edits made in the config files will have the
desired effect, before one actually issues a SIGHUP.
I also added an "applied" column so that it's easy to identify entries that
are superseded by later entries; this was the main use-case for the original
design, but it seemed unnecessarily hard to use for that.
Also fix a 9.4.1 regression that allowed multiple entries for a
PGC_POSTMASTER variable to cause bogus complaints in the postmaster log.
(The issue here was that commit bf007a27acd7b2fb unintentionally reverted
3e3f65973a3c94a6, which suppressed any duplicate entries within
ParseConfigFp. However, since the original coding of the pg_file_settings
view depended on such suppression *not* happening, we couldn't have fixed
this issue now without first doing something with pg_file_settings.
Now we suppress duplicates by marking them "ignored" within
ProcessConfigFileInternal, which doesn't hide them in the view.)
Lesser changes include:
Drive the view directly off the ConfigVariable list, instead of making a
basically-equivalent second copy of the data. There's no longer any need
to hang onto the data permanently, anyway.
Convert show_all_file_settings() to do its work in one call and return a
tuplestore; this avoids risks associated with assuming that the GUC state
will hold still over the course of query execution. (I think there were
probably latent bugs here, though you might need something like a cursor
on the view to expose them.)
Arrange to run SIGHUP processing in a short-lived memory context, to
forestall process-lifespan memory leaks. (There is one known leak in this
code, in ProcessConfigDirectory; it seems minor enough to not be worth
back-patching a specific fix for.)
Remove mistaken assignment to ConfigFileLineno that caused line counting
after an include_dir directive to be completely wrong.
Add missed failure check in AlterSystemSetConfigFile(). We don't really
expect ParseConfigFp() to fail, but that's not an excuse for not checking.
2015-06-29 00:06:14 +02:00
|
|
|
</table>
|
2015-06-12 05:59:29 +02:00
|
|
|
|
|
|
|
<para>
|
Improve design and implementation of pg_file_settings view.
As first committed, this view reported on the file contents as they were
at the last SIGHUP event. That's not as useful as reporting on the current
contents, and what's more, it didn't work right on Windows unless the
current session had serviced at least one SIGHUP. Therefore, arrange to
re-read the files when pg_show_all_settings() is called. This requires
only minor refactoring so that we can pass changeVal = false to
set_config_option() so that it won't actually apply any changes locally.
In addition, add error reporting so that errors that would prevent the
configuration files from being loaded, or would prevent individual settings
from being applied, are visible directly in the view. This makes the view
usable for pre-testing whether edits made in the config files will have the
desired effect, before one actually issues a SIGHUP.
I also added an "applied" column so that it's easy to identify entries that
are superseded by later entries; this was the main use-case for the original
design, but it seemed unnecessarily hard to use for that.
Also fix a 9.4.1 regression that allowed multiple entries for a
PGC_POSTMASTER variable to cause bogus complaints in the postmaster log.
(The issue here was that commit bf007a27acd7b2fb unintentionally reverted
3e3f65973a3c94a6, which suppressed any duplicate entries within
ParseConfigFp. However, since the original coding of the pg_file_settings
view depended on such suppression *not* happening, we couldn't have fixed
this issue now without first doing something with pg_file_settings.
Now we suppress duplicates by marking them "ignored" within
ProcessConfigFileInternal, which doesn't hide them in the view.)
Lesser changes include:
Drive the view directly off the ConfigVariable list, instead of making a
basically-equivalent second copy of the data. There's no longer any need
to hang onto the data permanently, anyway.
Convert show_all_file_settings() to do its work in one call and return a
tuplestore; this avoids risks associated with assuming that the GUC state
will hold still over the course of query execution. (I think there were
probably latent bugs here, though you might need something like a cursor
on the view to expose them.)
Arrange to run SIGHUP processing in a short-lived memory context, to
forestall process-lifespan memory leaks. (There is one known leak in this
code, in ProcessConfigDirectory; it seems minor enough to not be worth
back-patching a specific fix for.)
Remove mistaken assignment to ConfigFileLineno that caused line counting
after an include_dir directive to be completely wrong.
Add missed failure check in AlterSystemSetConfigFile(). We don't really
expect ParseConfigFp() to fail, but that's not an excuse for not checking.
2015-06-29 00:06:14 +02:00
|
|
|
If the configuration file contains syntax errors or invalid parameter
|
|
|
|
names, the server will not attempt to apply any settings from it, and
|
|
|
|
therefore all the <structfield>applied</> fields will read as false.
|
|
|
|
In such a case there will be one or more rows with
|
|
|
|
non-null <structfield>error</structfield> fields indicating the
|
|
|
|
problem(s). Otherwise, individual settings will be applied if possible.
|
|
|
|
If an individual setting cannot be applied (e.g., invalid value, or the
|
|
|
|
setting cannot be changed after server start) it will have an appropriate
|
|
|
|
message in the <structfield>error</structfield> field. Another way that
|
|
|
|
an entry might have <structfield>applied</> = false is that it is
|
|
|
|
overridden by a later entry for the same parameter name; this case is not
|
|
|
|
considered an error so nothing appears in
|
|
|
|
the <structfield>error</structfield> field.
|
2015-06-12 05:59:29 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
Improve design and implementation of pg_file_settings view.
As first committed, this view reported on the file contents as they were
at the last SIGHUP event. That's not as useful as reporting on the current
contents, and what's more, it didn't work right on Windows unless the
current session had serviced at least one SIGHUP. Therefore, arrange to
re-read the files when pg_show_all_settings() is called. This requires
only minor refactoring so that we can pass changeVal = false to
set_config_option() so that it won't actually apply any changes locally.
In addition, add error reporting so that errors that would prevent the
configuration files from being loaded, or would prevent individual settings
from being applied, are visible directly in the view. This makes the view
usable for pre-testing whether edits made in the config files will have the
desired effect, before one actually issues a SIGHUP.
I also added an "applied" column so that it's easy to identify entries that
are superseded by later entries; this was the main use-case for the original
design, but it seemed unnecessarily hard to use for that.
Also fix a 9.4.1 regression that allowed multiple entries for a
PGC_POSTMASTER variable to cause bogus complaints in the postmaster log.
(The issue here was that commit bf007a27acd7b2fb unintentionally reverted
3e3f65973a3c94a6, which suppressed any duplicate entries within
ParseConfigFp. However, since the original coding of the pg_file_settings
view depended on such suppression *not* happening, we couldn't have fixed
this issue now without first doing something with pg_file_settings.
Now we suppress duplicates by marking them "ignored" within
ProcessConfigFileInternal, which doesn't hide them in the view.)
Lesser changes include:
Drive the view directly off the ConfigVariable list, instead of making a
basically-equivalent second copy of the data. There's no longer any need
to hang onto the data permanently, anyway.
Convert show_all_file_settings() to do its work in one call and return a
tuplestore; this avoids risks associated with assuming that the GUC state
will hold still over the course of query execution. (I think there were
probably latent bugs here, though you might need something like a cursor
on the view to expose them.)
Arrange to run SIGHUP processing in a short-lived memory context, to
forestall process-lifespan memory leaks. (There is one known leak in this
code, in ProcessConfigDirectory; it seems minor enough to not be worth
back-patching a specific fix for.)
Remove mistaken assignment to ConfigFileLineno that caused line counting
after an include_dir directive to be completely wrong.
Add missed failure check in AlterSystemSetConfigFile(). We don't really
expect ParseConfigFp() to fail, but that's not an excuse for not checking.
2015-06-29 00:06:14 +02:00
|
|
|
See <xref linkend="config-setting"> for more information about the various
|
|
|
|
ways to change run-time parameters.
|
2015-06-12 05:59:29 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
2005-06-28 07:09:14 +02:00
|
|
|
<sect1 id="view-pg-group">
|
|
|
|
<title><structname>pg_group</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="view-pg-group">
|
|
|
|
<primary>pg_group</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The view <structname>pg_group</structname> exists for backwards
|
|
|
|
compatibility: it emulates a catalog that existed in
|
|
|
|
<productname>PostgreSQL</productname> before version 8.1.
|
|
|
|
It shows the names and members of all roles that are marked as not
|
|
|
|
<structfield>rolcanlogin</>, which is an approximation to the set
|
|
|
|
of roles that are being used as groups.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_group</> Columns</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2005-06-28 07:09:14 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>groname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.rolname</literal></entry>
|
|
|
|
<entry>Name of the group</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>grosysid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
|
|
|
|
<entry>ID of this group</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>grolist</structfield></entry>
|
|
|
|
<entry><type>oid[]</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
|
|
|
|
<entry>An array containing the IDs of the roles in this group</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
2003-10-18 00:38:20 +02:00
|
|
|
<sect1 id="view-pg-indexes">
|
|
|
|
<title><structname>pg_indexes</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="view-pg-indexes">
|
|
|
|
<primary>pg_indexes</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The view <structname>pg_indexes</structname> provides access to
|
|
|
|
useful information about each index in the database.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_indexes</> Columns</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2003-10-18 00:38:20 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>schemaname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.nspname</literal></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>Name of schema containing table and index</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>tablename</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relname</literal></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>Name of table the index is for</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>indexname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relname</literal></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>Name of index</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
2004-10-11 19:24:41 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>tablespace</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-tablespace"><structname>pg_tablespace</structname></link>.spcname</literal></entry>
|
2010-08-17 06:37:21 +02:00
|
|
|
<entry>Name of tablespace containing index (null if default for database)</entry>
|
2004-10-11 19:24:41 +02:00
|
|
|
</row>
|
2003-10-18 00:38:20 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>indexdef</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>Index definition (a reconstructed <command>CREATE INDEX</command>
|
|
|
|
command)</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
<sect1 id="view-pg-locks">
|
|
|
|
<title><structname>pg_locks</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="view-pg-locks">
|
|
|
|
<primary>pg_locks</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The view <structname>pg_locks</structname> provides access to
|
|
|
|
information about the locks held by open transactions within the
|
|
|
|
database server. See <xref linkend="mvcc"> for more discussion
|
|
|
|
of locking.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<structname>pg_locks</structname> contains one row per active lockable
|
|
|
|
object, requested lock mode, and relevant transaction. Thus, the same
|
Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
Also update two error messages mentioned in the documenation to match.
2007-01-31 21:56:20 +01:00
|
|
|
lockable object might
|
2003-10-18 00:38:20 +02:00
|
|
|
appear many times, if multiple transactions are holding or waiting
|
|
|
|
for locks on it. However, an object that currently has no locks on it
|
2005-05-17 23:46:11 +02:00
|
|
|
will not appear at all.
|
2003-10-18 00:38:20 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2005-05-17 23:46:11 +02:00
|
|
|
There are several distinct types of lockable objects:
|
|
|
|
whole relations (e.g., tables), individual pages of relations,
|
|
|
|
individual tuples of relations,
|
2007-09-05 20:10:48 +02:00
|
|
|
transaction IDs (both virtual and permanent IDs),
|
2005-05-17 23:46:11 +02:00
|
|
|
and general database objects (identified by class OID and object OID,
|
|
|
|
in the same way as in <structname>pg_description</structname> or
|
|
|
|
<structname>pg_depend</structname>). Also, the right to extend a
|
|
|
|
relation is represented as a separate lockable object.
|
2011-11-28 19:51:58 +01:00
|
|
|
Also, <quote>advisory</> locks can be taken on numbers that have
|
|
|
|
user-defined meanings.
|
2003-10-18 00:38:20 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_locks</> Columns</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2003-10-18 00:38:20 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
2005-05-17 23:46:11 +02:00
|
|
|
<entry><structfield>locktype</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
<entry>
|
2010-08-17 06:37:21 +02:00
|
|
|
Type of the lockable object:
|
2005-05-17 23:46:11 +02:00
|
|
|
<literal>relation</>,
|
|
|
|
<literal>extend</>,
|
|
|
|
<literal>page</>,
|
|
|
|
<literal>tuple</>,
|
2005-06-18 21:33:42 +02:00
|
|
|
<literal>transactionid</>,
|
2007-09-05 20:10:48 +02:00
|
|
|
<literal>virtualxid</>,
|
2006-09-23 01:20:14 +02:00
|
|
|
<literal>object</>,
|
|
|
|
<literal>userlock</>, or
|
|
|
|
<literal>advisory</>
|
2003-10-18 00:38:20 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>database</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-database"><structname>pg_database</structname></link>.oid</literal></entry>
|
|
|
|
<entry>
|
2011-07-15 19:12:36 +02:00
|
|
|
OID of the database in which the lock target exists, or
|
|
|
|
zero if the target is a shared object, or
|
|
|
|
null if the target is a transaction ID
|
2005-05-17 23:46:11 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>relation</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
|
|
|
<entry>
|
2011-07-15 19:12:36 +02:00
|
|
|
OID of the relation targeted by the lock, or null if the target is not
|
|
|
|
a relation or part of a relation
|
2005-05-17 23:46:11 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>page</structfield></entry>
|
|
|
|
<entry><type>integer</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2011-07-15 19:12:36 +02:00
|
|
|
Page number targeted by the lock within the relation,
|
|
|
|
or null if the target is not a relation page or tuple
|
2005-05-17 23:46:11 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>tuple</structfield></entry>
|
|
|
|
<entry><type>smallint</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2011-07-15 19:12:36 +02:00
|
|
|
Tuple number targeted by the lock within the page,
|
|
|
|
or null if the target is not a tuple
|
2003-10-18 00:38:20 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
2007-09-05 20:10:48 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>virtualxid</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2011-07-15 19:12:36 +02:00
|
|
|
Virtual ID of the transaction targeted by the lock,
|
|
|
|
or null if the target is not a virtual transaction ID
|
2007-09-05 20:10:48 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
2003-10-18 00:38:20 +02:00
|
|
|
<row>
|
2005-06-18 21:33:42 +02:00
|
|
|
<entry><structfield>transactionid</structfield></entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
<entry><type>xid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2011-07-15 19:12:36 +02:00
|
|
|
ID of the transaction targeted by the lock,
|
|
|
|
or null if the target is not a transaction ID
|
2005-05-17 23:46:11 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>classid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
|
|
|
<entry>
|
2011-07-15 19:12:36 +02:00
|
|
|
OID of the system catalog containing the lock target, or null if the
|
|
|
|
target is not a general database object
|
2005-05-17 23:46:11 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>objid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry>any OID column</entry>
|
|
|
|
<entry>
|
2011-07-15 19:12:36 +02:00
|
|
|
OID of the lock target within its system catalog, or null if the
|
2011-11-28 19:51:58 +01:00
|
|
|
target is not a general database object
|
2005-05-17 23:46:11 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>objsubid</structfield></entry>
|
|
|
|
<entry><type>smallint</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2011-07-15 19:12:36 +02:00
|
|
|
Column number targeted by the lock (the
|
2005-05-17 23:46:11 +02:00
|
|
|
<structfield>classid</> and <structfield>objid</> refer to the
|
2011-07-15 19:12:36 +02:00
|
|
|
table itself),
|
|
|
|
or zero if the target is some other general database object,
|
|
|
|
or null if the target is not a general database object
|
2003-10-18 00:38:20 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
2005-06-18 21:33:42 +02:00
|
|
|
<row>
|
2007-09-05 20:10:48 +02:00
|
|
|
<entry><structfield>virtualtransaction</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
2005-06-18 21:33:42 +02:00
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2007-09-05 20:10:48 +02:00
|
|
|
Virtual ID of the transaction that is holding or awaiting this lock
|
2005-06-18 21:33:42 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
2003-10-18 00:38:20 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>pid</structfield></entry>
|
|
|
|
<entry><type>integer</type></entry>
|
|
|
|
<entry></entry>
|
2005-06-18 00:32:51 +02:00
|
|
|
<entry>
|
|
|
|
Process ID of the server process holding or awaiting this
|
2011-11-28 19:51:58 +01:00
|
|
|
lock, or null if the lock is held by a prepared transaction
|
2005-06-18 00:32:51 +02:00
|
|
|
</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>mode</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>Name of the lock mode held or desired by this process (see <xref
|
Implement genuine serializable isolation level.
Until now, our Serializable mode has in fact been what's called Snapshot
Isolation, which allows some anomalies that could not occur in any
serialized ordering of the transactions. This patch fixes that using a
method called Serializable Snapshot Isolation, based on research papers by
Michael J. Cahill (see README-SSI for full references). In Serializable
Snapshot Isolation, transactions run like they do in Snapshot Isolation,
but a predicate lock manager observes the reads and writes performed and
aborts transactions if it detects that an anomaly might occur. This method
produces some false positives, ie. it sometimes aborts transactions even
though there is no anomaly.
To track reads we implement predicate locking, see storage/lmgr/predicate.c.
Whenever a tuple is read, a predicate lock is acquired on the tuple. Shared
memory is finite, so when a transaction takes many tuple-level locks on a
page, the locks are promoted to a single page-level lock, and further to a
single relation level lock if necessary. To lock key values with no matching
tuple, a sequential scan always takes a relation-level lock, and an index
scan acquires a page-level lock that covers the search key, whether or not
there are any matching keys at the moment.
A predicate lock doesn't conflict with any regular locks or with another
predicate locks in the normal sense. They're only used by the predicate lock
manager to detect the danger of anomalies. Only serializable transactions
participate in predicate locking, so there should be no extra overhead for
for other transactions.
Predicate locks can't be released at commit, but must be remembered until
all the transactions that overlapped with it have completed. That means that
we need to remember an unbounded amount of predicate locks, so we apply a
lossy but conservative method of tracking locks for committed transactions.
If we run short of shared memory, we overflow to a new "pg_serial" SLRU
pool.
We don't currently allow Serializable transactions in Hot Standby mode.
That would be hard, because even read-only transactions can cause anomalies
that wouldn't otherwise occur.
Serializable isolation mode now means the new fully serializable level.
Repeatable Read gives you the old Snapshot Isolation level that we have
always had.
Kevin Grittner and Dan Ports, reviewed by Jeff Davis, Heikki Linnakangas and
Anssi Kääriäinen
2011-02-07 22:46:51 +01:00
|
|
|
linkend="locking-tables"> and <xref linkend="xact-serializable">)</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>granted</structfield></entry>
|
|
|
|
<entry><type>boolean</type></entry>
|
|
|
|
<entry></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>True if lock is held, false if lock is awaited</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
2011-05-29 01:52:00 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>fastpath</structfield></entry>
|
|
|
|
<entry><type>boolean</type></entry>
|
|
|
|
<entry></entry>
|
2011-11-28 19:51:58 +01:00
|
|
|
<entry>True if lock was taken via fast path, false if taken via main
|
|
|
|
lock table</entry>
|
2011-05-29 01:52:00 +02:00
|
|
|
</row>
|
2003-10-18 00:38:20 +02:00
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<structfield>granted</structfield> is true in a row representing a lock
|
2005-06-18 21:33:42 +02:00
|
|
|
held by the indicated transaction. False indicates that this transaction is
|
2003-10-18 00:38:20 +02:00
|
|
|
currently waiting to acquire this lock, which implies that some other
|
2005-06-18 21:33:42 +02:00
|
|
|
transaction is holding a conflicting lock mode on the same lockable object.
|
|
|
|
The waiting transaction will sleep until the other lock is released (or a
|
|
|
|
deadlock situation is detected). A single transaction can be waiting to
|
|
|
|
acquire at most one lock at a time.
|
2003-10-18 00:38:20 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2007-09-05 20:10:48 +02:00
|
|
|
Every transaction holds an exclusive lock on its virtual transaction ID for
|
|
|
|
its entire duration. If a permanent ID is assigned to the transaction
|
|
|
|
(which normally happens only if the transaction changes the state of the
|
|
|
|
database), it also holds an exclusive lock on its permanent transaction ID
|
|
|
|
until it ends. When one transaction finds it necessary to wait specifically
|
2003-10-18 00:38:20 +02:00
|
|
|
for another transaction, it does so by attempting to acquire share lock on
|
2007-09-05 20:10:48 +02:00
|
|
|
the other transaction ID (either virtual or permanent ID depending on the
|
|
|
|
situation). That will succeed only when the other transaction
|
Replace the hard-wired type knowledge in TypeCategory() and IsPreferredType()
with system catalog lookups, as was foreseen to be necessary almost since
their creation. Instead put the information into two new pg_type columns,
typcategory and typispreferred. Add support for setting these when
creating a user-defined base type.
The category column is just a "char" (i.e. a poor man's enum), allowing
a crude form of user extensibility of the category list: just use an
otherwise-unused character. This seems sufficient for foreseen uses,
but we could upgrade to having an actual category catalog someday, if
there proves to be a huge demand for custom type categories.
In this patch I have attempted to hew exactly to the behavior of the
previous hardwired logic, except for introducing new type categories for
arrays, composites, and enums. In particular the default preferred state
for user-defined types remains TRUE. That seems worth revisiting, but it
should be done as a separate patch from introducing the infrastructure.
Likewise, any adjustment of the standard set of categories should be done
separately.
2008-07-30 19:05:05 +02:00
|
|
|
terminates and releases its locks.
|
2003-10-18 00:38:20 +02:00
|
|
|
</para>
|
|
|
|
|
2005-05-17 23:46:11 +02:00
|
|
|
<para>
|
|
|
|
Although tuples are a lockable type of object,
|
|
|
|
information about row-level locks is stored on disk, not in memory,
|
|
|
|
and therefore row-level locks normally do not appear in this view.
|
|
|
|
If a transaction is waiting for a
|
|
|
|
row-level lock, it will usually appear in the view as waiting for the
|
2007-09-05 20:10:48 +02:00
|
|
|
permanent transaction ID of the current holder of that row lock.
|
2005-05-17 23:46:11 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2006-09-23 01:20:14 +02:00
|
|
|
Advisory locks can be acquired on keys consisting of either a single
|
2011-11-28 19:51:58 +01:00
|
|
|
<type>bigint</type> value or two integer values.
|
|
|
|
A <type>bigint</type> key is displayed with its
|
2006-09-19 00:40:40 +02:00
|
|
|
high-order half in the <structfield>classid</> column, its low-order half
|
|
|
|
in the <structfield>objid</> column, and <structfield>objsubid</> equal
|
2012-08-28 04:36:37 +02:00
|
|
|
to 1. The original <type>bigint</type> value can be reassembled with the
|
2012-08-28 18:17:11 +02:00
|
|
|
expression <literal>(classid::bigint << 32) |
|
|
|
|
objid::bigint</literal>. Integer keys are displayed with the
|
2012-08-28 04:36:37 +02:00
|
|
|
first key in the
|
2006-09-19 00:40:40 +02:00
|
|
|
<structfield>classid</> column, the second key in the <structfield>objid</>
|
|
|
|
column, and <structfield>objsubid</> equal to 2. The actual meaning of
|
2006-09-23 01:20:14 +02:00
|
|
|
the keys is up to the user. Advisory locks are local to each database,
|
|
|
|
so the <structfield>database</> column is meaningful for an advisory lock.
|
2005-05-17 23:46:11 +02:00
|
|
|
</para>
|
|
|
|
|
2003-10-18 00:38:20 +02:00
|
|
|
<para>
|
|
|
|
<structname>pg_locks</structname> provides a global view of all locks
|
|
|
|
in the database cluster, not only those relevant to the current database.
|
|
|
|
Although its <structfield>relation</structfield> column can be joined
|
|
|
|
against <structname>pg_class</>.<structfield>oid</> to identify locked
|
|
|
|
relations, this will only work correctly for relations in the current
|
|
|
|
database (those for which the <structfield>database</structfield> column
|
|
|
|
is either the current database's OID or zero).
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2007-09-05 20:10:48 +02:00
|
|
|
The <structfield>pid</structfield> column can be joined to the
|
2014-04-03 20:18:25 +02:00
|
|
|
<structfield>pid</structfield> column of the <link
|
|
|
|
linkend="pg-stat-activity-view"><structname>pg_stat_activity</structname></link>
|
|
|
|
view to get more
|
|
|
|
information on the session holding or waiting to hold each lock,
|
|
|
|
for example
|
|
|
|
<programlisting>
|
|
|
|
SELECT * FROM pg_locks pl LEFT JOIN pg_stat_activity psa
|
|
|
|
ON pl.pid = psa.pid;
|
|
|
|
</programlisting>
|
2005-06-18 21:33:42 +02:00
|
|
|
Also, if you are using prepared transactions, the
|
2014-04-03 20:18:25 +02:00
|
|
|
<structfield>virtualtransaction</> column can be joined to the
|
|
|
|
<structfield>transaction</structfield> column of the <link
|
|
|
|
linkend="view-pg-prepared-xacts"><structname>pg_prepared_xacts</structname></link>
|
|
|
|
view to get more information on prepared transactions that hold locks.
|
2005-06-18 21:33:42 +02:00
|
|
|
(A prepared transaction can never be waiting for a lock,
|
|
|
|
but it continues to hold the locks it acquired while running.)
|
2014-04-03 20:18:25 +02:00
|
|
|
For example:
|
|
|
|
<programlisting>
|
|
|
|
SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
|
|
|
|
ON pl.virtualtransaction = '-1/' || ppx.transaction;
|
|
|
|
</programlisting>
|
2003-10-18 00:38:20 +02:00
|
|
|
</para>
|
|
|
|
|
2011-11-28 19:51:58 +01:00
|
|
|
<para>
|
|
|
|
The <structname>pg_locks</structname> view displays data from both the
|
|
|
|
regular lock manager and the predicate lock manager, which are
|
|
|
|
separate systems; in addition, the regular lock manager subdivides its
|
|
|
|
locks into regular and <firstterm>fast-path</> locks.
|
|
|
|
This data is not guaranteed to be entirely consistent.
|
|
|
|
When the view is queried,
|
|
|
|
data on fast-path locks (with <structfield>fastpath</> = <literal>true</>)
|
|
|
|
is gathered from each backend one at a time, without freezing the state of
|
|
|
|
the entire lock manager, so it is possible for locks to be taken or
|
|
|
|
released while information is gathered. Note, however, that these locks are
|
|
|
|
known not to conflict with any other lock currently in place. After
|
|
|
|
all backends have been queried for fast-path locks, the remainder of the
|
|
|
|
regular lock manager is locked as a unit, and a consistent snapshot of all
|
|
|
|
remaining locks is collected as an atomic action. After unlocking the
|
|
|
|
regular lock manager, the predicate lock manager is similarly locked and all
|
|
|
|
predicate locks are collected as an atomic action. Thus, with the exception
|
|
|
|
of fast-path locks, each lock manager will deliver a consistent set of
|
|
|
|
results, but as we do not lock both lock managers simultaneously, it is
|
|
|
|
possible for locks to be taken or released after we interrogate the regular
|
|
|
|
lock manager and before we interrogate the predicate lock manager.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Locking the regular and/or predicate lock manager could have some
|
|
|
|
impact on database performance if this view is very frequently accessed.
|
|
|
|
The locks are held only for the minimum amount of time necessary to
|
|
|
|
obtain data from the lock managers, but this does not completely eliminate
|
|
|
|
the possibility of a performance impact.
|
|
|
|
</para>
|
|
|
|
|
2003-10-18 00:38:20 +02:00
|
|
|
</sect1>
|
|
|
|
|
2013-03-06 22:35:59 +01:00
|
|
|
<sect1 id="view-pg-matviews">
|
|
|
|
<title><structname>pg_matviews</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="view-pg-matviews">
|
|
|
|
<primary>pg_matviews</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<indexterm zone="view-pg-matviews">
|
|
|
|
<primary>materialized views</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The view <structname>pg_matviews</structname> provides access to
|
|
|
|
useful information about each materialized view in the database.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_matviews</> 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>schemaname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.nspname</literal></entry>
|
|
|
|
<entry>Name of schema containing materialized view</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>matviewname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relname</literal></entry>
|
|
|
|
<entry>Name of materialized view</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>matviewowner</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.rolname</literal></entry>
|
|
|
|
<entry>Name of materialized view's owner</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>tablespace</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-tablespace"><structname>pg_tablespace</structname></link>.spcname</literal></entry>
|
|
|
|
<entry>Name of tablespace containing materialized view (null if default for database)</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>hasindexes</structfield></entry>
|
|
|
|
<entry><type>boolean</type></entry>
|
2013-05-06 19:26:51 +02:00
|
|
|
<entry></entry>
|
2013-03-06 22:35:59 +01:00
|
|
|
<entry>True if materialized view has (or recently had) any indexes</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
2013-05-06 19:26:51 +02:00
|
|
|
<entry><structfield>ispopulated</structfield></entry>
|
2013-03-06 22:35:59 +01:00
|
|
|
<entry><type>boolean</type></entry>
|
|
|
|
<entry></entry>
|
2013-05-06 19:26:51 +02:00
|
|
|
<entry>True if materialized view is currently populated</entry>
|
2013-03-06 22:35:59 +01:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>definition</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Materialized view definition (a reconstructed <command>SELECT</command> query)</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
2014-10-03 22:31:53 +02:00
|
|
|
<sect1 id="view-pg-policies">
|
|
|
|
<title><structname>pg_policies</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="view-pg-policies">
|
|
|
|
<primary>pg_policies</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The view <structname>pg_policies</structname> provides access to
|
2015-01-24 22:16:22 +01:00
|
|
|
useful information about each row-level security policy in the database.
|
2014-10-03 22:31:53 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_policies</> 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>schemaname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.nspname</literal></entry>
|
|
|
|
<entry>Name of schema containing table policy is on</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>tablename</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relname</literal></entry>
|
|
|
|
<entry>Name of table policy is on</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>policyname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
2015-01-24 22:16:22 +01:00
|
|
|
<entry><literal><link linkend="catalog-pg-policy"><structname>pg_policy</structname></link>.polname</literal></entry>
|
2014-10-03 22:31:53 +02:00
|
|
|
<entry>Name of policy</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
2015-01-24 22:16:22 +01:00
|
|
|
<entry><structfield>roles</structfield></entry>
|
|
|
|
<entry><type>name[]</type></entry>
|
2014-10-03 22:31:53 +02:00
|
|
|
<entry></entry>
|
2015-01-24 22:16:22 +01:00
|
|
|
<entry>The roles to which this policy applies</entry>
|
2014-10-03 22:31:53 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
2015-01-24 22:16:22 +01:00
|
|
|
<entry><structfield>cmd</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
2014-10-03 22:31:53 +02:00
|
|
|
<entry></entry>
|
2015-01-24 22:16:22 +01:00
|
|
|
<entry>The command type to which the policy is applied</entry>
|
2014-10-03 22:31:53 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>qual</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>The expression added to the security barrier qualifications for
|
2015-01-24 22:16:22 +01:00
|
|
|
queries that this policy applies to</entry>
|
2014-10-03 22:31:53 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>with_check</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
2015-01-24 22:16:22 +01:00
|
|
|
<entry>The expression added to the WITH CHECK qualifications for
|
|
|
|
queries that attempt to add rows to this table</entry>
|
2014-10-03 22:31:53 +02:00
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
2006-01-08 08:00:27 +01:00
|
|
|
<sect1 id="view-pg-prepared-statements">
|
|
|
|
<title><structname>pg_prepared_statements</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="view-pg-prepared-statements">
|
|
|
|
<primary>pg_prepared_statements</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The <structname>pg_prepared_statements</structname> view displays
|
|
|
|
all the prepared statements that are available in the current
|
2010-04-03 09:23:02 +02:00
|
|
|
session. See <xref linkend="sql-prepare"> for more information about prepared
|
2006-01-08 08:00:27 +01:00
|
|
|
statements.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<structname>pg_prepared_statements</structname> contains one row
|
|
|
|
for each prepared statement. Rows are added to the view when a new
|
2006-01-16 19:15:31 +01:00
|
|
|
prepared statement is created and removed when a prepared statement
|
2010-04-03 09:23:02 +02:00
|
|
|
is released (for example, via the <xref linkend="sql-deallocate"> command).
|
2006-01-08 08:00:27 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_prepared_statements</> Columns</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="3">
|
2006-01-08 08:00:27 +01:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>name</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry>
|
2006-01-16 19:15:31 +01:00
|
|
|
The identifier of the prepared statement
|
2006-01-08 08:00:27 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>statement</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry>
|
|
|
|
The query string submitted by the client to create this
|
|
|
|
prepared statement. For prepared statements created via SQL,
|
|
|
|
this is the <command>PREPARE</command> statement submitted by
|
|
|
|
the client. For prepared statements created via the
|
|
|
|
frontend/backend protocol, this is the text of the prepared
|
2010-08-17 06:37:21 +02:00
|
|
|
statement itself.
|
2006-01-08 08:00:27 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>prepare_time</structfield></entry>
|
|
|
|
<entry><type>timestamptz</type></entry>
|
|
|
|
<entry>
|
2006-01-16 19:15:31 +01:00
|
|
|
The time at which the prepared statement was created
|
2006-01-08 08:00:27 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>parameter_types</structfield></entry>
|
2006-01-16 19:15:31 +01:00
|
|
|
<entry><type>regtype[]</type></entry>
|
2006-01-08 08:00:27 +01:00
|
|
|
<entry>
|
2006-01-16 19:15:31 +01:00
|
|
|
The expected parameter types for the prepared statement in the
|
|
|
|
form of an array of <type>regtype</type>. The OID corresponding
|
|
|
|
to an element of this array can be obtained by casting the
|
2010-08-17 06:37:21 +02:00
|
|
|
<type>regtype</type> value to <type>oid</type>.
|
2006-01-08 08:00:27 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>from_sql</structfield></entry>
|
|
|
|
<entry><type>boolean</type></entry>
|
|
|
|
<entry>
|
|
|
|
<literal>true</literal> if the prepared statement was created
|
|
|
|
via the <command>PREPARE</command> SQL statement;
|
|
|
|
<literal>false</literal> if the statement was prepared via the
|
2006-01-16 19:15:31 +01:00
|
|
|
frontend/backend protocol
|
2006-01-08 08:00:27 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The <structname>pg_prepared_statements</structname> view is read only.
|
|
|
|
</para>
|
|
|
|
</sect1>
|
|
|
|
|
2005-06-18 00:32:51 +02:00
|
|
|
<sect1 id="view-pg-prepared-xacts">
|
|
|
|
<title><structname>pg_prepared_xacts</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="view-pg-prepared-xacts">
|
|
|
|
<primary>pg_prepared_xacts</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The view <structname>pg_prepared_xacts</structname> displays
|
|
|
|
information about transactions that are currently prepared for two-phase
|
2010-04-03 09:23:02 +02:00
|
|
|
commit (see <xref linkend="sql-prepare-transaction"> for details).
|
2005-06-18 00:32:51 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<structname>pg_prepared_xacts</structname> contains one row per prepared
|
|
|
|
transaction. An entry is removed when the transaction is committed or
|
|
|
|
rolled back.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_prepared_xacts</> Columns</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2005-06-18 00:32:51 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>transaction</structfield></entry>
|
|
|
|
<entry><type>xid</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
Numeric transaction identifier of the prepared transaction
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>gid</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
Global transaction identifier that was assigned to the transaction
|
|
|
|
</entry>
|
|
|
|
</row>
|
2005-06-18 21:33:42 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>prepared</structfield></entry>
|
|
|
|
<entry><type>timestamp with time zone</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
Time at which the transaction was prepared for commit
|
|
|
|
</entry>
|
|
|
|
</row>
|
2005-06-18 00:32:51 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>owner</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
2005-06-28 07:09:14 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.rolname</literal></entry>
|
2005-06-18 00:32:51 +02:00
|
|
|
<entry>
|
|
|
|
Name of the user that executed the transaction
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>database</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-database"><structname>pg_database</structname></link>.datname</literal></entry>
|
|
|
|
<entry>
|
|
|
|
Name of the database in which the transaction was executed
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
When the <structname>pg_prepared_xacts</structname> view is accessed, the
|
|
|
|
internal transaction manager data structures are momentarily locked, and
|
|
|
|
a copy is made for the view to display. This ensures that the
|
|
|
|
view produces a consistent set of results, while not blocking
|
|
|
|
normal operations longer than necessary. Nonetheless
|
|
|
|
there could be some impact on database performance if this view is
|
2006-11-12 07:25:37 +01:00
|
|
|
frequently accessed.
|
2005-06-18 00:32:51 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
2005-06-28 07:09:14 +02:00
|
|
|
<sect1 id="view-pg-roles">
|
|
|
|
<title><structname>pg_roles</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="view-pg-roles">
|
|
|
|
<primary>pg_roles</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The view <structname>pg_roles</structname> provides access to
|
|
|
|
information about database roles. This is simply a publicly
|
Replace the hard-wired type knowledge in TypeCategory() and IsPreferredType()
with system catalog lookups, as was foreseen to be necessary almost since
their creation. Instead put the information into two new pg_type columns,
typcategory and typispreferred. Add support for setting these when
creating a user-defined base type.
The category column is just a "char" (i.e. a poor man's enum), allowing
a crude form of user extensibility of the category list: just use an
otherwise-unused character. This seems sufficient for foreseen uses,
but we could upgrade to having an actual category catalog someday, if
there proves to be a huge demand for custom type categories.
In this patch I have attempted to hew exactly to the behavior of the
previous hardwired logic, except for introducing new type categories for
arrays, composites, and enums. In particular the default preferred state
for user-defined types remains TRUE. That seems worth revisiting, but it
should be done as a separate patch from introducing the infrastructure.
Likewise, any adjustment of the standard set of categories should be done
separately.
2008-07-30 19:05:05 +02:00
|
|
|
readable view of
|
2005-06-28 07:09:14 +02:00
|
|
|
<link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>
|
|
|
|
that blanks out the password field.
|
|
|
|
</para>
|
|
|
|
|
2005-07-26 18:38:29 +02:00
|
|
|
<para>
|
|
|
|
This view explicitly exposes the OID column of the underlying table,
|
|
|
|
since that is needed to do joins to other catalogs.
|
|
|
|
</para>
|
|
|
|
|
2005-06-28 07:09:14 +02:00
|
|
|
<table>
|
|
|
|
<title><structname>pg_roles</> Columns</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2005-06-28 07:09:14 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>rolname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Role name</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>rolsuper</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Role has superuser privileges</entry>
|
|
|
|
</row>
|
|
|
|
|
2005-07-26 18:38:29 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>rolinherit</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Role automatically inherits privileges of roles it is a
|
|
|
|
member of</entry>
|
|
|
|
</row>
|
|
|
|
|
2005-06-28 07:09:14 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>rolcreaterole</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
Also update two error messages mentioned in the documenation to match.
2007-01-31 21:56:20 +01:00
|
|
|
<entry>Role can create more roles</entry>
|
2005-06-28 07:09:14 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>rolcreatedb</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
Also update two error messages mentioned in the documenation to match.
2007-01-31 21:56:20 +01:00
|
|
|
<entry>Role can create databases</entry>
|
2005-06-28 07:09:14 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>rolcanlogin</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
Also update two error messages mentioned in the documenation to match.
2007-01-31 21:56:20 +01:00
|
|
|
Role can log in. That is, this role can be given as the initial
|
2006-11-12 07:25:37 +01:00
|
|
|
session authorization identifier
|
2005-06-28 07:09:14 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2011-07-04 04:12:14 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>rolreplication</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
Role is a replication role. That is, this role can initiate streaming
|
|
|
|
replication (see <xref linkend="streaming-replication">) and set/unset
|
|
|
|
the system backup mode using <function>pg_start_backup</> and
|
|
|
|
<function>pg_stop_backup</>
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2005-07-31 19:19:22 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>rolconnlimit</structfield></entry>
|
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
Replace the hard-wired type knowledge in TypeCategory() and IsPreferredType()
with system catalog lookups, as was foreseen to be necessary almost since
their creation. Instead put the information into two new pg_type columns,
typcategory and typispreferred. Add support for setting these when
creating a user-defined base type.
The category column is just a "char" (i.e. a poor man's enum), allowing
a crude form of user extensibility of the category list: just use an
otherwise-unused character. This seems sufficient for foreseen uses,
but we could upgrade to having an actual category catalog someday, if
there proves to be a huge demand for custom type categories.
In this patch I have attempted to hew exactly to the behavior of the
previous hardwired logic, except for introducing new type categories for
arrays, composites, and enums. In particular the default preferred state
for user-defined types remains TRUE. That seems worth revisiting, but it
should be done as a separate patch from introducing the infrastructure.
Likewise, any adjustment of the standard set of categories should be done
separately.
2008-07-30 19:05:05 +02:00
|
|
|
For roles that can log in, this sets maximum number of concurrent
|
2010-08-17 06:37:21 +02:00
|
|
|
connections this role can make. -1 means no limit.
|
2005-07-31 19:19:22 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2005-06-28 07:09:14 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>rolpassword</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Not the password (always reads as <literal>********</>)</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>rolvaliduntil</structfield></entry>
|
|
|
|
<entry><type>timestamptz</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Password expiry time (only used for password authentication);
|
2010-08-17 06:37:21 +02:00
|
|
|
null if no expiration</entry>
|
2005-06-28 07:09:14 +02:00
|
|
|
</row>
|
2011-07-04 04:12:14 +02:00
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>rolconfig</structfield></entry>
|
|
|
|
<entry><type>text[]</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Role-specific defaults for run-time configuration variables</entry>
|
|
|
|
</row>
|
2005-06-28 07:09:14 +02:00
|
|
|
|
2005-07-26 18:38:29 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>oid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
|
|
|
|
<entry>ID of role</entry>
|
|
|
|
</row>
|
2005-06-28 07:09:14 +02:00
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
2003-10-18 00:38:20 +02:00
|
|
|
<sect1 id="view-pg-rules">
|
|
|
|
<title><structname>pg_rules</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="view-pg-rules">
|
|
|
|
<primary>pg_rules</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The view <structname>pg_rules</structname> provides access to
|
|
|
|
useful information about query rewrite rules.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_rules</> Columns</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2003-10-18 00:38:20 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>schemaname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.nspname</literal></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>Name of schema containing table</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>tablename</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relname</literal></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>Name of table the rule is for</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>rulename</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-rewrite"><structname>pg_rewrite</structname></link>.rulename</literal></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>Name of rule</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>definition</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>Rule definition (a reconstructed creation command)</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<para>
|
2006-11-12 07:25:37 +01:00
|
|
|
The <structname>pg_rules</> view excludes the <literal>ON SELECT</> rules
|
2013-03-06 22:35:59 +01:00
|
|
|
of views and materialized views; those can be seen in
|
|
|
|
<structname>pg_views</> and <structname>pg_matviews</>.
|
2003-10-18 00:38:20 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
2010-09-28 02:55:27 +02:00
|
|
|
<sect1 id="view-pg-seclabels">
|
|
|
|
<title><structname>pg_seclabels</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="view-pg-seclabels">
|
|
|
|
<primary>pg_seclabels</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The view <structname>pg_seclabels</structname> provides information about
|
|
|
|
security labels. It as an easier-to-query version of the
|
|
|
|
<link linkend="catalog-pg-seclabel"><structname>pg_seclabel</></> catalog.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_seclabels</> 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>objoid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry>any OID column</entry>
|
|
|
|
<entry>The OID of the object this security label pertains to</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>classoid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
|
|
|
|
<entry>The OID of the system catalog this object appears in</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>objsubid</structfield></entry>
|
|
|
|
<entry><type>int4</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
For a security label on a table column, this is the column number (the
|
|
|
|
<structfield>objoid</> and <structfield>classoid</> refer to
|
|
|
|
the table itself). For all other object types, this column is
|
|
|
|
zero.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>objtype</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
The type of object to which this label applies, as text.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>objnamespace</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 for this object, if applicable;
|
|
|
|
otherwise NULL.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>objname</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
The name of the object to which this label applies, as text.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>provider</structfield></entry>
|
2015-05-19 16:40:04 +02:00
|
|
|
<entry><type>text</type></entry>
|
2010-09-28 02:55:27 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-seclabel"><structname>pg_seclabel</structname></link>.provider</literal></entry>
|
|
|
|
<entry>The label provider associated with this label.</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>label</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-seclabel"><structname>pg_seclabel</structname></link>.label</literal></entry>
|
|
|
|
<entry>The security label applied to this object.</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
</sect1>
|
|
|
|
|
2003-10-18 00:38:20 +02:00
|
|
|
<sect1 id="view-pg-settings">
|
|
|
|
<title><structname>pg_settings</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="view-pg-settings">
|
|
|
|
<primary>pg_settings</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The view <structname>pg_settings</structname> provides access to
|
|
|
|
run-time parameters of the server. It is essentially an alternative
|
2010-04-03 09:23:02 +02:00
|
|
|
interface to the <xref linkend="sql-show">
|
|
|
|
and <xref linkend="sql-set"> commands.
|
2003-10-18 00:38:20 +02:00
|
|
|
It also provides access to some facts about each parameter that are
|
|
|
|
not directly available from <command>SHOW</>, such as minimum and
|
|
|
|
maximum values.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_settings</> Columns</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="3">
|
2003-10-18 00:38:20 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>name</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>Run-time configuration parameter name</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>setting</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>Current value of the parameter</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
2006-07-27 10:30:41 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>unit</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>Implicit unit of the parameter</entry>
|
2006-07-27 10:30:41 +02:00
|
|
|
</row>
|
2003-12-07 00:10:23 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>category</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>Logical group of the parameter</entry>
|
2003-12-07 00:10:23 +01:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>short_desc</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>A brief description of the parameter</entry>
|
2003-12-07 00:10:23 +01:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>extra_desc</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
2008-10-06 15:59:37 +02:00
|
|
|
<entry>Additional, more detailed, description of the parameter</entry>
|
2003-12-07 00:10:23 +01:00
|
|
|
</row>
|
2003-10-18 00:38:20 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>context</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
2011-03-17 05:26:03 +01:00
|
|
|
<entry>Context required to set the parameter's value (see below)</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>vartype</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
2008-03-10 13:55:13 +01:00
|
|
|
<entry>Parameter type (<literal>bool</>, <literal>enum</>,
|
|
|
|
<literal>integer</>, <literal>real</>, or <literal>string</>)
|
2003-10-18 00:38:20 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>source</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>Source of the current parameter value</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>min_val</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
2010-08-17 06:37:21 +02:00
|
|
|
<entry>Minimum allowed value of the parameter (null for non-numeric
|
2003-10-18 00:38:20 +02:00
|
|
|
values)</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>max_val</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
2010-08-17 06:37:21 +02:00
|
|
|
<entry>Maximum allowed value of the parameter (null for non-numeric
|
2003-10-18 00:38:20 +02:00
|
|
|
values)</entry>
|
|
|
|
</row>
|
2008-03-10 13:55:13 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>enumvals</structfield></entry>
|
2008-11-21 20:31:58 +01:00
|
|
|
<entry><type>text[]</type></entry>
|
2010-08-17 06:37:21 +02:00
|
|
|
<entry>Allowed values of an enum parameter (null for non-enum
|
2008-03-10 13:55:13 +01:00
|
|
|
values)</entry>
|
|
|
|
</row>
|
2008-10-06 15:05:40 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>boot_val</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry>Parameter value assumed at server startup if the parameter is
|
|
|
|
not otherwise set</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>reset_val</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
2008-10-06 15:59:37 +02:00
|
|
|
<entry>Value that <command>RESET</command> would reset the parameter to
|
|
|
|
in the current session</entry>
|
2008-10-06 15:05:40 +02:00
|
|
|
</row>
|
2008-09-10 20:09:20 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>sourcefile</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
2010-08-17 06:37:21 +02:00
|
|
|
<entry>Configuration file the current value was set in (null for
|
2008-10-06 15:59:37 +02:00
|
|
|
values set from sources other than configuration files, or when
|
2010-08-17 06:37:21 +02:00
|
|
|
examined by a non-superuser);
|
|
|
|
helpful when using <literal>include</> directives in configuration files</entry>
|
2008-09-10 20:09:20 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>sourceline</structfield></entry>
|
2008-10-06 15:59:37 +02:00
|
|
|
<entry><type>integer</type></entry>
|
|
|
|
<entry>Line number within the configuration file the current value was
|
2010-08-17 06:37:21 +02:00
|
|
|
set at (null for values set from sources other than configuration files,
|
2008-10-06 15:59:37 +02:00
|
|
|
or when examined by a non-superuser)
|
2008-09-10 20:09:20 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
2015-05-15 02:08:51 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>pending_restart</structfield></entry>
|
|
|
|
<entry><type>boolean</type></entry>
|
|
|
|
<entry><literal>true</literal> if the value has been changed in the
|
|
|
|
configuration file but needs a restart; or <literal>false</literal>
|
|
|
|
otherwise.
|
|
|
|
</entry>
|
|
|
|
</row>
|
2003-10-18 00:38:20 +02:00
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
Replace the hard-wired type knowledge in TypeCategory() and IsPreferredType()
with system catalog lookups, as was foreseen to be necessary almost since
their creation. Instead put the information into two new pg_type columns,
typcategory and typispreferred. Add support for setting these when
creating a user-defined base type.
The category column is just a "char" (i.e. a poor man's enum), allowing
a crude form of user extensibility of the category list: just use an
otherwise-unused character. This seems sufficient for foreseen uses,
but we could upgrade to having an actual category catalog someday, if
there proves to be a huge demand for custom type categories.
In this patch I have attempted to hew exactly to the behavior of the
previous hardwired logic, except for introducing new type categories for
arrays, composites, and enums. In particular the default preferred state
for user-defined types remains TRUE. That seems worth revisiting, but it
should be done as a separate patch from introducing the infrastructure.
Likewise, any adjustment of the standard set of categories should be done
separately.
2008-07-30 19:05:05 +02:00
|
|
|
|
2011-03-17 05:26:03 +01:00
|
|
|
<para>
|
|
|
|
There are several possible values of <structfield>context</structfield>.
|
|
|
|
In order of decreasing difficulty of changing the setting, they are:
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
2015-03-15 17:45:35 +01:00
|
|
|
<!-- PGC_INTERNAL -->
|
2011-03-17 05:26:03 +01:00
|
|
|
<term><literal>internal</literal></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
These settings cannot be changed directly; they reflect internally
|
|
|
|
determined values. Some of them may be adjustable by rebuilding the
|
|
|
|
server with different configuration options, or by changing options
|
|
|
|
supplied to <command>initdb</command>.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
2015-03-15 17:45:35 +01:00
|
|
|
<!-- PGC_POSTMASTER -->
|
2011-03-17 05:26:03 +01:00
|
|
|
<term><literal>postmaster</literal></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
These settings can only be applied when the server starts, so any change
|
|
|
|
requires restarting the server. Values for these settings are typically
|
|
|
|
stored in the <filename>postgresql.conf</filename> file, or passed on
|
|
|
|
the command line when starting the server. Of course, settings with any
|
|
|
|
of the lower <structfield>context</structfield> types can also be
|
|
|
|
set at server start time.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
2015-03-15 17:45:35 +01:00
|
|
|
<!-- PGC_SIGHUP -->
|
2011-03-17 05:26:03 +01:00
|
|
|
<term><literal>sighup</literal></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Changes to these settings can be made in
|
|
|
|
<filename>postgresql.conf</filename> without restarting the server.
|
|
|
|
Send a <systemitem>SIGHUP</systemitem> signal to the postmaster to
|
|
|
|
cause it to re-read <filename>postgresql.conf</filename> and apply
|
|
|
|
the changes. The postmaster will also forward the
|
|
|
|
<systemitem>SIGHUP</systemitem> signal to its child processes so that
|
|
|
|
they all pick up the new value.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
2015-03-15 17:45:35 +01:00
|
|
|
<!-- PGC_SU_BACKEND -->
|
|
|
|
<term><literal>superuser-backend</literal></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Changes to these settings can be made in
|
|
|
|
<filename>postgresql.conf</filename> without restarting the server.
|
|
|
|
They can also be set for a particular session in the connection request
|
|
|
|
packet (for example, via <application>libpq</>'s <literal>PGOPTIONS</>
|
|
|
|
environment variable), but only if the connecting user is a superuser.
|
|
|
|
However, these settings never change in a session after it is started.
|
|
|
|
If you change them in <filename>postgresql.conf</filename>, send a
|
|
|
|
<systemitem>SIGHUP</systemitem> signal to the postmaster to cause it to
|
|
|
|
re-read <filename>postgresql.conf</filename>. The new values will only
|
|
|
|
affect subsequently-launched sessions.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<!-- PGC_BACKEND -->
|
2011-03-17 05:26:03 +01:00
|
|
|
<term><literal>backend</literal></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Changes to these settings can be made in
|
2015-03-15 17:45:35 +01:00
|
|
|
<filename>postgresql.conf</filename> without restarting the server.
|
|
|
|
They can also be set for a particular session in the connection request
|
2011-03-17 05:26:03 +01:00
|
|
|
packet (for example, via <application>libpq</>'s <literal>PGOPTIONS</>
|
2015-09-22 04:57:29 +02:00
|
|
|
environment variable); any user can make such a change for their session.
|
2015-03-15 17:45:35 +01:00
|
|
|
However, these settings never change in a session after it is started.
|
|
|
|
If you change them in <filename>postgresql.conf</filename>, send a
|
2011-03-17 05:26:03 +01:00
|
|
|
<systemitem>SIGHUP</systemitem> signal to the postmaster to cause it to
|
|
|
|
re-read <filename>postgresql.conf</filename>. The new values will only
|
|
|
|
affect subsequently-launched sessions.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
2015-03-15 17:45:35 +01:00
|
|
|
<!-- PGC_SUSET -->
|
2011-03-17 05:26:03 +01:00
|
|
|
<term><literal>superuser</literal></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
These settings can be set from <filename>postgresql.conf</filename>,
|
|
|
|
or within a session via the <command>SET</> command; but only superusers
|
|
|
|
can change them via <command>SET</>. Changes in
|
|
|
|
<filename>postgresql.conf</filename> will affect existing sessions
|
|
|
|
only if no session-local value has been established with <command>SET</>.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
2015-03-15 17:45:35 +01:00
|
|
|
<!-- PGC_USERSET -->
|
2011-03-17 05:26:03 +01:00
|
|
|
<term><literal>user</literal></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
These settings can be set from <filename>postgresql.conf</filename>,
|
|
|
|
or within a session via the <command>SET</> command. Any user is
|
2015-09-22 04:57:29 +02:00
|
|
|
allowed to change their session-local value. Changes in
|
2011-03-17 05:26:03 +01:00
|
|
|
<filename>postgresql.conf</filename> will affect existing sessions
|
|
|
|
only if no session-local value has been established with <command>SET</>.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
See <xref linkend="config-setting"> for more information about the various
|
|
|
|
ways to change these parameters.
|
|
|
|
</para>
|
|
|
|
|
2003-10-18 00:38:20 +02:00
|
|
|
<para>
|
|
|
|
The <structname>pg_settings</structname> view cannot be inserted into or
|
|
|
|
deleted from, but it can be updated. An <command>UPDATE</command> applied
|
|
|
|
to a row of <structname>pg_settings</structname> is equivalent to executing
|
2010-04-03 09:23:02 +02:00
|
|
|
the <xref linkend="sql-set"> command on that named
|
2003-10-18 00:38:20 +02:00
|
|
|
parameter. The change only affects the value used by the current
|
|
|
|
session. If an <command>UPDATE</command> is issued within a transaction
|
|
|
|
that is later aborted, the effects of the <command>UPDATE</command> command
|
|
|
|
disappear when the transaction is rolled back. Once the surrounding
|
|
|
|
transaction is committed, the effects will persist until the end of the
|
|
|
|
session, unless overridden by another <command>UPDATE</command> or
|
|
|
|
<command>SET</command>.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
2005-06-28 07:09:14 +02:00
|
|
|
<sect1 id="view-pg-shadow">
|
|
|
|
<title><structname>pg_shadow</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="view-pg-shadow">
|
|
|
|
<primary>pg_shadow</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The view <structname>pg_shadow</structname> exists for backwards
|
|
|
|
compatibility: it emulates a catalog that existed in
|
|
|
|
<productname>PostgreSQL</productname> before version 8.1.
|
|
|
|
It shows properties of all roles that are marked as
|
2010-09-13 03:23:35 +02:00
|
|
|
<structfield>rolcanlogin</> in
|
2010-09-13 19:02:34 +02:00
|
|
|
<link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.
|
2005-06-28 07:09:14 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The name stems from the fact that this table
|
|
|
|
should not be readable by the public since it contains passwords.
|
|
|
|
<link linkend="view-pg-user"><structname>pg_user</structname></link>
|
|
|
|
is a publicly readable view on
|
|
|
|
<structname>pg_shadow</structname> that blanks out the password field.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_shadow</> Columns</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2005-06-28 07:09:14 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>usename</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.rolname</literal></entry>
|
|
|
|
<entry>User name</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>usesysid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
|
|
|
|
<entry>ID of this user</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>usecreatedb</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
Also update two error messages mentioned in the documenation to match.
2007-01-31 21:56:20 +01:00
|
|
|
<entry>User can create databases</entry>
|
2005-06-28 07:09:14 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>usesuper</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>User is a superuser</entry>
|
|
|
|
</row>
|
|
|
|
|
2012-04-06 22:54:27 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>userepl</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
User can initiate streaming replication and put the system in and
|
|
|
|
out of backup mode.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2015-01-29 03:47:15 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>usebypassrls</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
2015-10-04 02:19:57 +02:00
|
|
|
User bypasses every row level security policy, see
|
2015-01-29 03:47:15 +01:00
|
|
|
<xref linkend="ddl-rowsecurity"> for more information.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2005-06-28 07:09:14 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>passwd</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
2010-09-13 19:02:34 +02:00
|
|
|
<entry>Password (possibly encrypted); null if none. See
|
|
|
|
<link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>
|
|
|
|
for details of how encrypted passwords are stored.</entry>
|
2005-06-28 07:09:14 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>valuntil</structfield></entry>
|
|
|
|
<entry><type>abstime</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Password expiry time (only used for password authentication)</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>useconfig</structfield></entry>
|
|
|
|
<entry><type>text[]</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Session defaults for run-time configuration variables</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
2003-10-18 00:38:20 +02:00
|
|
|
<sect1 id="view-pg-stats">
|
|
|
|
<title><structname>pg_stats</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="view-pg-stats">
|
|
|
|
<primary>pg_stats</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The view <structname>pg_stats</structname> provides access to
|
|
|
|
the information stored in the <link
|
|
|
|
linkend="catalog-pg-statistic"><structname>pg_statistic</structname></link>
|
|
|
|
catalog. This view allows access only to rows of
|
|
|
|
<structname>pg_statistic</structname> that correspond to tables the
|
|
|
|
user has permission to read, and therefore it is safe to allow public
|
|
|
|
read access to this view.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<structname>pg_stats</structname> is also designed to present the
|
|
|
|
information in a more readable format than the underlying catalog
|
2004-11-15 07:32:15 +01:00
|
|
|
— at the cost that its schema must be extended whenever new slot types
|
2003-10-18 00:38:20 +02:00
|
|
|
are defined for <structname>pg_statistic</structname>.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_stats</> Columns</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2003-10-18 00:38:20 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>schemaname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.nspname</literal></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>Name of schema containing table</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>tablename</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relname</literal></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>Name of table</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>attname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.attname</literal></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>Name of the column described by this row</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
|
|
|
|
2009-12-29 21:11:45 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>inherited</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>If true, this row includes inheritance child columns, not just the
|
|
|
|
values in the specified table</entry>
|
|
|
|
</row>
|
|
|
|
|
2003-10-18 00:38:20 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>null_frac</structfield></entry>
|
|
|
|
<entry><type>real</type></entry>
|
|
|
|
<entry></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>Fraction of column entries that are null</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>avg_width</structfield></entry>
|
|
|
|
<entry><type>integer</type></entry>
|
|
|
|
<entry></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>Average width in bytes of column's entries</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>n_distinct</structfield></entry>
|
|
|
|
<entry><type>real</type></entry>
|
|
|
|
<entry></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>
|
|
|
|
If greater than zero, the estimated number of distinct values in the
|
|
|
|
column. If less than zero, the negative of the number of distinct
|
|
|
|
values divided by the number of rows. (The negated form is used when
|
|
|
|
<command>ANALYZE</> believes that the number of distinct values is
|
|
|
|
likely to increase as the table grows; the positive form is used when
|
|
|
|
the column seems to have a fixed number of possible values.) For
|
|
|
|
example, -1 indicates a unique column in which the number of distinct
|
2010-08-17 06:37:21 +02:00
|
|
|
values is the same as the number of rows.
|
2003-10-18 00:38:20 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>most_common_vals</structfield></entry>
|
|
|
|
<entry><type>anyarray</type></entry>
|
|
|
|
<entry></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>
|
2010-08-17 06:37:21 +02:00
|
|
|
A list of the most common values in the column. (Null if
|
2006-11-12 07:25:37 +01:00
|
|
|
no values seem to be more common than any others.)
|
|
|
|
</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>most_common_freqs</structfield></entry>
|
|
|
|
<entry><type>real[]</type></entry>
|
|
|
|
<entry></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>
|
2012-03-04 02:20:19 +01:00
|
|
|
A list of the frequencies of the most common values,
|
2006-11-12 07:25:37 +01:00
|
|
|
i.e., number of occurrences of each divided by total number of rows.
|
2010-08-17 06:37:21 +02:00
|
|
|
(Null when <structfield>most_common_vals</structfield> is.)
|
2008-07-14 02:51:46 +02:00
|
|
|
</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>histogram_bounds</structfield></entry>
|
|
|
|
<entry><type>anyarray</type></entry>
|
|
|
|
<entry></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>
|
|
|
|
A list of values that divide the column's values into groups of
|
|
|
|
approximately equal population. The values in
|
|
|
|
<structfield>most_common_vals</>, if present, are omitted from this
|
2010-08-17 06:37:21 +02:00
|
|
|
histogram calculation. (This column is null if the column data type
|
2006-11-12 07:25:37 +01:00
|
|
|
does not have a <literal><</> operator or if the
|
|
|
|
<structfield>most_common_vals</> list accounts for the entire
|
|
|
|
population.)
|
2003-10-18 00:38:20 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>correlation</structfield></entry>
|
|
|
|
<entry><type>real</type></entry>
|
|
|
|
<entry></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>
|
|
|
|
Statistical correlation between physical row ordering and
|
|
|
|
logical ordering of the column values. This ranges from -1 to +1.
|
|
|
|
When the value is near -1 or +1, an index scan on the column will
|
|
|
|
be estimated to be cheaper than when it is near zero, due to reduction
|
2010-08-17 06:37:21 +02:00
|
|
|
of random access to the disk. (This column is null if the column data
|
2006-11-12 07:25:37 +01:00
|
|
|
type does not have a <literal><</> operator.)
|
2003-10-18 00:38:20 +02:00
|
|
|
</entry>
|
|
|
|
</row>
|
2012-03-04 02:20:19 +01:00
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>most_common_elems</structfield></entry>
|
|
|
|
<entry><type>anyarray</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
A list of non-null element values most often appearing within values of
|
|
|
|
the column. (Null for scalar types.)
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>most_common_elem_freqs</structfield></entry>
|
|
|
|
<entry><type>real[]</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
A list of the frequencies of the most common element values, i.e., the
|
|
|
|
fraction of rows containing at least one instance of the given value.
|
|
|
|
Two or three additional values follow the per-element frequencies;
|
|
|
|
these are the minimum and maximum of the preceding per-element
|
|
|
|
frequencies, and optionally the frequency of null elements.
|
|
|
|
(Null when <structfield>most_common_elems</structfield> is.)
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>elem_count_histogram</structfield></entry>
|
|
|
|
<entry><type>real[]</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
A histogram of the counts of distinct non-null element values within the
|
|
|
|
values of the column, followed by the average number of distinct
|
|
|
|
non-null elements. (Null for scalar types.)
|
|
|
|
</entry>
|
|
|
|
</row>
|
2003-10-18 00:38:20 +02:00
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<para>
|
2012-03-04 02:20:19 +01:00
|
|
|
The maximum number of entries in the array fields can be controlled on a
|
2003-10-18 00:38:20 +02:00
|
|
|
column-by-column basis using the <command>ALTER TABLE SET STATISTICS</>
|
|
|
|
command, or globally by setting the
|
2005-11-05 00:14:02 +01:00
|
|
|
<xref linkend="guc-default-statistics-target"> run-time parameter.
|
2003-10-18 00:38:20 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
<sect1 id="view-pg-tables">
|
|
|
|
<title><structname>pg_tables</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="view-pg-tables">
|
|
|
|
<primary>pg_tables</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The view <structname>pg_tables</structname> provides access to
|
|
|
|
useful information about each table in the database.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_tables</> Columns</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2003-10-18 00:38:20 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>schemaname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.nspname</literal></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>Name of schema containing table</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>tablename</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relname</literal></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>Name of table</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>tableowner</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
2005-06-28 07:09:14 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.rolname</literal></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>Name of table's owner</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
2004-10-11 19:24:41 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>tablespace</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-tablespace"><structname>pg_tablespace</structname></link>.spcname</literal></entry>
|
2010-08-17 06:37:21 +02:00
|
|
|
<entry>Name of tablespace containing table (null if default for database)</entry>
|
2004-10-11 19:24:41 +02:00
|
|
|
</row>
|
2003-10-18 00:38:20 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>hasindexes</structfield></entry>
|
|
|
|
<entry><type>boolean</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relhasindex</literal></entry>
|
2010-08-17 06:37:21 +02:00
|
|
|
<entry>True if table has (or recently had) any indexes</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>hasrules</structfield></entry>
|
|
|
|
<entry><type>boolean</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relhasrules</literal></entry>
|
2010-08-17 06:37:21 +02:00
|
|
|
<entry>True if table has (or once had) rules</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>hastriggers</structfield></entry>
|
|
|
|
<entry><type>boolean</type></entry>
|
2008-11-09 22:24:33 +01:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relhastriggers</literal></entry>
|
2010-08-17 06:37:21 +02:00
|
|
|
<entry>True if table has (or once had) triggers</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
Row-Level Security Policies (RLS)
Building on the updatable security-barrier views work, add the
ability to define policies on tables to limit the set of rows
which are returned from a query and which are allowed to be added
to a table. Expressions defined by the policy for filtering are
added to the security barrier quals of the query, while expressions
defined to check records being added to a table are added to the
with-check options of the query.
New top-level commands are CREATE/ALTER/DROP POLICY and are
controlled by the table owner. Row Security is able to be enabled
and disabled by the owner on a per-table basis using
ALTER TABLE .. ENABLE/DISABLE ROW SECURITY.
Per discussion, ROW SECURITY is disabled on tables by default and
must be enabled for policies on the table to be used. If no
policies exist on a table with ROW SECURITY enabled, a default-deny
policy is used and no records will be visible.
By default, row security is applied at all times except for the
table owner and the superuser. A new GUC, row_security, is added
which can be set to ON, OFF, or FORCE. When set to FORCE, row
security will be applied even for the table owner and superusers.
When set to OFF, row security will be disabled when allowed and an
error will be thrown if the user does not have rights to bypass row
security.
Per discussion, pg_dump sets row_security = OFF by default to ensure
that exports and backups will have all data in the table or will
error if there are insufficient privileges to bypass row security.
A new option has been added to pg_dump, --enable-row-security, to
ask pg_dump to export with row security enabled.
A new role capability, BYPASSRLS, which can only be set by the
superuser, is added to allow other users to be able to bypass row
security using row_security = OFF.
Many thanks to the various individuals who have helped with the
design, particularly Robert Haas for his feedback.
Authors include Craig Ringer, KaiGai Kohei, Adam Brightwell, Dean
Rasheed, with additional changes and rework by me.
Reviewers have included all of the above, Greg Smith,
Jeff McCormick, and Robert Haas.
2014-09-19 17:18:35 +02:00
|
|
|
<row>
|
Code review for row security.
Buildfarm member tick identified an issue where the policies in the
relcache for a relation were were being replaced underneath a running
query, leading to segfaults while processing the policies to be added
to a query. Similar to how TupleDesc RuleLocks are handled, add in a
equalRSDesc() function to check if the policies have actually changed
and, if not, swap back the rsdesc field (using the original instead of
the temporairly built one; the whole structure is swapped and then
specific fields swapped back). This now passes a CLOBBER_CACHE_ALWAYS
for me and should resolve the buildfarm error.
In addition to addressing this, add a new chapter in Data Definition
under Privileges which explains row security and provides examples of
its usage, change \d to always list policies (even if row security is
disabled- but note that it is disabled, or enabled with no policies),
rework check_role_for_policy (it really didn't need the entire policy,
but it did need to be using has_privs_of_role()), and change the field
in pg_class to relrowsecurity from relhasrowsecurity, based on
Heikki's suggestion. Also from Heikki, only issue SET ROW_SECURITY in
pg_restore when talking to a 9.5+ server, list Bypass RLS in \du, and
document --enable-row-security options for pg_dump and pg_restore.
Lastly, fix a number of minor whitespace and typo issues from Heikki,
Dimitri, add a missing #include, per Peter E, fix a few minor
variable-assigned-but-not-used and resource leak issues from Coverity
and add tab completion for role attribute bypassrls as well.
2014-09-24 22:32:22 +02:00
|
|
|
<entry><structfield>rowsecurity</structfield></entry>
|
Row-Level Security Policies (RLS)
Building on the updatable security-barrier views work, add the
ability to define policies on tables to limit the set of rows
which are returned from a query and which are allowed to be added
to a table. Expressions defined by the policy for filtering are
added to the security barrier quals of the query, while expressions
defined to check records being added to a table are added to the
with-check options of the query.
New top-level commands are CREATE/ALTER/DROP POLICY and are
controlled by the table owner. Row Security is able to be enabled
and disabled by the owner on a per-table basis using
ALTER TABLE .. ENABLE/DISABLE ROW SECURITY.
Per discussion, ROW SECURITY is disabled on tables by default and
must be enabled for policies on the table to be used. If no
policies exist on a table with ROW SECURITY enabled, a default-deny
policy is used and no records will be visible.
By default, row security is applied at all times except for the
table owner and the superuser. A new GUC, row_security, is added
which can be set to ON, OFF, or FORCE. When set to FORCE, row
security will be applied even for the table owner and superusers.
When set to OFF, row security will be disabled when allowed and an
error will be thrown if the user does not have rights to bypass row
security.
Per discussion, pg_dump sets row_security = OFF by default to ensure
that exports and backups will have all data in the table or will
error if there are insufficient privileges to bypass row security.
A new option has been added to pg_dump, --enable-row-security, to
ask pg_dump to export with row security enabled.
A new role capability, BYPASSRLS, which can only be set by the
superuser, is added to allow other users to be able to bypass row
security using row_security = OFF.
Many thanks to the various individuals who have helped with the
design, particularly Robert Haas for his feedback.
Authors include Craig Ringer, KaiGai Kohei, Adam Brightwell, Dean
Rasheed, with additional changes and rework by me.
Reviewers have included all of the above, Greg Smith,
Jeff McCormick, and Robert Haas.
2014-09-19 17:18:35 +02:00
|
|
|
<entry><type>boolean</type></entry>
|
Code review for row security.
Buildfarm member tick identified an issue where the policies in the
relcache for a relation were were being replaced underneath a running
query, leading to segfaults while processing the policies to be added
to a query. Similar to how TupleDesc RuleLocks are handled, add in a
equalRSDesc() function to check if the policies have actually changed
and, if not, swap back the rsdesc field (using the original instead of
the temporairly built one; the whole structure is swapped and then
specific fields swapped back). This now passes a CLOBBER_CACHE_ALWAYS
for me and should resolve the buildfarm error.
In addition to addressing this, add a new chapter in Data Definition
under Privileges which explains row security and provides examples of
its usage, change \d to always list policies (even if row security is
disabled- but note that it is disabled, or enabled with no policies),
rework check_role_for_policy (it really didn't need the entire policy,
but it did need to be using has_privs_of_role()), and change the field
in pg_class to relrowsecurity from relhasrowsecurity, based on
Heikki's suggestion. Also from Heikki, only issue SET ROW_SECURITY in
pg_restore when talking to a 9.5+ server, list Bypass RLS in \du, and
document --enable-row-security options for pg_dump and pg_restore.
Lastly, fix a number of minor whitespace and typo issues from Heikki,
Dimitri, add a missing #include, per Peter E, fix a few minor
variable-assigned-but-not-used and resource leak issues from Coverity
and add tab completion for role attribute bypassrls as well.
2014-09-24 22:32:22 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relrowsecurity</literal></entry>
|
|
|
|
<entry>True if row security is enabled on the table</entry>
|
Row-Level Security Policies (RLS)
Building on the updatable security-barrier views work, add the
ability to define policies on tables to limit the set of rows
which are returned from a query and which are allowed to be added
to a table. Expressions defined by the policy for filtering are
added to the security barrier quals of the query, while expressions
defined to check records being added to a table are added to the
with-check options of the query.
New top-level commands are CREATE/ALTER/DROP POLICY and are
controlled by the table owner. Row Security is able to be enabled
and disabled by the owner on a per-table basis using
ALTER TABLE .. ENABLE/DISABLE ROW SECURITY.
Per discussion, ROW SECURITY is disabled on tables by default and
must be enabled for policies on the table to be used. If no
policies exist on a table with ROW SECURITY enabled, a default-deny
policy is used and no records will be visible.
By default, row security is applied at all times except for the
table owner and the superuser. A new GUC, row_security, is added
which can be set to ON, OFF, or FORCE. When set to FORCE, row
security will be applied even for the table owner and superusers.
When set to OFF, row security will be disabled when allowed and an
error will be thrown if the user does not have rights to bypass row
security.
Per discussion, pg_dump sets row_security = OFF by default to ensure
that exports and backups will have all data in the table or will
error if there are insufficient privileges to bypass row security.
A new option has been added to pg_dump, --enable-row-security, to
ask pg_dump to export with row security enabled.
A new role capability, BYPASSRLS, which can only be set by the
superuser, is added to allow other users to be able to bypass row
security using row_security = OFF.
Many thanks to the various individuals who have helped with the
design, particularly Robert Haas for his feedback.
Authors include Craig Ringer, KaiGai Kohei, Adam Brightwell, Dean
Rasheed, with additional changes and rework by me.
Reviewers have included all of the above, Greg Smith,
Jeff McCormick, and Robert Haas.
2014-09-19 17:18:35 +02:00
|
|
|
</row>
|
2003-10-18 00:38:20 +02:00
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
2006-09-16 22:14:34 +02:00
|
|
|
<sect1 id="view-pg-timezone-abbrevs">
|
|
|
|
<title><structname>pg_timezone_abbrevs</structname></title>
|
2006-07-25 05:51:23 +02:00
|
|
|
|
2006-09-16 22:14:34 +02:00
|
|
|
<indexterm zone="view-pg-timezone-abbrevs">
|
|
|
|
<primary>pg_timezone_abbrevs</primary>
|
2006-07-25 05:51:23 +02:00
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
2006-09-16 22:14:34 +02:00
|
|
|
The view <structname>pg_timezone_abbrevs</structname> provides a list
|
2006-07-25 05:51:23 +02:00
|
|
|
of time zone abbreviations that are currently recognized by the datetime
|
|
|
|
input routines. The contents of this view change when the
|
|
|
|
<xref linkend="guc-timezone-abbreviations"> run-time parameter is modified.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
2006-09-16 22:14:34 +02:00
|
|
|
<title><structname>pg_timezone_abbrevs</> Columns</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="3">
|
2006-09-16 22:14:34 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>abbrev</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>Time zone abbreviation</entry>
|
2006-09-16 22:14:34 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>utc_offset</structfield></entry>
|
|
|
|
<entry><type>interval</type></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>Offset from UTC (positive means east of Greenwich)</entry>
|
2006-09-16 22:14:34 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>is_dst</structfield></entry>
|
|
|
|
<entry><type>boolean</type></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>True if this is a daylight-savings abbreviation</entry>
|
2006-09-16 22:14:34 +02:00
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
<sect1 id="view-pg-timezone-names">
|
|
|
|
<title><structname>pg_timezone_names</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="view-pg-timezone-names">
|
|
|
|
<primary>pg_timezone_names</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The view <structname>pg_timezone_names</structname> provides a list
|
|
|
|
of time zone names that are recognized by <command>SET TIMEZONE</>,
|
|
|
|
along with their associated abbreviations, UTC offsets,
|
2011-09-05 21:37:58 +02:00
|
|
|
and daylight-savings status. (Technically,
|
|
|
|
<productname>PostgreSQL</productname> uses <acronym>UT1</> rather
|
|
|
|
than UTC because leap seconds are not handled.)
|
2006-09-16 22:14:34 +02:00
|
|
|
Unlike the abbreviations shown in <link
|
|
|
|
linkend="view-pg-timezone-abbrevs"><structname>pg_timezone_abbrevs</structname></link>, many of these names imply a set of daylight-savings transition
|
|
|
|
date rules. Therefore, the associated information changes across local DST
|
|
|
|
boundaries. The displayed information is computed based on the current
|
|
|
|
value of <function>CURRENT_TIMESTAMP</>.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_timezone_names</> Columns</title>
|
2006-07-25 05:51:23 +02:00
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="3">
|
2006-07-25 05:51:23 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>name</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>Time zone name</entry>
|
2006-09-16 22:14:34 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>abbrev</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>Time zone abbreviation</entry>
|
2006-07-25 05:51:23 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>utc_offset</structfield></entry>
|
|
|
|
<entry><type>interval</type></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>Offset from UTC (positive means east of Greenwich)</entry>
|
2006-07-25 05:51:23 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>is_dst</structfield></entry>
|
|
|
|
<entry><type>boolean</type></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>True if currently observing daylight savings</entry>
|
2006-07-25 05:51:23 +02:00
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
2003-10-18 00:38:20 +02:00
|
|
|
<sect1 id="view-pg-user">
|
|
|
|
<title><structname>pg_user</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="view-pg-user">
|
|
|
|
<primary>pg_user</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The view <structname>pg_user</structname> provides access to
|
|
|
|
information about database users. This is simply a publicly
|
Replace the hard-wired type knowledge in TypeCategory() and IsPreferredType()
with system catalog lookups, as was foreseen to be necessary almost since
their creation. Instead put the information into two new pg_type columns,
typcategory and typispreferred. Add support for setting these when
creating a user-defined base type.
The category column is just a "char" (i.e. a poor man's enum), allowing
a crude form of user extensibility of the category list: just use an
otherwise-unused character. This seems sufficient for foreseen uses,
but we could upgrade to having an actual category catalog someday, if
there proves to be a huge demand for custom type categories.
In this patch I have attempted to hew exactly to the behavior of the
previous hardwired logic, except for introducing new type categories for
arrays, composites, and enums. In particular the default preferred state
for user-defined types remains TRUE. That seems worth revisiting, but it
should be done as a separate patch from introducing the infrastructure.
Likewise, any adjustment of the standard set of categories should be done
separately.
2008-07-30 19:05:05 +02:00
|
|
|
readable view of
|
2005-06-28 07:09:14 +02:00
|
|
|
<link linkend="view-pg-shadow"><structname>pg_shadow</structname></link>
|
2003-10-18 00:38:20 +02:00
|
|
|
that blanks out the password field.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_user</> Columns</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="3">
|
2003-10-18 00:38:20 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>usename</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry>User name</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>usesysid</structfield></entry>
|
2012-04-06 22:54:27 +02:00
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry>ID of this user</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>usecreatedb</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
Update documentation on may/can/might:
Standard English uses "may", "can", and "might" in different ways:
may - permission, "You may borrow my rake."
can - ability, "I can lift that log."
might - possibility, "It might rain today."
Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice. Similarly, "It may crash" is better stated, "It might crash".
Also update two error messages mentioned in the documenation to match.
2007-01-31 21:56:20 +01:00
|
|
|
<entry>User can create databases</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>usesuper</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry>User is a superuser</entry>
|
|
|
|
</row>
|
|
|
|
|
2012-04-06 22:54:27 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>userepl</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry>
|
|
|
|
User can initiate streaming replication and put the system in and
|
|
|
|
out of backup mode.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2015-01-29 03:47:15 +01:00
|
|
|
<row>
|
|
|
|
<entry><structfield>usebypassrls</structfield></entry>
|
|
|
|
<entry><type>bool</type></entry>
|
|
|
|
<entry>
|
2015-10-04 02:19:57 +02:00
|
|
|
User bypasses every row level security policy, see
|
2015-01-29 03:47:15 +01:00
|
|
|
<xref linkend="ddl-rowsecurity"> for more information.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
2003-10-18 00:38:20 +02:00
|
|
|
<row>
|
|
|
|
<entry><structfield>passwd</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry>Not the password (always reads as <literal>********</>)</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>valuntil</structfield></entry>
|
|
|
|
<entry><type>abstime</type></entry>
|
2005-01-06 00:42:03 +01:00
|
|
|
<entry>Password expiry time (only used for password authentication)</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>useconfig</structfield></entry>
|
|
|
|
<entry><type>text[]</type></entry>
|
|
|
|
<entry>Session defaults for run-time configuration variables</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
2008-12-19 17:25:19 +01:00
|
|
|
<sect1 id="view-pg-user-mappings">
|
|
|
|
<title><structname>pg_user_mappings</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="view-pg-user-mappings">
|
|
|
|
<primary>pg_user_mappings</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The view <structname>pg_user_mappings</structname> provides access
|
|
|
|
to information about user mappings. This is essentially a publicly
|
|
|
|
readable view of
|
|
|
|
<link linkend="catalog-pg-user-mapping"><structname>pg_user_mapping</structname></link>
|
|
|
|
that leaves out the options field if the user has no rights to use
|
|
|
|
it.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_user_mappings</> Columns</title>
|
|
|
|
|
2009-08-11 00:13:50 +02:00
|
|
|
<tgroup cols="4">
|
2008-12-19 17:25:19 +01:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>umid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-user-mapping"><structname>pg_user_mapping</structname></link>.oid</literal></entry>
|
|
|
|
<entry>OID of the user mapping</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>srvid</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-foreign-server"><structname>pg_foreign_server</structname></link>.oid</literal></entry>
|
|
|
|
<entry>
|
|
|
|
The OID of the foreign server that contains this mapping
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>srvname</structfield></entry>
|
2012-04-06 22:54:27 +02:00
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-foreign-server"><structname>pg_foreign_server</structname></link>.srvname</literal></entry>
|
2008-12-19 17:25:19 +01:00
|
|
|
<entry>
|
|
|
|
Name of the foreign server
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>umuser</structfield></entry>
|
|
|
|
<entry><type>oid</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry>
|
|
|
|
<entry>OID of the local role being mapped, 0 if the user mapping is public</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>usename</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>Name of the local user to be mapped</entry>
|
|
|
|
</row>
|
|
|
|
|
|
|
|
<row>
|
|
|
|
<entry><structfield>umoptions</structfield></entry>
|
|
|
|
<entry><type>text[]</type></entry>
|
|
|
|
<entry></entry>
|
|
|
|
<entry>
|
|
|
|
User mapping specific options, as <quote>keyword=value</>
|
|
|
|
strings, if the current user is the owner of the foreign
|
2010-08-17 06:37:21 +02:00
|
|
|
server, else null
|
2008-12-19 17:25:19 +01:00
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
2003-10-18 00:38:20 +02:00
|
|
|
<sect1 id="view-pg-views">
|
|
|
|
<title><structname>pg_views</structname></title>
|
|
|
|
|
|
|
|
<indexterm zone="view-pg-views">
|
|
|
|
<primary>pg_views</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The view <structname>pg_views</structname> provides access to
|
|
|
|
useful information about each view in the database.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<title><structname>pg_views</> Columns</title>
|
|
|
|
|
2009-02-04 22:30:41 +01:00
|
|
|
<tgroup cols="4">
|
2003-10-18 00:38:20 +02:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Name</entry>
|
|
|
|
<entry>Type</entry>
|
|
|
|
<entry>References</entry>
|
|
|
|
<entry>Description</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>schemaname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.nspname</literal></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>Name of schema containing view</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>viewname</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
|
|
|
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.relname</literal></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>Name of view</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>viewowner</structfield></entry>
|
|
|
|
<entry><type>name</type></entry>
|
2005-06-28 07:09:14 +02:00
|
|
|
<entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.rolname</literal></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>Name of view's owner</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry><structfield>definition</structfield></entry>
|
|
|
|
<entry><type>text</type></entry>
|
|
|
|
<entry></entry>
|
2006-11-12 07:25:37 +01:00
|
|
|
<entry>View definition (a reconstructed <command>SELECT</command> query)</entry>
|
2003-10-18 00:38:20 +02:00
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
2000-11-29 21:15:59 +01:00
|
|
|
</chapter>
|