mirror of
https://github.com/postgres/postgres.git
synced 2025-04-24 10:47:04 +03:00
Improve <xref> vs. <command> formatting in the documentation
SQL commands are generally marked up as <command>, except when a link to a reference page is used using <xref>. But the latter doesn't create monospace markup, so this looks strange especially when a paragraph contains a mix of links and non-links. We considered putting <command> in the <refentrytitle> on the target side, but that creates some formatting side effects elsewhere. Generally, it seems safer to solve this on the link source side. We can't put the <xref> inside the <command>; the DTD doesn't allow this. DocBook 5 would allow the <command> to have the linkend attribute itself, but we are not there yet. So to solve this for now, convert the <xref>s to <link> plus <command>. This gives the correct look and also gives some more flexibility what we can put into the link text (e.g., subcommands or other clauses). In the future, these could then be converted to DocBook 5 style. I haven't converted absolutely all xrefs to SQL command reference pages, only those where we care about the appearance of the link text or where it was otherwise appropriate to make the appearance match a bit better. Also in some cases, the links where repetitive, so in those cases the links where just removed and replaced by a plain <command>. In cases where we just want the link and don't specifically care about the generated link text (typically phrased "for further information see <xref ...>") the xref is kept. Reported-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> Discussion: https://www.postgresql.org/message-id/flat/87o8pco34z.fsf@wibble.ilmari.org
This commit is contained in:
parent
1a9388bd0f
commit
9081bddbd7
@ -177,8 +177,8 @@ pg_dump -h <replaceable>host1</replaceable> <replaceable>dbname</replaceable> |
|
|||||||
</important>
|
</important>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
After restoring a backup, it is wise to run <xref
|
After restoring a backup, it is wise to run <link
|
||||||
linkend="sql-analyze"/> on each
|
linkend="sql-analyze"><command>ANALYZE</command></link> on each
|
||||||
database so the query optimizer has useful statistics;
|
database so the query optimizer has useful statistics;
|
||||||
see <xref linkend="vacuum-for-statistics"/>
|
see <xref linkend="vacuum-for-statistics"/>
|
||||||
and <xref linkend="autovacuum"/> for more information.
|
and <xref linkend="autovacuum"/> for more information.
|
||||||
@ -1594,7 +1594,7 @@ archive_command = 'local_backup_script.sh "%p" "%f"'
|
|||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
If a <xref linkend="sql-createdatabase"/>
|
If a <link linkend="sql-createdatabase"><command>CREATE DATABASE</command></link>
|
||||||
command is executed while a base backup is being taken, and then
|
command is executed while a base backup is being taken, and then
|
||||||
the template database that the <command>CREATE DATABASE</command> copied
|
the template database that the <command>CREATE DATABASE</command> copied
|
||||||
is modified while the base backup is still in progress, it is
|
is modified while the base backup is still in progress, it is
|
||||||
@ -1607,7 +1607,7 @@ archive_command = 'local_backup_script.sh "%p" "%f"'
|
|||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
<xref linkend="sql-createtablespace"/>
|
<link linkend="sql-createtablespace"><command>CREATE TABLESPACE</command></link>
|
||||||
commands are WAL-logged with the literal absolute path, and will
|
commands are WAL-logged with the literal absolute path, and will
|
||||||
therefore be replayed as tablespace creations with the same
|
therefore be replayed as tablespace creations with the same
|
||||||
absolute path. This might be undesirable if the log is being
|
absolute path. This might be undesirable if the log is being
|
||||||
|
@ -639,8 +639,8 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
New aggregate functions are registered with the <xref
|
New aggregate functions are registered with the <link
|
||||||
linkend="sql-createaggregate"/>
|
linkend="sql-createaggregate"><command>CREATE AGGREGATE</command></link>
|
||||||
command. See <xref linkend="xaggr"/> for more information about
|
command. See <xref linkend="xaggr"/> for more information about
|
||||||
writing aggregate functions and the meaning of the transition
|
writing aggregate functions and the meaning of the transition
|
||||||
functions, etc.
|
functions, etc.
|
||||||
@ -1161,7 +1161,7 @@
|
|||||||
<para>
|
<para>
|
||||||
<structfield>attstattarget</structfield> controls the level of detail
|
<structfield>attstattarget</structfield> controls the level of detail
|
||||||
of statistics accumulated for this column by
|
of statistics accumulated for this column by
|
||||||
<xref linkend="sql-analyze"/>.
|
<link linkend="sql-analyze"><command>ANALYZE</command></link>.
|
||||||
A zero value indicates that no statistics should be collected.
|
A zero value indicates that no statistics should be collected.
|
||||||
A negative value says to use the system default statistics target.
|
A negative value says to use the system default statistics target.
|
||||||
The exact meaning of positive values is data type-dependent.
|
The exact meaning of positive values is data type-dependent.
|
||||||
@ -1966,9 +1966,9 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l
|
|||||||
<para>
|
<para>
|
||||||
Size of the on-disk representation of this table in pages (of size
|
Size of the on-disk representation of this table in pages (of size
|
||||||
<symbol>BLCKSZ</symbol>). This is only an estimate used by the
|
<symbol>BLCKSZ</symbol>). This is only an estimate used by the
|
||||||
planner. It is updated by <xref linkend="sql-vacuum"/>,
|
planner. It is updated by <link linkend="sql-vacuum"><command>VACUUM</command></link>,
|
||||||
<xref linkend="sql-analyze"/>, and a few DDL commands such as
|
<link linkend="sql-analyze"><command>ANALYZE</command></link>, and a few DDL commands such as
|
||||||
<xref linkend="sql-createindex"/>.
|
<link linkend="sql-createindex"><command>CREATE INDEX</command></link>.
|
||||||
</para></entry>
|
</para></entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
@ -1978,9 +1978,9 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l
|
|||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
Number of live rows in the table. This is only an estimate used by
|
Number of live rows in the table. This is only an estimate used by
|
||||||
the planner. It is updated by <xref linkend="sql-vacuum"/>,
|
the planner. It is updated by <link linkend="sql-vacuum"><command>VACUUM</command></link>,
|
||||||
<xref linkend="sql-analyze"/>, and a few DDL commands such as
|
<link linkend="sql-analyze"><command>ANALYZE</command></link>, and a few DDL commands such as
|
||||||
<xref linkend="sql-createindex"/>.
|
<link linkend="sql-createindex"><command>CREATE INDEX</command></link>.
|
||||||
If the table has never yet been vacuumed or
|
If the table has never yet been vacuumed or
|
||||||
analyzed, <structfield>reltuples</structfield>
|
analyzed, <structfield>reltuples</structfield>
|
||||||
contains <literal>-1</literal> indicating that the row count is
|
contains <literal>-1</literal> indicating that the row count is
|
||||||
@ -1995,9 +1995,9 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l
|
|||||||
<para>
|
<para>
|
||||||
Number of pages that are marked all-visible in the table's
|
Number of pages that are marked all-visible in the table's
|
||||||
visibility map. This is only an estimate used by the
|
visibility map. This is only an estimate used by the
|
||||||
planner. It is updated by <xref linkend="sql-vacuum"/>,
|
planner. It is updated by <link linkend="sql-vacuum"><command>VACUUM</command></link>,
|
||||||
<xref linkend="sql-analyze"/>, and a few DDL commands such as
|
<link linkend="sql-analyze"><command>ANALYZE</command></link>, and a few DDL commands such as
|
||||||
<xref linkend="sql-createindex"/>.
|
<link linkend="sql-createindex"><command>CREATE INDEX</command></link>.
|
||||||
</para></entry>
|
</para></entry>
|
||||||
</row>
|
</row>
|
||||||
|
|
||||||
@ -2241,8 +2241,8 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l
|
|||||||
lazily: they are guaranteed to be true if that's the correct state, but
|
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
|
may not be reset to false immediately when the condition is no longer
|
||||||
true. For example, <structfield>relhasindex</structfield> is set by
|
true. For example, <structfield>relhasindex</structfield> is set by
|
||||||
<xref linkend="sql-createindex"/>, but it is never cleared by
|
<link linkend="sql-createindex"><command>CREATE INDEX</command></link>, but it is never cleared by
|
||||||
<xref linkend="sql-dropindex"/>. Instead, <xref linkend="sql-vacuum"/> clears
|
<link linkend="sql-dropindex"><command>DROP INDEX</command></link>. Instead, <link linkend="sql-vacuum"><command>VACUUM</command></link> clears
|
||||||
<structfield>relhasindex</structfield> if it finds the table has no indexes. This
|
<structfield>relhasindex</structfield> if it finds the table has no indexes. This
|
||||||
arrangement avoids race conditions and improves concurrency.
|
arrangement avoids race conditions and improves concurrency.
|
||||||
</para>
|
</para>
|
||||||
@ -2848,8 +2848,8 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
The catalog <structname>pg_database</structname> stores information about
|
The catalog <structname>pg_database</structname> stores information about
|
||||||
the available databases. Databases are created with the <xref
|
the available databases. Databases are created with the <link
|
||||||
linkend="sql-createdatabase"/> command.
|
linkend="sql-createdatabase"><command>CREATE DATABASE</command></link> command.
|
||||||
Consult <xref linkend="managing-databases"/> for details about the meaning
|
Consult <xref linkend="managing-databases"/> for details about the meaning
|
||||||
of some of the parameters.
|
of some of the parameters.
|
||||||
</para>
|
</para>
|
||||||
@ -3425,7 +3425,7 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l
|
|||||||
the referenced object (see
|
the referenced object (see
|
||||||
<link linkend="catalog-pg-extension"><structname>pg_extension</structname></link>).
|
<link linkend="catalog-pg-extension"><structname>pg_extension</structname></link>).
|
||||||
The dependent object can be dropped only via
|
The dependent object can be dropped only via
|
||||||
<xref linkend="sql-dropextension"/> on the referenced object.
|
<link linkend="sql-dropextension"><command>DROP EXTENSION</command></link> on the referenced object.
|
||||||
Functionally this dependency type acts the same as
|
Functionally this dependency type acts the same as
|
||||||
an <literal>INTERNAL</literal> dependency, but it's kept separate for
|
an <literal>INTERNAL</literal> dependency, but it's kept separate for
|
||||||
clarity and to simplify <application>pg_dump</application>.
|
clarity and to simplify <application>pg_dump</application>.
|
||||||
@ -3492,7 +3492,7 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l
|
|||||||
<para>
|
<para>
|
||||||
The catalog <structname>pg_description</structname> stores optional descriptions
|
The catalog <structname>pg_description</structname> stores optional descriptions
|
||||||
(comments) for each database object. Descriptions can be manipulated
|
(comments) for each database object. Descriptions can be manipulated
|
||||||
with the <xref linkend="sql-comment"/> command and viewed with
|
with the <link linkend="sql-comment"><command>COMMENT</command></link> command and viewed with
|
||||||
<application>psql</application>'s <literal>\d</literal> commands.
|
<application>psql</application>'s <literal>\d</literal> commands.
|
||||||
Descriptions of many built-in system objects are provided in the initial
|
Descriptions of many built-in system objects are provided in the initial
|
||||||
contents of <structname>pg_description</structname>.
|
contents of <structname>pg_description</structname>.
|
||||||
@ -4285,7 +4285,7 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l
|
|||||||
<para>
|
<para>
|
||||||
If true, the index is currently valid for queries. False means the
|
If true, the index is currently valid for queries. False means the
|
||||||
index is possibly incomplete: it must still be modified by
|
index is possibly incomplete: it must still be modified by
|
||||||
<xref linkend="sql-insert"/>/<xref linkend="sql-update"/> operations, but it cannot safely
|
<link linkend="sql-insert"><command>INSERT</command></link>/<link linkend="sql-update"><command>UPDATE</command></link> operations, but it cannot safely
|
||||||
be used for queries. If it is unique, the uniqueness property is not
|
be used for queries. If it is unique, the uniqueness property is not
|
||||||
guaranteed true either.
|
guaranteed true either.
|
||||||
</para></entry>
|
</para></entry>
|
||||||
@ -4309,7 +4309,7 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l
|
|||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
If true, the index is currently ready for inserts. False means the
|
If true, the index is currently ready for inserts. False means the
|
||||||
index must be ignored by <xref linkend="sql-insert"/>/<xref linkend="sql-update"/>
|
index must be ignored by <link linkend="sql-insert"><command>INSERT</command></link>/<link linkend="sql-update"><command>UPDATE</command></link>
|
||||||
operations.
|
operations.
|
||||||
</para></entry>
|
</para></entry>
|
||||||
</row>
|
</row>
|
||||||
@ -4504,11 +4504,11 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l
|
|||||||
<para>
|
<para>
|
||||||
Objects can have initial privileges either by having those privileges set
|
Objects can have initial privileges either by having those privileges set
|
||||||
when the system is initialized (by <application>initdb</application>) or when the
|
when the system is initialized (by <application>initdb</application>) or when the
|
||||||
object is created during a <xref linkend="sql-createextension"/> and the
|
object is created during a <link linkend="sql-createextension"><command>CREATE EXTENSION</command></link> and the
|
||||||
extension script sets initial privileges using the <xref linkend="sql-grant"/>
|
extension script sets initial privileges using the <link linkend="sql-grant"><command>GRANT</command></link>
|
||||||
system. Note that the system will automatically handle recording of the
|
system. Note that the system will automatically handle recording of the
|
||||||
privileges during the extension script and that extension authors need
|
privileges during the extension script and that extension authors need
|
||||||
only use the <xref linkend="sql-grant"/> and <xref linkend="sql-revoke"/>
|
only use the <command>GRANT</command> and <command>REVOKE</command>
|
||||||
statements in their script to have the privileges recorded. The
|
statements in their script to have the privileges recorded. The
|
||||||
<literal>privtype</literal> column indicates if the initial privilege was
|
<literal>privtype</literal> column indicates if the initial privilege was
|
||||||
set by <application>initdb</application> or during a
|
set by <application>initdb</application> or during a
|
||||||
@ -6481,7 +6481,7 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l
|
|||||||
<para>
|
<para>
|
||||||
The catalog <structname>pg_seclabel</structname> stores security
|
The catalog <structname>pg_seclabel</structname> stores security
|
||||||
labels on database objects. Security labels can be manipulated
|
labels on database objects. Security labels can be manipulated
|
||||||
with the <xref linkend="sql-security-label"/> command. For an easier
|
with the <link linkend="sql-security-label"><command>SECURITY LABEL</command></link> command. For an easier
|
||||||
way to view security labels, see <xref linkend="view-pg-seclabels"/>.
|
way to view security labels, see <xref linkend="view-pg-seclabels"/>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -6855,7 +6855,7 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l
|
|||||||
<para>
|
<para>
|
||||||
The catalog <structname>pg_shdescription</structname> stores optional
|
The catalog <structname>pg_shdescription</structname> stores optional
|
||||||
descriptions (comments) for shared database objects. Descriptions can be
|
descriptions (comments) for shared database objects. Descriptions can be
|
||||||
manipulated with the <xref linkend="sql-comment"/> command and viewed with
|
manipulated with the <link linkend="sql-comment"><command>COMMENT</command></link> command and viewed with
|
||||||
<application>psql</application>'s <literal>\d</literal> commands.
|
<application>psql</application>'s <literal>\d</literal> commands.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -6931,7 +6931,7 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l
|
|||||||
<para>
|
<para>
|
||||||
The catalog <structname>pg_shseclabel</structname> stores security
|
The catalog <structname>pg_shseclabel</structname> stores security
|
||||||
labels on shared database objects. Security labels can be manipulated
|
labels on shared database objects. Security labels can be manipulated
|
||||||
with the <xref linkend="sql-security-label"/> command. For an easier
|
with the <link linkend="sql-security-label"><command>SECURITY LABEL</command></link> command. For an easier
|
||||||
way to view security labels, see <xref linkend="view-pg-seclabels"/>.
|
way to view security labels, see <xref linkend="view-pg-seclabels"/>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -7015,7 +7015,7 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l
|
|||||||
<para>
|
<para>
|
||||||
The catalog <structname>pg_statistic</structname> stores
|
The catalog <structname>pg_statistic</structname> stores
|
||||||
statistical data about the contents of the database. Entries are
|
statistical data about the contents of the database. Entries are
|
||||||
created by <xref linkend="sql-analyze"/>
|
created by <link linkend="sql-analyze"><command>ANALYZE</command></link>
|
||||||
and subsequently used by the query planner. Note that all the
|
and subsequently used by the query planner. Note that all the
|
||||||
statistical data is inherently approximate, even assuming that it
|
statistical data is inherently approximate, even assuming that it
|
||||||
is up-to-date.
|
is up-to-date.
|
||||||
@ -7223,7 +7223,7 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l
|
|||||||
The catalog <structname>pg_statistic_ext</structname>
|
The catalog <structname>pg_statistic_ext</structname>
|
||||||
holds definitions of extended planner statistics.
|
holds definitions of extended planner statistics.
|
||||||
Each row in this catalog corresponds to a <firstterm>statistics object</firstterm>
|
Each row in this catalog corresponds to a <firstterm>statistics object</firstterm>
|
||||||
created with <xref linkend="sql-createstatistics"/>.
|
created with <link linkend="sql-createstatistics"><command>CREATE STATISTICS</command></link>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
@ -7296,7 +7296,7 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l
|
|||||||
<para>
|
<para>
|
||||||
<structfield>stxstattarget</structfield> controls the level of detail
|
<structfield>stxstattarget</structfield> controls the level of detail
|
||||||
of statistics accumulated for this statistics object by
|
of statistics accumulated for this statistics object by
|
||||||
<xref linkend="sql-analyze"/>.
|
<link linkend="sql-analyze"><command>ANALYZE</command></link>.
|
||||||
A zero value indicates that no statistics should be collected.
|
A zero value indicates that no statistics should be collected.
|
||||||
A negative value says to use the maximum of the statistics targets of
|
A negative value says to use the maximum of the statistics targets of
|
||||||
the referenced columns, if set, or the system default statistics target.
|
the referenced columns, if set, or the system default statistics target.
|
||||||
@ -7337,9 +7337,9 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
The <structname>pg_statistic_ext</structname> entry is filled in
|
The <structname>pg_statistic_ext</structname> entry is filled in
|
||||||
completely during <xref linkend="sql-createstatistics"/>, but the actual
|
completely during <link linkend="sql-createstatistics"><command>CREATE STATISTICS</command></link>, but the actual
|
||||||
statistical values are not computed then.
|
statistical values are not computed then.
|
||||||
Subsequent <xref linkend="sql-analyze"/> commands compute the desired values
|
Subsequent <link linkend="sql-analyze"><command>ANALYZE</command></link> commands compute the desired values
|
||||||
and populate an entry in the
|
and populate an entry in the
|
||||||
<link linkend="catalog-pg-statistic-ext-data"><structname>pg_statistic_ext_data</structname></link>
|
<link linkend="catalog-pg-statistic-ext-data"><structname>pg_statistic_ext_data</structname></link>
|
||||||
catalog.
|
catalog.
|
||||||
@ -7358,7 +7358,7 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l
|
|||||||
holds data for extended planner statistics defined in
|
holds data for extended planner statistics defined in
|
||||||
<link linkend="catalog-pg-statistic-ext"><structname>pg_statistic_ext</structname></link>.
|
<link linkend="catalog-pg-statistic-ext"><structname>pg_statistic_ext</structname></link>.
|
||||||
Each row in this catalog corresponds to a <firstterm>statistics object</firstterm>
|
Each row in this catalog corresponds to a <firstterm>statistics object</firstterm>
|
||||||
created with <xref linkend="sql-createstatistics"/>.
|
created with <link linkend="sql-createstatistics"><command>CREATE STATISTICS</command></link>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
@ -7591,7 +7591,7 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
This catalog only contains tables known to the subscription after running
|
This catalog only contains tables known to the subscription after running
|
||||||
either <xref linkend="sql-createsubscription"/> or
|
either <link linkend="sql-createsubscription"><command>CREATE SUBSCRIPTION</command></link> or
|
||||||
<link linkend="sql-altersubscription"><command>ALTER SUBSCRIPTION ... REFRESH
|
<link linkend="sql-altersubscription"><command>ALTER SUBSCRIPTION ... REFRESH
|
||||||
PUBLICATION</command></link>.
|
PUBLICATION</command></link>.
|
||||||
</para>
|
</para>
|
||||||
@ -8569,9 +8569,9 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l
|
|||||||
<para>
|
<para>
|
||||||
The catalog <structname>pg_type</structname> stores information about data
|
The catalog <structname>pg_type</structname> stores information about data
|
||||||
types. Base types and enum types (scalar types) are created with
|
types. Base types and enum types (scalar types) are created with
|
||||||
<xref linkend="sql-createtype"/>, and
|
<link linkend="sql-createtype"><command>CREATE TYPE</command></link>, and
|
||||||
domains with
|
domains with
|
||||||
<xref linkend="sql-createdomain"/>.
|
<link linkend="sql-createdomain"><command>CREATE DOMAIN</command></link>.
|
||||||
A composite type is automatically created for each table in the database, to
|
A composite type is automatically created for each table in the database, to
|
||||||
represent the row structure of the table. It is also possible to create
|
represent the row structure of the table. It is also possible to create
|
||||||
composite types with <command>CREATE TYPE AS</command>.
|
composite types with <command>CREATE TYPE AS</command>.
|
||||||
@ -9791,7 +9791,7 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l
|
|||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
via the <xref linkend="sql-declare"/>
|
via the <link linkend="sql-declare"><command>DECLARE</command></link>
|
||||||
statement in SQL
|
statement in SQL
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -10917,7 +10917,7 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
|
|||||||
<structname>pg_prepared_statements</structname> contains one row
|
<structname>pg_prepared_statements</structname> contains one row
|
||||||
for each prepared statement. Rows are added to the view when a new
|
for each prepared statement. Rows are added to the view when a new
|
||||||
prepared statement is created and removed when a prepared statement
|
prepared statement is created and removed when a prepared statement
|
||||||
is released (for example, via the <xref linkend="sql-deallocate"/> command).
|
is released (for example, via the <link linkend="sql-deallocate"><command>DEALLOCATE</command></link> command).
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
@ -10951,7 +10951,7 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
|
|||||||
<para>
|
<para>
|
||||||
The query string submitted by the client to create this
|
The query string submitted by the client to create this
|
||||||
prepared statement. For prepared statements created via SQL,
|
prepared statement. For prepared statements created via SQL,
|
||||||
this is the <xref linkend="sql-prepare"/> statement submitted by
|
this is the <command>PREPARE</command> statement submitted by
|
||||||
the client. For prepared statements created via the
|
the client. For prepared statements created via the
|
||||||
frontend/backend protocol, this is the text of the prepared
|
frontend/backend protocol, this is the text of the prepared
|
||||||
statement itself.
|
statement itself.
|
||||||
@ -10985,7 +10985,7 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
|
|||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
<literal>true</literal> if the prepared statement was created
|
<literal>true</literal> if the prepared statement was created
|
||||||
via the <xref linkend="sql-prepare"/> SQL command;
|
via the <command>PREPARE</command> SQL command;
|
||||||
<literal>false</literal> if the statement was prepared via the
|
<literal>false</literal> if the statement was prepared via the
|
||||||
frontend/backend protocol
|
frontend/backend protocol
|
||||||
</para></entry>
|
</para></entry>
|
||||||
@ -11967,10 +11967,10 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
|
|||||||
<para>
|
<para>
|
||||||
The view <structname>pg_settings</structname> provides access to
|
The view <structname>pg_settings</structname> provides access to
|
||||||
run-time parameters of the server. It is essentially an alternative
|
run-time parameters of the server. It is essentially an alternative
|
||||||
interface to the <xref linkend="sql-show"/>
|
interface to the <link linkend="sql-show"><command>SHOW</command></link>
|
||||||
and <xref linkend="sql-set"/> commands.
|
and <link linkend="sql-set"><command>SET</command></link> commands.
|
||||||
It also provides access to some facts about each parameter that are
|
It also provides access to some facts about each parameter that are
|
||||||
not directly available from <command>SHOW</command>, such as minimum and
|
not directly available from <link linkend="sql-show"><command>SHOW</command></link>, such as minimum and
|
||||||
maximum values.
|
maximum values.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -12116,7 +12116,7 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
|
|||||||
<structfield>reset_val</structfield> <type>text</type>
|
<structfield>reset_val</structfield> <type>text</type>
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
Value that <xref linkend="sql-reset"/> would reset the parameter to
|
Value that <link linkend="sql-reset"><command>RESET</command></link> would reset the parameter to
|
||||||
in the current session
|
in the current session
|
||||||
</para></entry>
|
</para></entry>
|
||||||
</row>
|
</row>
|
||||||
@ -12249,7 +12249,7 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
These settings can be set from <filename>postgresql.conf</filename>,
|
These settings can be set from <filename>postgresql.conf</filename>,
|
||||||
or within a session via the <xref linkend="sql-set"/> command; but only superusers
|
or within a session via the <command>SET</command> command; but only superusers
|
||||||
can change them via <command>SET</command>. Changes in
|
can change them via <command>SET</command>. Changes in
|
||||||
<filename>postgresql.conf</filename> will affect existing sessions
|
<filename>postgresql.conf</filename> will affect existing sessions
|
||||||
only if no session-local value has been established with <command>SET</command>.
|
only if no session-local value has been established with <command>SET</command>.
|
||||||
@ -12262,7 +12262,7 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
These settings can be set from <filename>postgresql.conf</filename>,
|
These settings can be set from <filename>postgresql.conf</filename>,
|
||||||
or within a session via the <xref linkend="sql-set"/> command. Any user is
|
or within a session via the <command>SET</command> command. Any user is
|
||||||
allowed to change their session-local value. Changes in
|
allowed to change their session-local value. Changes in
|
||||||
<filename>postgresql.conf</filename> will affect existing sessions
|
<filename>postgresql.conf</filename> will affect existing sessions
|
||||||
only if no session-local value has been established with <command>SET</command>.
|
only if no session-local value has been established with <command>SET</command>.
|
||||||
@ -12278,9 +12278,9 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
The <structname>pg_settings</structname> view cannot be inserted into or
|
The <structname>pg_settings</structname> view cannot be inserted into or
|
||||||
deleted from, but it can be updated. An <xref linkend="sql-update"/> applied
|
deleted from, but it can be updated. An <command>UPDATE</command> applied
|
||||||
to a row of <structname>pg_settings</structname> is equivalent to executing
|
to a row of <structname>pg_settings</structname> is equivalent to executing
|
||||||
the <xref linkend="sql-set"/> command on that named
|
the <command>SET</command> command on that named
|
||||||
parameter. The change only affects the value used by the current
|
parameter. The change only affects the value used by the current
|
||||||
session. If an <command>UPDATE</command> is issued within a transaction
|
session. If an <command>UPDATE</command> is issued within a transaction
|
||||||
that is later aborted, the effects of the <command>UPDATE</command> command
|
that is later aborted, the effects of the <command>UPDATE</command> command
|
||||||
@ -12622,7 +12622,7 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
|
|||||||
If greater than zero, the estimated number of distinct values in the
|
If greater than zero, the estimated number of distinct values in the
|
||||||
column. If less than zero, the negative of the number of distinct
|
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
|
values divided by the number of rows. (The negated form is used when
|
||||||
<xref linkend="sql-analyze"/> believes that the number of distinct values is
|
<command>ANALYZE</command> believes that the number of distinct values is
|
||||||
likely to increase as the table grows; the positive form is used when
|
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
|
the column seems to have a fixed number of possible values.) For
|
||||||
example, -1 indicates a unique column in which the number of distinct
|
example, -1 indicates a unique column in which the number of distinct
|
||||||
@ -12846,7 +12846,7 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx
|
|||||||
than zero, the estimated number of distinct values in the combination.
|
than zero, the estimated number of distinct values in the combination.
|
||||||
If less than zero, the negative of the number of distinct values divided
|
If less than zero, the negative of the number of distinct values divided
|
||||||
by the number of rows.
|
by the number of rows.
|
||||||
(The negated form is used when <xref linkend="sql-analyze"/> believes that
|
(The negated form is used when <command>ANALYZE</command> believes that
|
||||||
the number of distinct values is likely to increase as the table grows;
|
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
|
the positive form is used when the column seems to have a fixed number
|
||||||
of possible values.) For example, -1 indicates a unique combination of
|
of possible values.) For example, -1 indicates a unique combination of
|
||||||
|
@ -189,7 +189,7 @@ shared_buffers = 128MB
|
|||||||
<filename>postgresql.auto.conf</filename><indexterm><primary>postgresql.auto.conf</primary></indexterm>,
|
<filename>postgresql.auto.conf</filename><indexterm><primary>postgresql.auto.conf</primary></indexterm>,
|
||||||
which has the same format as <filename>postgresql.conf</filename> but
|
which has the same format as <filename>postgresql.conf</filename> but
|
||||||
is intended to be edited automatically, not manually. This file holds
|
is intended to be edited automatically, not manually. This file holds
|
||||||
settings provided through the <xref linkend="sql-altersystem"/> command.
|
settings provided through the <link linkend="sql-altersystem"><command>ALTER SYSTEM</command></link> command.
|
||||||
This file is read whenever <filename>postgresql.conf</filename> is,
|
This file is read whenever <filename>postgresql.conf</filename> is,
|
||||||
and its settings take effect in the same way. Settings
|
and its settings take effect in the same way. Settings
|
||||||
in <filename>postgresql.auto.conf</filename> override those
|
in <filename>postgresql.auto.conf</filename> override those
|
||||||
@ -221,7 +221,7 @@ shared_buffers = 128MB
|
|||||||
<para>
|
<para>
|
||||||
<productname>PostgreSQL</productname> provides three SQL
|
<productname>PostgreSQL</productname> provides three SQL
|
||||||
commands to establish configuration defaults.
|
commands to establish configuration defaults.
|
||||||
The already-mentioned <xref linkend="sql-altersystem"/> command
|
The already-mentioned <command>ALTER SYSTEM</command> command
|
||||||
provides a SQL-accessible means of changing global defaults; it is
|
provides a SQL-accessible means of changing global defaults; it is
|
||||||
functionally equivalent to editing <filename>postgresql.conf</filename>.
|
functionally equivalent to editing <filename>postgresql.conf</filename>.
|
||||||
In addition, there are two commands that allow setting of defaults
|
In addition, there are two commands that allow setting of defaults
|
||||||
@ -231,14 +231,14 @@ shared_buffers = 128MB
|
|||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The <xref linkend="sql-alterdatabase"/> command allows global
|
The <link linkend="sql-alterdatabase"><command>ALTER DATABASE</command></link> command allows global
|
||||||
settings to be overridden on a per-database basis.
|
settings to be overridden on a per-database basis.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The <xref linkend="sql-alterrole"/> command allows both global and
|
The <link linkend="sql-alterrole"><command>ALTER ROLE</command></link> command allows both global and
|
||||||
per-database settings to be overridden with user-specific values.
|
per-database settings to be overridden with user-specific values.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -262,7 +262,7 @@ shared_buffers = 128MB
|
|||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The <xref linkend="sql-show"/> command allows inspection of the
|
The <link linkend="sql-show"><command>SHOW</command></link> command allows inspection of the
|
||||||
current value of all parameters. The corresponding function is
|
current value of all parameters. The corresponding function is
|
||||||
<function>current_setting(setting_name text)</function>.
|
<function>current_setting(setting_name text)</function>.
|
||||||
</para>
|
</para>
|
||||||
@ -270,7 +270,7 @@ shared_buffers = 128MB
|
|||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The <xref linkend="sql-set"/> command allows modification of the
|
The <link linkend="sql-set"><command>SET</command></link> command allows modification of the
|
||||||
current value of those parameters that can be set locally to a
|
current value of those parameters that can be set locally to a
|
||||||
session; it has no effect on other sessions.
|
session; it has no effect on other sessions.
|
||||||
The corresponding function is
|
The corresponding function is
|
||||||
@ -296,7 +296,7 @@ shared_buffers = 128MB
|
|||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Using <xref linkend="sql-update"/> on this view, specifically
|
Using <command>UPDATE</command> on this view, specifically
|
||||||
updating the <structname>setting</structname> column, is the equivalent
|
updating the <structname>setting</structname> column, is the equivalent
|
||||||
of issuing <command>SET</command> commands. For example, the equivalent of
|
of issuing <command>SET</command> commands. For example, the equivalent of
|
||||||
<programlisting>
|
<programlisting>
|
||||||
@ -4608,7 +4608,7 @@ ANY <replaceable class="parameter">num_sync</replaceable> ( <replaceable class="
|
|||||||
Better ways to improve the quality of the
|
Better ways to improve the quality of the
|
||||||
plans chosen by the optimizer include adjusting the planner cost
|
plans chosen by the optimizer include adjusting the planner cost
|
||||||
constants (see <xref linkend="runtime-config-query-constants"/>),
|
constants (see <xref linkend="runtime-config-query-constants"/>),
|
||||||
running <xref linkend="sql-analyze"/> manually, increasing
|
running <link linkend="sql-analyze"><command>ANALYZE</command></link> manually, increasing
|
||||||
the value of the <xref
|
the value of the <xref
|
||||||
linkend="guc-default-statistics-target"/> configuration parameter,
|
linkend="guc-default-statistics-target"/> configuration parameter,
|
||||||
and increasing the amount of statistics collected for
|
and increasing the amount of statistics collected for
|
||||||
@ -8095,7 +8095,7 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
|
|||||||
set it to <literal>replica</literal> when they are applying replicated
|
set it to <literal>replica</literal> when they are applying replicated
|
||||||
changes. The effect of that will be that triggers and rules (that
|
changes. The effect of that will be that triggers and rules (that
|
||||||
have not been altered from their default configuration) will not fire
|
have not been altered from their default configuration) will not fire
|
||||||
on the replica. See the <xref linkend="sql-altertable"/> clauses
|
on the replica. See the <link linkend="sql-altertable"><command>ALTER TABLE</command></link> clauses
|
||||||
<literal>ENABLE TRIGGER</literal> and <literal>ENABLE RULE</literal>
|
<literal>ENABLE TRIGGER</literal> and <literal>ENABLE RULE</literal>
|
||||||
for more information.
|
for more information.
|
||||||
</para>
|
</para>
|
||||||
@ -8781,7 +8781,7 @@ SET XML OPTION { DOCUMENT | CONTENT };
|
|||||||
This variable specifies one or more shared libraries that are to be
|
This variable specifies one or more shared libraries that are to be
|
||||||
preloaded at connection start.
|
preloaded at connection start.
|
||||||
It contains a comma-separated list of library names, where each name
|
It contains a comma-separated list of library names, where each name
|
||||||
is interpreted as for the <xref linkend="sql-load"/> command.
|
is interpreted as for the <link linkend="sql-load"><command>LOAD</command></link> command.
|
||||||
Whitespace between entries is ignored; surround a library name with
|
Whitespace between entries is ignored; surround a library name with
|
||||||
double quotes if you need to include whitespace or commas in the name.
|
double quotes if you need to include whitespace or commas in the name.
|
||||||
The parameter value only takes effect at the start of the connection.
|
The parameter value only takes effect at the start of the connection.
|
||||||
@ -8832,7 +8832,7 @@ SET XML OPTION { DOCUMENT | CONTENT };
|
|||||||
This variable specifies one or more shared libraries that are to be
|
This variable specifies one or more shared libraries that are to be
|
||||||
preloaded at connection start.
|
preloaded at connection start.
|
||||||
It contains a comma-separated list of library names, where each name
|
It contains a comma-separated list of library names, where each name
|
||||||
is interpreted as for the <xref linkend="sql-load"/> command.
|
is interpreted as for the <link linkend="sql-load"><command>LOAD</command></link> command.
|
||||||
Whitespace between entries is ignored; surround a library name with
|
Whitespace between entries is ignored; surround a library name with
|
||||||
double quotes if you need to include whitespace or commas in the name.
|
double quotes if you need to include whitespace or commas in the name.
|
||||||
The parameter value only takes effect at the start of the connection.
|
The parameter value only takes effect at the start of the connection.
|
||||||
@ -8874,7 +8874,7 @@ SET XML OPTION { DOCUMENT | CONTENT };
|
|||||||
This variable specifies one or more shared libraries to be preloaded at
|
This variable specifies one or more shared libraries to be preloaded at
|
||||||
server start.
|
server start.
|
||||||
It contains a comma-separated list of library names, where each name
|
It contains a comma-separated list of library names, where each name
|
||||||
is interpreted as for the <xref linkend="sql-load"/> command.
|
is interpreted as for the <link linkend="sql-load"><command>LOAD</command></link> command.
|
||||||
Whitespace between entries is ignored; surround a library name with
|
Whitespace between entries is ignored; surround a library name with
|
||||||
double quotes if you need to include whitespace or commas in the name.
|
double quotes if you need to include whitespace or commas in the name.
|
||||||
This parameter can only be set at server start. If a specified
|
This parameter can only be set at server start. If a specified
|
||||||
|
@ -1675,12 +1675,12 @@ REVOKE ALL ON accounts FROM PUBLIC;
|
|||||||
<term><literal>SELECT</literal></term>
|
<term><literal>SELECT</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Allows <xref linkend="sql-select"/> from
|
Allows <command>SELECT</command> from
|
||||||
any column, or specific column(s), of a table, view, materialized
|
any column, or specific column(s), of a table, view, materialized
|
||||||
view, or other table-like object.
|
view, or other table-like object.
|
||||||
Also allows use of <xref linkend="sql-copy"/> TO.
|
Also allows use of <command>COPY TO</command>.
|
||||||
This privilege is also needed to reference existing column values in
|
This privilege is also needed to reference existing column values in
|
||||||
<xref linkend="sql-update"/> or <xref linkend="sql-delete"/>.
|
<command>UPDATE</command> or <command>DELETE</command>.
|
||||||
For sequences, this privilege also allows use of the
|
For sequences, this privilege also allows use of the
|
||||||
<function>currval</function> function.
|
<function>currval</function> function.
|
||||||
For large objects, this privilege allows the object to be read.
|
For large objects, this privilege allows the object to be read.
|
||||||
@ -1692,11 +1692,11 @@ REVOKE ALL ON accounts FROM PUBLIC;
|
|||||||
<term><literal>INSERT</literal></term>
|
<term><literal>INSERT</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Allows <xref linkend="sql-insert"/> of a new row into a table, view,
|
Allows <command>INSERT</command> of a new row into a table, view,
|
||||||
etc. Can be granted on specific column(s), in which case
|
etc. Can be granted on specific column(s), in which case
|
||||||
only those columns may be assigned to in the <command>INSERT</command>
|
only those columns may be assigned to in the <command>INSERT</command>
|
||||||
command (other columns will therefore receive default values).
|
command (other columns will therefore receive default values).
|
||||||
Also allows use of <xref linkend="sql-copy"/> FROM.
|
Also allows use of <command>COPY FROM</command>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -1705,7 +1705,7 @@ REVOKE ALL ON accounts FROM PUBLIC;
|
|||||||
<term><literal>UPDATE</literal></term>
|
<term><literal>UPDATE</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Allows <xref linkend="sql-update"/> of any
|
Allows <command>UPDATE</command> of any
|
||||||
column, or specific column(s), of a table, view, etc.
|
column, or specific column(s), of a table, view, etc.
|
||||||
(In practice, any nontrivial <command>UPDATE</command> command will
|
(In practice, any nontrivial <command>UPDATE</command> command will
|
||||||
require <literal>SELECT</literal> privilege as well, since it must
|
require <literal>SELECT</literal> privilege as well, since it must
|
||||||
@ -1727,7 +1727,7 @@ REVOKE ALL ON accounts FROM PUBLIC;
|
|||||||
<term><literal>DELETE</literal></term>
|
<term><literal>DELETE</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Allows <xref linkend="sql-delete"/> of a row from a table, view, etc.
|
Allows <command>DELETE</command> of a row from a table, view, etc.
|
||||||
(In practice, any nontrivial <command>DELETE</command> command will
|
(In practice, any nontrivial <command>DELETE</command> command will
|
||||||
require <literal>SELECT</literal> privilege as well, since it must
|
require <literal>SELECT</literal> privilege as well, since it must
|
||||||
reference table columns to determine which rows to delete.)
|
reference table columns to determine which rows to delete.)
|
||||||
@ -1739,7 +1739,7 @@ REVOKE ALL ON accounts FROM PUBLIC;
|
|||||||
<term><literal>TRUNCATE</literal></term>
|
<term><literal>TRUNCATE</literal></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Allows <xref linkend="sql-truncate"/> on a table, view, etc.
|
Allows <command>TRUNCATE</command> on a table, view, etc.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -3370,11 +3370,11 @@ VALUES ('Albany', NULL, NULL, 'NY');
|
|||||||
<para>
|
<para>
|
||||||
Table inheritance is typically established when the child table is
|
Table inheritance is typically established when the child table is
|
||||||
created, using the <literal>INHERITS</literal> clause of the
|
created, using the <literal>INHERITS</literal> clause of the
|
||||||
<xref linkend="sql-createtable"/>
|
<link linkend="sql-createtable"><command>CREATE TABLE</command></link>
|
||||||
statement.
|
statement.
|
||||||
Alternatively, a table which is already defined in a compatible way can
|
Alternatively, a table which is already defined in a compatible way can
|
||||||
have a new parent relationship added, using the <literal>INHERIT</literal>
|
have a new parent relationship added, using the <literal>INHERIT</literal>
|
||||||
variant of <xref linkend="sql-altertable"/>.
|
variant of <link linkend="sql-altertable"><command>ALTER TABLE</command></link>.
|
||||||
To do this the new child table must already include columns with
|
To do this the new child table must already include columns with
|
||||||
the same names and types as the columns of the parent. It must also include
|
the same names and types as the columns of the parent. It must also include
|
||||||
check constraints with the same names and check expressions as those of the
|
check constraints with the same names and check expressions as those of the
|
||||||
@ -3406,7 +3406,7 @@ VALUES ('Albany', NULL, NULL, 'NY');
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<xref linkend="sql-altertable"/> will
|
<command>ALTER TABLE</command> will
|
||||||
propagate any changes in column data definitions and check
|
propagate any changes in column data definitions and check
|
||||||
constraints down the inheritance hierarchy. Again, dropping
|
constraints down the inheritance hierarchy. Again, dropping
|
||||||
columns that are depended on by other tables is only possible when using
|
columns that are depended on by other tables is only possible when using
|
||||||
|
@ -245,7 +245,7 @@ UPDATE mytable SET a = 5, b = 3, c = 1 WHERE a > 0;
|
|||||||
<para>
|
<para>
|
||||||
You use the <xref linkend="sql-delete"/>
|
You use the <xref linkend="sql-delete"/>
|
||||||
command to remove rows; the syntax is very similar to the
|
command to remove rows; the syntax is very similar to the
|
||||||
<command>UPDATE</command> command. For instance, to remove all
|
<xref linkend="sql-update"/> command. For instance, to remove all
|
||||||
rows from the products table that have a price of 10, use:
|
rows from the products table that have a price of 10, use:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
DELETE FROM products WHERE price = 10;
|
DELETE FROM products WHERE price = 10;
|
||||||
|
@ -479,10 +479,9 @@ EXEC SQL COMMIT;
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
For more details about declaration of the cursor,
|
For more details about declaring a cursor, see <xref
|
||||||
see <xref linkend="ecpg-sql-declare"/>, and
|
linkend="ecpg-sql-declare"/>; for more details about fetching rows from a
|
||||||
see <xref linkend="sql-fetch"/> for <literal>FETCH</literal> command
|
cursor, see <xref linkend="sql-fetch"/>.
|
||||||
details.
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<note>
|
<note>
|
||||||
|
@ -504,7 +504,7 @@ RETURNS anycompatible AS ...
|
|||||||
of the extension itself. If the extension includes C code, there
|
of the extension itself. If the extension includes C code, there
|
||||||
will typically also be a shared library file into which the C code
|
will typically also be a shared library file into which the C code
|
||||||
has been built. Once you have these files, a simple
|
has been built. Once you have these files, a simple
|
||||||
<xref linkend="sql-createextension"/> command loads the objects into
|
<link linkend="sql-createextension"><command>CREATE EXTENSION</command></link> command loads the objects into
|
||||||
your database.
|
your database.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -513,7 +513,7 @@ RETURNS anycompatible AS ...
|
|||||||
<acronym>SQL</acronym> script to load a bunch of <quote>loose</quote> objects
|
<acronym>SQL</acronym> script to load a bunch of <quote>loose</quote> objects
|
||||||
into your database, is that <productname>PostgreSQL</productname> will then
|
into your database, is that <productname>PostgreSQL</productname> will then
|
||||||
understand that the objects of the extension go together. You can
|
understand that the objects of the extension go together. You can
|
||||||
drop all the objects with a single <xref linkend="sql-dropextension"/>
|
drop all the objects with a single <link linkend="sql-dropextension"><command>DROP EXTENSION</command></link>
|
||||||
command (no need to maintain a separate <quote>uninstall</quote> script).
|
command (no need to maintain a separate <quote>uninstall</quote> script).
|
||||||
Even more useful, <application>pg_dump</application> knows that it should not
|
Even more useful, <application>pg_dump</application> knows that it should not
|
||||||
dump the individual member objects of the extension — it will
|
dump the individual member objects of the extension — it will
|
||||||
@ -572,7 +572,7 @@ RETURNS anycompatible AS ...
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
The kinds of SQL objects that can be members of an extension are shown in
|
The kinds of SQL objects that can be members of an extension are shown in
|
||||||
the description of <xref linkend="sql-alterextension"/>. Notably, objects
|
the description of <link linkend="sql-alterextension"><command>ALTER EXTENSION</command></link>. Notably, objects
|
||||||
that are database-cluster-wide, such as databases, roles, and tablespaces,
|
that are database-cluster-wide, such as databases, roles, and tablespaces,
|
||||||
cannot be extension members since an extension is only known within one
|
cannot be extension members since an extension is only known within one
|
||||||
database. (Although an extension script is not prohibited from creating
|
database. (Although an extension script is not prohibited from creating
|
||||||
@ -605,7 +605,7 @@ RETURNS anycompatible AS ...
|
|||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The <xref linkend="sql-createextension"/> command relies on a control
|
The <command>CREATE EXTENSION</command> command relies on a control
|
||||||
file for each extension, which must be named the same as the extension
|
file for each extension, which must be named the same as the extension
|
||||||
with a suffix of <literal>.control</literal>, and must be placed in the
|
with a suffix of <literal>.control</literal>, and must be placed in the
|
||||||
installation's <literal>SHAREDIR/extension</literal> directory. There
|
installation's <literal>SHAREDIR/extension</literal> directory. There
|
||||||
@ -1373,7 +1373,7 @@ include $(PGXS)
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
Once the files are installed, use the
|
Once the files are installed, use the
|
||||||
<xref linkend="sql-createextension"/> command to load the objects into
|
<command>CREATE EXTENSION</command> command to load the objects into
|
||||||
any particular database.
|
any particular database.
|
||||||
</para>
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
|
@ -147,13 +147,13 @@
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
A publication is created using the <xref linkend="sql-createpublication"/>
|
A publication is created using the <link linkend="sql-createpublication"><command>CREATE PUBLICATION</command></link>
|
||||||
command and may later be altered or dropped using corresponding commands.
|
command and may later be altered or dropped using corresponding commands.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The individual tables can be added and removed dynamically using
|
The individual tables can be added and removed dynamically using
|
||||||
<xref linkend="sql-alterpublication"/>. Both the <literal>ADD
|
<link linkend="sql-alterpublication"><command>ALTER PUBLICATION</command></link>. Both the <literal>ADD
|
||||||
TABLE</literal> and <literal>DROP TABLE</literal> operations are
|
TABLE</literal> and <literal>DROP TABLE</literal> operations are
|
||||||
transactional; so the table will start or stop replicating at the correct
|
transactional; so the table will start or stop replicating at the correct
|
||||||
snapshot once the transaction has committed.
|
snapshot once the transaction has committed.
|
||||||
@ -207,10 +207,10 @@
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The subscription is added using <xref linkend="sql-createsubscription"/> and
|
The subscription is added using <link linkend="sql-createsubscription"><command>CREATE SUBSCRIPTION</command></link> and
|
||||||
can be stopped/resumed at any time using the
|
can be stopped/resumed at any time using the
|
||||||
<xref linkend="sql-altersubscription"/> command and removed using
|
<link linkend="sql-altersubscription"><command>ALTER SUBSCRIPTION</command></link> command and removed using
|
||||||
<xref linkend="sql-dropsubscription"/>.
|
<link linkend="sql-dropsubscription"><command>DROP SUBSCRIPTION</command></link>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
@ -418,7 +418,7 @@
|
|||||||
tables.) Publications can also specify that changes are to be replicated
|
tables.) Publications can also specify that changes are to be replicated
|
||||||
using the identity and schema of the partitioned root table instead of
|
using the identity and schema of the partitioned root table instead of
|
||||||
that of the individual leaf partitions in which the changes actually
|
that of the individual leaf partitions in which the changes actually
|
||||||
originate (see <xref linkend="sql-createpublication"/>).
|
originate (see <link linkend="sql-createpublication"><command>CREATE PUBLICATION</command></link>).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
|
@ -87,7 +87,7 @@
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
<productname>PostgreSQL</productname>'s
|
<productname>PostgreSQL</productname>'s
|
||||||
<xref linkend="sql-vacuum"/> command has to
|
<link linkend="sql-vacuum"><command>VACUUM</command></link> command has to
|
||||||
process each table on a regular basis for several reasons:
|
process each table on a regular basis for several reasons:
|
||||||
|
|
||||||
<orderedlist>
|
<orderedlist>
|
||||||
@ -227,9 +227,9 @@
|
|||||||
massive update or delete activity. If you have such a table and
|
massive update or delete activity. If you have such a table and
|
||||||
you need to reclaim the excess disk space it occupies, you will need
|
you need to reclaim the excess disk space it occupies, you will need
|
||||||
to use <command>VACUUM FULL</command>, or alternatively
|
to use <command>VACUUM FULL</command>, or alternatively
|
||||||
<xref linkend="sql-cluster"/>
|
<link linkend="sql-cluster"><command>CLUSTER</command></link>
|
||||||
or one of the table-rewriting variants of
|
or one of the table-rewriting variants of
|
||||||
<xref linkend="sql-altertable"/>.
|
<link linkend="sql-altertable"><command>ALTER TABLE</command></link>.
|
||||||
These commands rewrite an entire new copy of the table and build
|
These commands rewrite an entire new copy of the table and build
|
||||||
new indexes for it. All these options require exclusive lock. Note that
|
new indexes for it. All these options require exclusive lock. Note that
|
||||||
they also temporarily use extra disk space approximately equal to the size
|
they also temporarily use extra disk space approximately equal to the size
|
||||||
@ -242,7 +242,7 @@
|
|||||||
<para>
|
<para>
|
||||||
If you have a table whose entire contents are deleted on a periodic
|
If you have a table whose entire contents are deleted on a periodic
|
||||||
basis, consider doing it with
|
basis, consider doing it with
|
||||||
<xref linkend="sql-truncate"/> rather
|
<link linkend="sql-truncate"><command>TRUNCATE</command></link> rather
|
||||||
than using <command>DELETE</command> followed by
|
than using <command>DELETE</command> followed by
|
||||||
<command>VACUUM</command>. <command>TRUNCATE</command> removes the
|
<command>VACUUM</command>. <command>TRUNCATE</command> removes the
|
||||||
entire content of the table immediately, without requiring a
|
entire content of the table immediately, without requiring a
|
||||||
@ -269,7 +269,7 @@
|
|||||||
The <productname>PostgreSQL</productname> query planner relies on
|
The <productname>PostgreSQL</productname> query planner relies on
|
||||||
statistical information about the contents of tables in order to
|
statistical information about the contents of tables in order to
|
||||||
generate good plans for queries. These statistics are gathered by
|
generate good plans for queries. These statistics are gathered by
|
||||||
the <xref linkend="sql-analyze"/> command,
|
the <link linkend="sql-analyze"><command>ANALYZE</command></link> command,
|
||||||
which can be invoked by itself or
|
which can be invoked by itself or
|
||||||
as an optional step in <command>VACUUM</command>. It is important to have
|
as an optional step in <command>VACUUM</command>. It is important to have
|
||||||
reasonably accurate statistics, otherwise poor choices of plans might
|
reasonably accurate statistics, otherwise poor choices of plans might
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
<command>ps</command>, <command>top</command>, <command>iostat</command>, and <command>vmstat</command>.
|
<command>ps</command>, <command>top</command>, <command>iostat</command>, and <command>vmstat</command>.
|
||||||
Also, once one has identified a
|
Also, once one has identified a
|
||||||
poorly-performing query, further investigation might be needed using
|
poorly-performing query, further investigation might be needed using
|
||||||
<productname>PostgreSQL</productname>'s <xref linkend="sql-explain"/> command.
|
<productname>PostgreSQL</productname>'s <link linkend="sql-explain"><command>EXPLAIN</command></link> command.
|
||||||
<xref linkend="using-explain"/> discusses <command>EXPLAIN</command>
|
<xref linkend="using-explain"/> discusses <command>EXPLAIN</command>
|
||||||
and other methods for understanding the behavior of an individual
|
and other methods for understanding the behavior of an individual
|
||||||
query.
|
query.
|
||||||
@ -5278,8 +5278,8 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS pid,
|
|||||||
<note>
|
<note>
|
||||||
<para>
|
<para>
|
||||||
Note that when <command>ANALYZE</command> is run on a partitioned table,
|
Note that when <command>ANALYZE</command> is run on a partitioned table,
|
||||||
all of its partitions are also recursively analyzed as also mentioned in
|
all of its partitions are also recursively analyzed.
|
||||||
<xref linkend="sql-analyze"/>. In that case, <command>ANALYZE</command>
|
In that case, <command>ANALYZE</command>
|
||||||
progress is reported first for the parent table, whereby its inheritance
|
progress is reported first for the parent table, whereby its inheritance
|
||||||
statistics are collected, followed by that for each partition.
|
statistics are collected, followed by that for each partition.
|
||||||
</para>
|
</para>
|
||||||
|
@ -950,10 +950,9 @@ ERROR: could not serialize access due to read/write dependencies among transact
|
|||||||
Acquired by <command>VACUUM</command> (without <option>FULL</option>),
|
Acquired by <command>VACUUM</command> (without <option>FULL</option>),
|
||||||
<command>ANALYZE</command>, <command>CREATE INDEX CONCURRENTLY</command>,
|
<command>ANALYZE</command>, <command>CREATE INDEX CONCURRENTLY</command>,
|
||||||
<command>REINDEX CONCURRENTLY</command>,
|
<command>REINDEX CONCURRENTLY</command>,
|
||||||
<command>CREATE STATISTICS</command>, and certain <command>ALTER
|
<command>CREATE STATISTICS</command>, and certain <link linkend="sql-alterindex"><command>ALTER
|
||||||
INDEX</command> and <command>ALTER TABLE</command> variants (for full
|
INDEX</command></link> and <link linkend="sql-altertable"><command>ALTER TABLE</command></link> variants (for full
|
||||||
details see <xref linkend="sql-alterindex"/> and <xref
|
details see the documentation of these commands).
|
||||||
linkend="sql-altertable"/>).
|
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -995,7 +994,7 @@ ERROR: could not serialize access due to read/write dependencies among transact
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
Acquired by <command>CREATE TRIGGER</command> and some forms of
|
Acquired by <command>CREATE TRIGGER</command> and some forms of
|
||||||
<command>ALTER TABLE</command> (see <xref linkend="sql-altertable"/>).
|
<link linkend="sql-altertable"><command>ALTER TABLE</command></link>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -1723,8 +1722,8 @@ SELECT pg_advisory_lock(q.id) FROM
|
|||||||
<title>Caveats</title>
|
<title>Caveats</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Some DDL commands, currently only <xref linkend="sql-truncate"/> and the
|
Some DDL commands, currently only <link linkend="sql-truncate"><command>TRUNCATE</command></link> and the
|
||||||
table-rewriting forms of <xref linkend="sql-altertable"/>, are not
|
table-rewriting forms of <link linkend="sql-altertable"><command>ALTER TABLE</command></link>, are not
|
||||||
MVCC-safe. This means that after the truncation or rewrite commits, the
|
MVCC-safe. This means that after the truncation or rewrite commits, the
|
||||||
table will appear empty to concurrent transactions, if they are using a
|
table will appear empty to concurrent transactions, if they are using a
|
||||||
snapshot taken before the DDL command committed. This will only be an
|
snapshot taken before the DDL command committed. This will only be an
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
plan to match the query structure and the properties of the data
|
plan to match the query structure and the properties of the data
|
||||||
is absolutely critical for good performance, so the system includes
|
is absolutely critical for good performance, so the system includes
|
||||||
a complex <firstterm>planner</firstterm> that tries to choose good plans.
|
a complex <firstterm>planner</firstterm> that tries to choose good plans.
|
||||||
You can use the <xref linkend="sql-explain"/> command
|
You can use the <link linkend="sql-explain"><command>EXPLAIN</command></link> command
|
||||||
to see what query plan the planner creates for any query.
|
to see what query plan the planner creates for any query.
|
||||||
Plan-reading is an art that requires some experience to master,
|
Plan-reading is an art that requires some experience to master,
|
||||||
but this section attempts to cover the basics.
|
but this section attempts to cover the basics.
|
||||||
@ -1144,7 +1144,7 @@ WHERE tablename = 'road';
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
Statistics objects are created using the
|
Statistics objects are created using the
|
||||||
<xref linkend="sql-createstatistics"/> command.
|
<link linkend="sql-createstatistics"><command>CREATE STATISTICS</command></link> command.
|
||||||
Creation of such an object merely creates a catalog entry expressing
|
Creation of such an object merely creates a catalog entry expressing
|
||||||
interest in the statistics. Actual data collection is performed
|
interest in the statistics. Actual data collection is performed
|
||||||
by <command>ANALYZE</command> (either a manual command, or background
|
by <command>ANALYZE</command> (either a manual command, or background
|
||||||
@ -1612,7 +1612,7 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse;
|
|||||||
<title>Use <command>COPY</command></title>
|
<title>Use <command>COPY</command></title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Use <xref linkend="sql-copy"/> to load
|
Use <link linkend="sql-copy"><command>COPY</command></link> to load
|
||||||
all the rows in one command, instead of using a series of
|
all the rows in one command, instead of using a series of
|
||||||
<command>INSERT</command> commands. The <command>COPY</command>
|
<command>INSERT</command> commands. The <command>COPY</command>
|
||||||
command is optimized for loading large numbers of rows; it is less
|
command is optimized for loading large numbers of rows; it is less
|
||||||
@ -1623,8 +1623,8 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse;
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
If you cannot use <command>COPY</command>, it might help to use <xref
|
If you cannot use <command>COPY</command>, it might help to use <link
|
||||||
linkend="sql-prepare"/> to create a
|
linkend="sql-prepare"><command>PREPARE</command></link> to create a
|
||||||
prepared <command>INSERT</command> statement, and then use
|
prepared <command>INSERT</command> statement, and then use
|
||||||
<command>EXECUTE</command> as many times as required. This avoids
|
<command>EXECUTE</command> as many times as required. This avoids
|
||||||
some of the overhead of repeatedly parsing and planning
|
some of the overhead of repeatedly parsing and planning
|
||||||
@ -1763,7 +1763,7 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse;
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
Whenever you have significantly altered the distribution of data
|
Whenever you have significantly altered the distribution of data
|
||||||
within a table, running <xref linkend="sql-analyze"/> is strongly recommended. This
|
within a table, running <link linkend="sql-analyze"><command>ANALYZE</command></link> is strongly recommended. This
|
||||||
includes bulk loading large amounts of data into the table. Running
|
includes bulk loading large amounts of data into the table. Running
|
||||||
<command>ANALYZE</command> (or <command>VACUUM ANALYZE</command>)
|
<command>ANALYZE</command> (or <command>VACUUM ANALYZE</command>)
|
||||||
ensures that the planner has up-to-date statistics about the
|
ensures that the planner has up-to-date statistics about the
|
||||||
|
@ -1299,7 +1299,7 @@ EXECUTE format('SELECT count(*) FROM %I '
|
|||||||
<para>
|
<para>
|
||||||
The <application>PL/pgSQL</application>
|
The <application>PL/pgSQL</application>
|
||||||
<command>EXECUTE</command> statement is not related to the
|
<command>EXECUTE</command> statement is not related to the
|
||||||
<xref linkend="sql-execute"/> SQL
|
<link linkend="sql-execute"><command>EXECUTE</command></link> SQL
|
||||||
statement supported by the
|
statement supported by the
|
||||||
<productname>PostgreSQL</productname> server. The server's
|
<productname>PostgreSQL</productname> server. The server's
|
||||||
<command>EXECUTE</command> statement cannot be used directly within
|
<command>EXECUTE</command> statement cannot be used directly within
|
||||||
|
@ -456,14 +456,14 @@ OPTIONS (ADD password_required 'false');
|
|||||||
<para>
|
<para>
|
||||||
Note that constraints other than <literal>NOT NULL</literal> will never be
|
Note that constraints other than <literal>NOT NULL</literal> will never be
|
||||||
imported from the remote tables. Although <productname>PostgreSQL</productname>
|
imported from the remote tables. Although <productname>PostgreSQL</productname>
|
||||||
does support <literal>CHECK</literal> constraints on foreign tables, there is no
|
does support check constraints on foreign tables, there is no
|
||||||
provision for importing them automatically, because of the risk that a
|
provision for importing them automatically, because of the risk that a
|
||||||
constraint expression could evaluate differently on the local and remote
|
constraint expression could evaluate differently on the local and remote
|
||||||
servers. Any such inconsistency in the behavior of a <literal>CHECK</literal>
|
servers. Any such inconsistency in the behavior of a check
|
||||||
constraint could lead to hard-to-detect errors in query optimization.
|
constraint could lead to hard-to-detect errors in query optimization.
|
||||||
So if you wish to import <literal>CHECK</literal> constraints, you must do so
|
So if you wish to import check constraints, you must do so
|
||||||
manually, and you should verify the semantics of each one carefully.
|
manually, and you should verify the semantics of each one carefully.
|
||||||
For more detail about the treatment of <literal>CHECK</literal> constraints on
|
For more detail about the treatment of check constraints on
|
||||||
foreign tables, see <xref linkend="sql-createforeigntable"/>.
|
foreign tables, see <xref linkend="sql-createforeigntable"/>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -705,7 +705,7 @@ CREATE FOREIGN TABLE foreign_table (
|
|||||||
Column names must match as well, unless you attach <literal>column_name</literal>
|
Column names must match as well, unless you attach <literal>column_name</literal>
|
||||||
options to the individual columns to show how they are named in the remote
|
options to the individual columns to show how they are named in the remote
|
||||||
table.
|
table.
|
||||||
In many cases, use of <xref linkend="sql-importforeignschema"/> is
|
In many cases, use of <link linkend="sql-importforeignschema"><command>IMPORT FOREIGN SCHEMA</command></link> is
|
||||||
preferable to constructing foreign table definitions manually.
|
preferable to constructing foreign table definitions manually.
|
||||||
</para>
|
</para>
|
||||||
</sect2>
|
</sect2>
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
<para>
|
<para>
|
||||||
The process of retrieving or the command to retrieve data from a
|
The process of retrieving or the command to retrieve data from a
|
||||||
database is called a <firstterm>query</firstterm>. In SQL the
|
database is called a <firstterm>query</firstterm>. In SQL the
|
||||||
<xref linkend="sql-select"/> command is
|
<link linkend="sql-select"><command>SELECT</command></link> command is
|
||||||
used to specify queries. The general syntax of the
|
used to specify queries. The general syntax of the
|
||||||
<command>SELECT</command> command is
|
<command>SELECT</command> command is
|
||||||
<synopsis>
|
<synopsis>
|
||||||
|
@ -33,7 +33,7 @@ ABORT [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]
|
|||||||
all the updates made by the transaction to be discarded.
|
all the updates made by the transaction to be discarded.
|
||||||
This command is identical
|
This command is identical
|
||||||
in behavior to the standard <acronym>SQL</acronym> command
|
in behavior to the standard <acronym>SQL</acronym> command
|
||||||
<xref linkend="sql-rollback"/>,
|
<link linkend="sql-rollback"><command>ROLLBACK</command></link>,
|
||||||
and is present only for historical reasons.
|
and is present only for historical reasons.
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
@ -57,8 +57,8 @@ ABORT [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
If <literal>AND CHAIN</literal> is specified, a new transaction is
|
If <literal>AND CHAIN</literal> is specified, a new transaction is
|
||||||
immediately started with the same transaction characteristics (see <xref
|
immediately started with the same transaction characteristics (see <link
|
||||||
linkend="sql-set-transaction"/>) as the just finished one. Otherwise,
|
linkend="sql-set-transaction"><command>SET TRANSACTION</command></link>) as the just finished one. Otherwise,
|
||||||
no new transaction is started.
|
no new transaction is started.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -70,7 +70,7 @@ ABORT [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]
|
|||||||
<title>Notes</title>
|
<title>Notes</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Use <xref linkend="sql-commit"/> to
|
Use <link linkend="sql-commit"><command>COMMIT</command></link> to
|
||||||
successfully terminate a transaction.
|
successfully terminate a transaction.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ ALTER AGGREGATE <replaceable>name</replaceable> ( <replaceable>aggregate_signatu
|
|||||||
The recommended syntax for referencing an ordered-set aggregate
|
The recommended syntax for referencing an ordered-set aggregate
|
||||||
is to write <literal>ORDER BY</literal> between the direct and aggregated
|
is to write <literal>ORDER BY</literal> between the direct and aggregated
|
||||||
argument specifications, in the same style as in
|
argument specifications, in the same style as in
|
||||||
<xref linkend="sql-createaggregate"/>. However, it will also work to
|
<link linkend="sql-createaggregate"><command>CREATE AGGREGATE</command></link>. However, it will also work to
|
||||||
omit <literal>ORDER BY</literal> and just run the direct and aggregated
|
omit <literal>ORDER BY</literal> and just run the direct and aggregated
|
||||||
argument specifications into a single list. In this abbreviated form,
|
argument specifications into a single list. In this abbreviated form,
|
||||||
if <literal>VARIADIC "any"</literal> was used in both the direct and
|
if <literal>VARIADIC "any"</literal> was used in both the direct and
|
||||||
|
@ -80,7 +80,7 @@ ALTER DOMAIN <replaceable class="parameter">name</replaceable>
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
This form adds a new constraint to a domain using the same syntax as
|
This form adds a new constraint to a domain using the same syntax as
|
||||||
<xref linkend="sql-createdomain"/>.
|
<link linkend="sql-createdomain"><command>CREATE DOMAIN</command></link>.
|
||||||
When a new constraint is added to a domain, all columns using that
|
When a new constraint is added to a domain, all columns using that
|
||||||
domain will be checked against the newly added constraint. These
|
domain will be checked against the newly added constraint. These
|
||||||
checks can be suppressed by adding the new constraint using the
|
checks can be suppressed by adding the new constraint using the
|
||||||
|
@ -71,7 +71,7 @@ ALTER FOREIGN TABLE [ IF EXISTS ] <replaceable class="parameter">name</replaceab
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
This form adds a new column to the foreign table, using the same syntax as
|
This form adds a new column to the foreign table, using the same syntax as
|
||||||
<xref linkend="sql-createforeigntable"/>.
|
<link linkend="sql-createforeigntable"><command>CREATE FOREIGN TABLE</command></link>.
|
||||||
Unlike the case when adding a column to a regular table, nothing happens
|
Unlike the case when adding a column to a regular table, nothing happens
|
||||||
to the underlying storage: this action simply declares that
|
to the underlying storage: this action simply declares that
|
||||||
some new column is now accessible through the foreign table.
|
some new column is now accessible through the foreign table.
|
||||||
@ -133,8 +133,8 @@ ALTER FOREIGN TABLE [ IF EXISTS ] <replaceable class="parameter">name</replaceab
|
|||||||
<para>
|
<para>
|
||||||
This form
|
This form
|
||||||
sets the per-column statistics-gathering target for subsequent
|
sets the per-column statistics-gathering target for subsequent
|
||||||
<xref linkend="sql-analyze"/> operations.
|
<link linkend="sql-analyze"><command>ANALYZE</command></link> operations.
|
||||||
See the similar form of <xref linkend="sql-altertable"/>
|
See the similar form of <link linkend="sql-altertable"><command>ALTER TABLE</command></link>
|
||||||
for more details.
|
for more details.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -146,7 +146,7 @@ ALTER FOREIGN TABLE [ IF EXISTS ] <replaceable class="parameter">name</replaceab
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
This form sets or resets per-attribute options.
|
This form sets or resets per-attribute options.
|
||||||
See the similar form of <xref linkend="sql-altertable"/>
|
See the similar form of <link linkend="sql-altertable"><command>ALTER TABLE</command></link>
|
||||||
for more details.
|
for more details.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -159,7 +159,7 @@ ALTER FOREIGN TABLE [ IF EXISTS ] <replaceable class="parameter">name</replaceab
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
This form sets the storage mode for a column.
|
This form sets the storage mode for a column.
|
||||||
See the similar form of <xref linkend="sql-altertable"/>
|
See the similar form of <link linkend="sql-altertable"><command>ALTER TABLE</command></link>
|
||||||
for more details.
|
for more details.
|
||||||
Note that the storage mode has no effect unless the table's
|
Note that the storage mode has no effect unless the table's
|
||||||
foreign-data wrapper chooses to pay attention to it.
|
foreign-data wrapper chooses to pay attention to it.
|
||||||
@ -172,7 +172,7 @@ ALTER FOREIGN TABLE [ IF EXISTS ] <replaceable class="parameter">name</replaceab
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
This form adds a new constraint to a foreign table, using the same
|
This form adds a new constraint to a foreign table, using the same
|
||||||
syntax as <xref linkend="sql-createforeigntable"/>.
|
syntax as <link linkend="sql-createforeigntable"><command>CREATE FOREIGN TABLE</command></link>.
|
||||||
Currently only <literal>CHECK</literal> constraints are supported.
|
Currently only <literal>CHECK</literal> constraints are supported.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -181,7 +181,7 @@ ALTER FOREIGN TABLE [ IF EXISTS ] <replaceable class="parameter">name</replaceab
|
|||||||
done to verify the constraint is correct; rather, this action simply
|
done to verify the constraint is correct; rather, this action simply
|
||||||
declares that some new condition should be assumed to hold for all rows
|
declares that some new condition should be assumed to hold for all rows
|
||||||
in the foreign table. (See the discussion
|
in the foreign table. (See the discussion
|
||||||
in <xref linkend="sql-createforeigntable"/>.)
|
in <link linkend="sql-createforeigntable"><command>CREATE FOREIGN TABLE</command></link>.)
|
||||||
If the constraint is marked <literal>NOT VALID</literal>, then it isn't
|
If the constraint is marked <literal>NOT VALID</literal>, then it isn't
|
||||||
assumed to hold, but is only recorded for possible future use.
|
assumed to hold, but is only recorded for possible future use.
|
||||||
</para>
|
</para>
|
||||||
@ -216,7 +216,7 @@ ALTER FOREIGN TABLE [ IF EXISTS ] <replaceable class="parameter">name</replaceab
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
These forms configure the firing of trigger(s) belonging to the foreign
|
These forms configure the firing of trigger(s) belonging to the foreign
|
||||||
table. See the similar form of <xref linkend="sql-altertable"/> for more
|
table. See the similar form of <link linkend="sql-altertable"><command>ALTER TABLE</command></link> for more
|
||||||
details.
|
details.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -239,7 +239,7 @@ ALTER FOREIGN TABLE [ IF EXISTS ] <replaceable class="parameter">name</replaceab
|
|||||||
<para>
|
<para>
|
||||||
This form adds the target foreign table as a new child of the specified
|
This form adds the target foreign table as a new child of the specified
|
||||||
parent table.
|
parent table.
|
||||||
See the similar form of <xref linkend="sql-altertable"/>
|
See the similar form of <link linkend="sql-altertable"><command>ALTER TABLE</command></link>
|
||||||
for more details.
|
for more details.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -503,7 +503,7 @@ ALTER FOREIGN TABLE [ IF EXISTS ] <replaceable class="parameter">name</replaceab
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Refer to <xref linkend="sql-createforeigntable"/> for a further description of valid
|
Refer to <link linkend="sql-createforeigntable"><command>CREATE FOREIGN TABLE</command></link> for a further description of valid
|
||||||
parameters.
|
parameters.
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
@ -51,14 +51,14 @@ ALTER GROUP <replaceable class="parameter">group_name</replaceable> RENAME TO <r
|
|||||||
<quote>group</quote> for this purpose.) These variants are effectively
|
<quote>group</quote> for this purpose.) These variants are effectively
|
||||||
equivalent to granting or revoking membership in the role named as the
|
equivalent to granting or revoking membership in the role named as the
|
||||||
<quote>group</quote>; so the preferred way to do this is to use
|
<quote>group</quote>; so the preferred way to do this is to use
|
||||||
<xref linkend="sql-grant"/> or
|
<link linkend="sql-grant"><command>GRANT</command></link> or
|
||||||
<xref linkend="sql-revoke"/>.
|
<link linkend="sql-revoke"><command>REVOKE</command></link>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The third variant changes the name of the group. This is exactly
|
The third variant changes the name of the group. This is exactly
|
||||||
equivalent to renaming the role with
|
equivalent to renaming the role with
|
||||||
<xref linkend="sql-alterrole"/>.
|
<link linkend="sql-alterrole"><command>ALTER ROLE</command></link>.
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
|
@ -81,7 +81,7 @@ ALTER INDEX ALL IN TABLESPACE <replaceable class="parameter">name</replaceable>
|
|||||||
this command, use <command>ALTER DATABASE</command> or explicit
|
this command, use <command>ALTER DATABASE</command> or explicit
|
||||||
<command>ALTER INDEX</command> invocations instead if desired.
|
<command>ALTER INDEX</command> invocations instead if desired.
|
||||||
See also
|
See also
|
||||||
<xref linkend="sql-createtablespace"/>.
|
<link linkend="sql-createtablespace"><command>CREATE TABLESPACE</command></link>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -118,11 +118,11 @@ ALTER INDEX ALL IN TABLESPACE <replaceable class="parameter">name</replaceable>
|
|||||||
<para>
|
<para>
|
||||||
This form changes one or more index-method-specific storage parameters
|
This form changes one or more index-method-specific storage parameters
|
||||||
for the index. See
|
for the index. See
|
||||||
<xref linkend="sql-createindex"/>
|
<link linkend="sql-createindex"><command>CREATE INDEX</command></link>
|
||||||
for details on the available parameters. Note that the index contents
|
for details on the available parameters. Note that the index contents
|
||||||
will not be modified immediately by this command; depending on the
|
will not be modified immediately by this command; depending on the
|
||||||
parameter you might need to rebuild the index with
|
parameter you might need to rebuild the index with
|
||||||
<xref linkend="sql-reindex"/>
|
<link linkend="sql-reindex"><command>REINDEX</command></link>
|
||||||
to get the desired effects.
|
to get the desired effects.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -144,7 +144,7 @@ ALTER INDEX ALL IN TABLESPACE <replaceable class="parameter">name</replaceable>
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
This form sets the per-column statistics-gathering target for
|
This form sets the per-column statistics-gathering target for
|
||||||
subsequent <xref linkend="sql-analyze"/> operations, though can
|
subsequent <link linkend="sql-analyze"><command>ANALYZE</command></link> operations, though can
|
||||||
be used only on index columns that are defined as an expression.
|
be used only on index columns that are defined as an expression.
|
||||||
Since expressions lack a unique name, we refer to them using the
|
Since expressions lack a unique name, we refer to them using the
|
||||||
ordinal number of the index column.
|
ordinal number of the index column.
|
||||||
@ -252,7 +252,7 @@ ALTER INDEX ALL IN TABLESPACE <replaceable class="parameter">name</replaceable>
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
These operations are also possible using
|
These operations are also possible using
|
||||||
<xref linkend="sql-altertable"/>.
|
<link linkend="sql-altertable"><command>ALTER TABLE</command></link>.
|
||||||
<command>ALTER INDEX</command> is in fact just an alias for the forms
|
<command>ALTER INDEX</command> is in fact just an alias for the forms
|
||||||
of <command>ALTER TABLE</command> that apply to indexes.
|
of <command>ALTER TABLE</command> that apply to indexes.
|
||||||
</para>
|
</para>
|
||||||
|
@ -72,7 +72,8 @@ ALTER MATERIALIZED VIEW ALL IN TABLESPACE <replaceable class="parameter">name</r
|
|||||||
The statement subforms and actions available for
|
The statement subforms and actions available for
|
||||||
<command>ALTER MATERIALIZED VIEW</command> are a subset of those available
|
<command>ALTER MATERIALIZED VIEW</command> are a subset of those available
|
||||||
for <command>ALTER TABLE</command>, and have the same meaning when used for
|
for <command>ALTER TABLE</command>, and have the same meaning when used for
|
||||||
materialized views. See the descriptions for <xref linkend="sql-altertable"/>
|
materialized views. See the descriptions for
|
||||||
|
<link linkend="sql-altertable"><command>ALTER TABLE</command></link>
|
||||||
for details.
|
for details.
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
@ -63,11 +63,11 @@ ALTER ROLE { <replaceable class="parameter">role_specification</replaceable> | A
|
|||||||
<para>
|
<para>
|
||||||
The first variant of this command listed in the synopsis can change
|
The first variant of this command listed in the synopsis can change
|
||||||
many of the role attributes that can be specified in
|
many of the role attributes that can be specified in
|
||||||
<xref linkend="sql-createrole"/>.
|
<link linkend="sql-createrole"><command>CREATE ROLE</command></link>.
|
||||||
(All the possible attributes are covered,
|
(All the possible attributes are covered,
|
||||||
except that there are no options for adding or removing memberships; use
|
except that there are no options for adding or removing memberships; use
|
||||||
<xref linkend="sql-grant"/> and
|
<link linkend="sql-grant"><command>GRANT</command></link> and
|
||||||
<xref linkend="sql-revoke"/> for that.)
|
<link linkend="sql-revoke"><command>REVOKE</command></link> for that.)
|
||||||
Attributes not mentioned in the command retain their previous settings.
|
Attributes not mentioned in the command retain their previous settings.
|
||||||
Database superusers can change any of these settings for any role.
|
Database superusers can change any of these settings for any role.
|
||||||
Roles having <literal>CREATEROLE</literal> privilege can change any of these
|
Roles having <literal>CREATEROLE</literal> privilege can change any of these
|
||||||
@ -103,8 +103,8 @@ ALTER ROLE { <replaceable class="parameter">role_specification</replaceable> | A
|
|||||||
default, overriding whatever setting is present in
|
default, overriding whatever setting is present in
|
||||||
<filename>postgresql.conf</filename> or has been received from the <command>postgres</command>
|
<filename>postgresql.conf</filename> or has been received from the <command>postgres</command>
|
||||||
command line. This only happens at login time; executing
|
command line. This only happens at login time; executing
|
||||||
<xref linkend="sql-set-role"/> or
|
<link linkend="sql-set-role"><command>SET ROLE</command></link> or
|
||||||
<xref linkend="sql-set-session-authorization"/> does not cause new
|
<link linkend="sql-set-session-authorization"><command>SET SESSION AUTHORIZATION</command></link> does not cause new
|
||||||
configuration values to be set.
|
configuration values to be set.
|
||||||
Settings set for all databases are overridden by database-specific settings
|
Settings set for all databases are overridden by database-specific settings
|
||||||
attached to a role. Settings for specific databases or specific roles override
|
attached to a role. Settings for specific databases or specific roles override
|
||||||
@ -176,7 +176,7 @@ ALTER ROLE { <replaceable class="parameter">role_specification</replaceable> | A
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
These clauses alter attributes originally set by
|
These clauses alter attributes originally set by
|
||||||
<xref linkend="sql-createrole"/>. For more information, see the
|
<link linkend="sql-createrole"><command>CREATE ROLE</command></link>. For more information, see the
|
||||||
<command>CREATE ROLE</command> reference page.
|
<command>CREATE ROLE</command> reference page.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -220,8 +220,8 @@ ALTER ROLE { <replaceable class="parameter">role_specification</replaceable> | A
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
Role-specific variable settings take effect only at login;
|
Role-specific variable settings take effect only at login;
|
||||||
<xref linkend="sql-set-role"/> and
|
<link linkend="sql-set-role"><command>SET ROLE</command></link> and
|
||||||
<xref linkend="sql-set-session-authorization"/>
|
<link linkend="sql-set-session-authorization"><command>SET SESSION AUTHORIZATION</command></link>
|
||||||
do not process role-specific variable settings.
|
do not process role-specific variable settings.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -239,14 +239,14 @@ ALTER ROLE { <replaceable class="parameter">role_specification</replaceable> | A
|
|||||||
<title>Notes</title>
|
<title>Notes</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Use <xref linkend="sql-createrole"/>
|
Use <link linkend="sql-createrole"><command>CREATE ROLE</command></link>
|
||||||
to add new roles, and <xref linkend="sql-droprole"/> to remove a role.
|
to add new roles, and <link linkend="sql-droprole"><command>DROP ROLE</command></link> to remove a role.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<command>ALTER ROLE</command> cannot change a role's memberships.
|
<command>ALTER ROLE</command> cannot change a role's memberships.
|
||||||
Use <xref linkend="sql-grant"/> and
|
Use <link linkend="sql-grant"><command>GRANT</command></link> and
|
||||||
<xref linkend="sql-revoke"/>
|
<link linkend="sql-revoke"><command>REVOKE</command></link>
|
||||||
to do that.
|
to do that.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ ALTER STATISTICS <replaceable class="parameter">name</replaceable> SET STATISTIC
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The statistic-gathering target for this statistics object for subsequent
|
The statistic-gathering target for this statistics object for subsequent
|
||||||
<xref linkend="sql-analyze"/> operations.
|
<link linkend="sql-analyze"><command>ANALYZE</command></link> operations.
|
||||||
The target can be set in the range 0 to 10000; alternatively, set it
|
The target can be set in the range 0 to 10000; alternatively, set it
|
||||||
to -1 to revert to using the maximum of the statistics target of the
|
to -1 to revert to using the maximum of the statistics target of the
|
||||||
referenced columns, if set, or the system default statistics
|
referenced columns, if set, or the system default statistics
|
||||||
|
@ -152,7 +152,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
This form adds a new column to the table, using the same syntax as
|
This form adds a new column to the table, using the same syntax as
|
||||||
<xref linkend="sql-createtable"/>. If <literal>IF NOT EXISTS</literal>
|
<link linkend="sql-createtable"><command>CREATE TABLE</command></link>. If <literal>IF NOT EXISTS</literal>
|
||||||
is specified and a column already exists with this name,
|
is specified and a column already exists with this name,
|
||||||
no error is thrown.
|
no error is thrown.
|
||||||
</para>
|
</para>
|
||||||
@ -268,7 +268,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
|
|||||||
<para>
|
<para>
|
||||||
These forms change whether a column is an identity column or change the
|
These forms change whether a column is an identity column or change the
|
||||||
generation attribute of an existing identity column.
|
generation attribute of an existing identity column.
|
||||||
See <xref linkend="sql-createtable"/> for details.
|
See <link linkend="sql-createtable"><command>CREATE TABLE</command></link> for details.
|
||||||
Like <literal>SET DEFAULT</literal>, these forms only affect the
|
Like <literal>SET DEFAULT</literal>, these forms only affect the
|
||||||
behavior of subsequent <command>INSERT</command>
|
behavior of subsequent <command>INSERT</command>
|
||||||
and <command>UPDATE</command> commands; they do not cause rows
|
and <command>UPDATE</command> commands; they do not cause rows
|
||||||
@ -290,7 +290,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
|
|||||||
<para>
|
<para>
|
||||||
These forms alter the sequence that underlies an existing identity
|
These forms alter the sequence that underlies an existing identity
|
||||||
column. <replaceable>sequence_option</replaceable> is an option
|
column. <replaceable>sequence_option</replaceable> is an option
|
||||||
supported by <xref linkend="sql-altersequence"/> such
|
supported by <link linkend="sql-altersequence"><command>ALTER SEQUENCE</command></link> such
|
||||||
as <literal>INCREMENT BY</literal>.
|
as <literal>INCREMENT BY</literal>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -302,7 +302,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
|
|||||||
<para>
|
<para>
|
||||||
This form
|
This form
|
||||||
sets the per-column statistics-gathering target for subsequent
|
sets the per-column statistics-gathering target for subsequent
|
||||||
<xref linkend="sql-analyze"/> operations.
|
<link linkend="sql-analyze"><command>ANALYZE</command></link> operations.
|
||||||
The target can be set in the range 0 to 10000; alternatively, set it
|
The target can be set in the range 0 to 10000; alternatively, set it
|
||||||
to -1 to revert to using the system default statistics
|
to -1 to revert to using the system default statistics
|
||||||
target (<xref linkend="guc-default-statistics-target"/>).
|
target (<xref linkend="guc-default-statistics-target"/>).
|
||||||
@ -326,7 +326,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
|
|||||||
defined per-attribute options are <literal>n_distinct</literal> and
|
defined per-attribute options are <literal>n_distinct</literal> and
|
||||||
<literal>n_distinct_inherited</literal>, which override the
|
<literal>n_distinct_inherited</literal>, which override the
|
||||||
number-of-distinct-values estimates made by subsequent
|
number-of-distinct-values estimates made by subsequent
|
||||||
<xref linkend="sql-analyze"/>
|
<link linkend="sql-analyze"><command>ANALYZE</command></link>
|
||||||
operations. <literal>n_distinct</literal> affects the statistics for the table
|
operations. <literal>n_distinct</literal> affects the statistics for the table
|
||||||
itself, while <literal>n_distinct_inherited</literal> affects the statistics
|
itself, while <literal>n_distinct_inherited</literal> affects the statistics
|
||||||
gathered for the table plus its inheritance children. When set to a
|
gathered for the table plus its inheritance children. When set to a
|
||||||
@ -388,7 +388,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
This form adds a new constraint to a table using the same constraint
|
This form adds a new constraint to a table using the same constraint
|
||||||
syntax as <xref linkend="sql-createtable"/>, plus the option <literal>NOT
|
syntax as <link linkend="sql-createtable"><command>CREATE TABLE</command></link>, plus the option <literal>NOT
|
||||||
VALID</literal>, which is currently only allowed for foreign key
|
VALID</literal>, which is currently only allowed for foreign key
|
||||||
and CHECK constraints.
|
and CHECK constraints.
|
||||||
</para>
|
</para>
|
||||||
@ -422,7 +422,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
Additional restrictions apply when unique or primary key constraints
|
Additional restrictions apply when unique or primary key constraints
|
||||||
are added to partitioned tables; see <xref linkend="sql-createtable"/>.
|
are added to partitioned tables; see <link linkend="sql-createtable"><command>CREATE TABLE</command></link>.
|
||||||
Also, foreign key constraints on partitioned
|
Also, foreign key constraints on partitioned
|
||||||
tables may not be declared <literal>NOT VALID</literal> at present.
|
tables may not be declared <literal>NOT VALID</literal> at present.
|
||||||
</para>
|
</para>
|
||||||
@ -598,7 +598,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
|
|||||||
even if row level security is disabled. In this case, the policies will
|
even if row level security is disabled. In this case, the policies will
|
||||||
<emphasis>not</emphasis> be applied and the policies will be ignored.
|
<emphasis>not</emphasis> be applied and the policies will be ignored.
|
||||||
See also
|
See also
|
||||||
<xref linkend="sql-createpolicy"/>.
|
<link linkend="sql-createpolicy"><command>CREATE POLICY</command></link>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -613,7 +613,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
|
|||||||
disabled (the default) then row level security will not be applied when
|
disabled (the default) then row level security will not be applied when
|
||||||
the user is the table owner.
|
the user is the table owner.
|
||||||
See also
|
See also
|
||||||
<xref linkend="sql-createpolicy"/>.
|
<link linkend="sql-createpolicy"><command>CREATE POLICY</command></link>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -623,7 +623,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
This form selects the default index for future
|
This form selects the default index for future
|
||||||
<xref linkend="sql-cluster"/>
|
<link linkend="sql-cluster"><command>CLUSTER</command></link>
|
||||||
operations. It does not actually re-cluster the table.
|
operations. It does not actually re-cluster the table.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
@ -637,7 +637,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
This form removes the most recently used
|
This form removes the most recently used
|
||||||
<xref linkend="sql-cluster"/>
|
<link linkend="sql-cluster"><command>CLUSTER</command></link>
|
||||||
index specification from the table. This affects
|
index specification from the table. This affects
|
||||||
future cluster operations that don't specify an index.
|
future cluster operations that don't specify an index.
|
||||||
</para>
|
</para>
|
||||||
@ -685,7 +685,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
|
|||||||
<literal>information_schema</literal> relations are not considered part
|
<literal>information_schema</literal> relations are not considered part
|
||||||
of the system catalogs and will be moved.
|
of the system catalogs and will be moved.
|
||||||
See also
|
See also
|
||||||
<xref linkend="sql-createtablespace"/>.
|
<link linkend="sql-createtablespace"><command>CREATE TABLESPACE</command></link>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -707,12 +707,12 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
|
|||||||
<para>
|
<para>
|
||||||
This form changes one or more storage parameters for the table. See
|
This form changes one or more storage parameters for the table. See
|
||||||
<xref linkend="sql-createtable-storage-parameters"/> in the
|
<xref linkend="sql-createtable-storage-parameters"/> in the
|
||||||
<xref linkend="sql-createtable"/> documentation
|
<link linkend="sql-createtable"><command>CREATE TABLE</command></link> documentation
|
||||||
for details on the available parameters. Note that the table contents
|
for details on the available parameters. Note that the table contents
|
||||||
will not be modified immediately by this command; depending on the
|
will not be modified immediately by this command; depending on the
|
||||||
parameter you might need to rewrite the table to get the desired effects.
|
parameter you might need to rewrite the table to get the desired effects.
|
||||||
That can be done with <link linkend="sql-vacuum">VACUUM
|
That can be done with <link linkend="sql-vacuum"><command>VACUUM
|
||||||
FULL</link>, <xref linkend="sql-cluster"/> or one of the forms
|
FULL</command></link>, <link linkend="sql-cluster"><command>CLUSTER</command></link> or one of the forms
|
||||||
of <command>ALTER TABLE</command> that forces a table rewrite.
|
of <command>ALTER TABLE</command> that forces a table rewrite.
|
||||||
For planner related parameters, changes will take effect from the next
|
For planner related parameters, changes will take effect from the next
|
||||||
time the table is locked so currently executing queries will not be
|
time the table is locked so currently executing queries will not be
|
||||||
@ -878,7 +878,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
|
|||||||
<para>
|
<para>
|
||||||
A partition using <literal>FOR VALUES</literal> uses same syntax for
|
A partition using <literal>FOR VALUES</literal> uses same syntax for
|
||||||
<replaceable class="parameter">partition_bound_spec</replaceable> as
|
<replaceable class="parameter">partition_bound_spec</replaceable> as
|
||||||
<xref linkend="sql-createtable"/>. The partition bound specification
|
<link linkend="sql-createtable"><command>CREATE TABLE</command></link>. The partition bound specification
|
||||||
must correspond to the partitioning strategy and partition key of the
|
must correspond to the partitioning strategy and partition key of the
|
||||||
target table. The table to be attached must have all the same columns
|
target table. The table to be attached must have all the same columns
|
||||||
as the target table and no more; moreover, the column types must also
|
as the target table and no more; moreover, the column types must also
|
||||||
|
@ -93,7 +93,7 @@ ALTER TRIGGER <replaceable class="parameter">name</replaceable> ON <replaceable
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
The ability to temporarily enable or disable a trigger is provided by
|
The ability to temporarily enable or disable a trigger is provided by
|
||||||
<xref linkend="sql-altertable"/>, not by
|
<link linkend="sql-altertable"><command>ALTER TABLE</command></link>, not by
|
||||||
<command>ALTER TRIGGER</command>, because <command>ALTER TRIGGER</command> has no
|
<command>ALTER TRIGGER</command>, because <command>ALTER TRIGGER</command> has no
|
||||||
convenient way to express the option of enabling or disabling all of
|
convenient way to express the option of enabling or disabling all of
|
||||||
a table's triggers at once.
|
a table's triggers at once.
|
||||||
|
@ -90,7 +90,7 @@ ALTER TYPE <replaceable class="parameter">name</replaceable> SET ( <replaceable
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
This form adds a new attribute to a composite type, using the same syntax as
|
This form adds a new attribute to a composite type, using the same syntax as
|
||||||
<xref linkend="sql-createtype"/>.
|
<link linkend="sql-createtype"><command>CREATE TYPE</command></link>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -57,7 +57,7 @@ ALTER USER { <replaceable class="parameter">role_specification</replaceable> | A
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
<command>ALTER USER</command> is now an alias for
|
<command>ALTER USER</command> is now an alias for
|
||||||
<xref linkend="sql-alterrole"/>.
|
<link linkend="sql-alterrole"><command>ALTER ROLE</command></link>.
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
|
@ -174,7 +174,7 @@ ANALYZE [ VERBOSE ] [ <replaceable class="parameter">table_and_columns</replacea
|
|||||||
just after making major changes in the contents of a table. Accurate
|
just after making major changes in the contents of a table. Accurate
|
||||||
statistics will help the planner to choose the most appropriate query
|
statistics will help the planner to choose the most appropriate query
|
||||||
plan, and thereby improve the speed of query processing. A common
|
plan, and thereby improve the speed of query processing. A common
|
||||||
strategy for read-mostly databases is to run <xref linkend="sql-vacuum"/>
|
strategy for read-mostly databases is to run <link linkend="sql-vacuum"><command>VACUUM</command></link>
|
||||||
and <command>ANALYZE</command> once a day during a low-usage time of day.
|
and <command>ANALYZE</command> once a day during a low-usage time of day.
|
||||||
(This will not be sufficient if there is heavy update activity.)
|
(This will not be sufficient if there is heavy update activity.)
|
||||||
</para>
|
</para>
|
||||||
@ -205,7 +205,7 @@ ANALYZE [ VERBOSE ] [ <replaceable class="parameter">table_and_columns</replacea
|
|||||||
will change slightly each time <command>ANALYZE</command> is run,
|
will change slightly each time <command>ANALYZE</command> is run,
|
||||||
even if the actual table contents did not change. This might result
|
even if the actual table contents did not change. This might result
|
||||||
in small changes in the planner's estimated costs shown by
|
in small changes in the planner's estimated costs shown by
|
||||||
<xref linkend="sql-explain"/>.
|
<link linkend="sql-explain"><command>EXPLAIN</command></link>.
|
||||||
In rare situations, this non-determinism will cause the planner's
|
In rare situations, this non-determinism will cause the planner's
|
||||||
choices of query plans to change after <command>ANALYZE</command> is run.
|
choices of query plans to change after <command>ANALYZE</command> is run.
|
||||||
To avoid this, raise the amount of statistics collected by
|
To avoid this, raise the amount of statistics collected by
|
||||||
@ -216,8 +216,8 @@ ANALYZE [ VERBOSE ] [ <replaceable class="parameter">table_and_columns</replacea
|
|||||||
The extent of analysis can be controlled by adjusting the
|
The extent of analysis can be controlled by adjusting the
|
||||||
<xref linkend="guc-default-statistics-target"/> configuration variable, or
|
<xref linkend="guc-default-statistics-target"/> configuration variable, or
|
||||||
on a column-by-column basis by setting the per-column statistics
|
on a column-by-column basis by setting the per-column statistics
|
||||||
target with <command>ALTER TABLE ... ALTER COLUMN ... SET
|
target with <link linkend="sql-altertable"><command>ALTER TABLE ... ALTER COLUMN ... SET
|
||||||
STATISTICS</command> (see <xref linkend="sql-altertable"/>).
|
STATISTICS</command></link>.
|
||||||
The target value sets the
|
The target value sets the
|
||||||
maximum number of entries in the most-common-value list and the
|
maximum number of entries in the most-common-value list and the
|
||||||
maximum number of bins in the histogram. The default target value
|
maximum number of bins in the histogram. The default target value
|
||||||
@ -246,8 +246,7 @@ ANALYZE [ VERBOSE ] [ <replaceable class="parameter">table_and_columns</replacea
|
|||||||
with the largest possible statistics target. If this inaccuracy leads to
|
with the largest possible statistics target. If this inaccuracy leads to
|
||||||
bad query plans, a more accurate value can be determined manually and then
|
bad query plans, a more accurate value can be determined manually and then
|
||||||
installed with
|
installed with
|
||||||
<command>ALTER TABLE ... ALTER COLUMN ... SET (n_distinct = ...)</command>
|
<link linkend="sql-altertable"><command>ALTER TABLE ... ALTER COLUMN ... SET (n_distinct = ...)</command></link>.
|
||||||
(see <xref linkend="sql-altertable"/>).
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
|
@ -37,9 +37,9 @@ BEGIN [ WORK | TRANSACTION ] [ <replaceable class="parameter">transaction_mode</
|
|||||||
<para>
|
<para>
|
||||||
<command>BEGIN</command> initiates a transaction block, that is,
|
<command>BEGIN</command> initiates a transaction block, that is,
|
||||||
all statements after a <command>BEGIN</command> command will be
|
all statements after a <command>BEGIN</command> command will be
|
||||||
executed in a single transaction until an explicit <xref
|
executed in a single transaction until an explicit <link
|
||||||
linkend="sql-commit"/> or <xref
|
linkend="sql-commit"><command>COMMIT</command></link> or <link
|
||||||
linkend="sql-rollback"/> is given.
|
linkend="sql-rollback"><command>ROLLBACK</command></link> is given.
|
||||||
By default (without <command>BEGIN</command>),
|
By default (without <command>BEGIN</command>),
|
||||||
<productname>PostgreSQL</productname> executes
|
<productname>PostgreSQL</productname> executes
|
||||||
transactions in <quote>autocommit</quote> mode, that is, each
|
transactions in <quote>autocommit</quote> mode, that is, each
|
||||||
@ -60,7 +60,7 @@ BEGIN [ WORK | TRANSACTION ] [ <replaceable class="parameter">transaction_mode</
|
|||||||
<para>
|
<para>
|
||||||
If the isolation level, read/write mode, or deferrable mode is specified, the new
|
If the isolation level, read/write mode, or deferrable mode is specified, the new
|
||||||
transaction has those characteristics, as if
|
transaction has those characteristics, as if
|
||||||
<xref linkend="sql-set-transaction"/>
|
<link linkend="sql-set-transaction"><command>SET TRANSACTION</command></link>
|
||||||
was executed.
|
was executed.
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
@ -90,13 +90,13 @@ BEGIN [ WORK | TRANSACTION ] [ <replaceable class="parameter">transaction_mode</
|
|||||||
<title>Notes</title>
|
<title>Notes</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<xref linkend="sql-start-transaction"/> has the same functionality
|
<link linkend="sql-start-transaction"><command>START TRANSACTION</command></link> has the same functionality
|
||||||
as <command>BEGIN</command>.
|
as <command>BEGIN</command>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Use <xref linkend="sql-commit"/> or
|
Use <link linkend="sql-commit"><command>COMMIT</command></link> or
|
||||||
<xref linkend="sql-rollback"/>
|
<link linkend="sql-rollback"><command>ROLLBACK</command></link>
|
||||||
to terminate a transaction block.
|
to terminate a transaction block.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -131,7 +131,7 @@ BEGIN;
|
|||||||
<para>
|
<para>
|
||||||
<command>BEGIN</command> is a <productname>PostgreSQL</productname>
|
<command>BEGIN</command> is a <productname>PostgreSQL</productname>
|
||||||
language extension. It is equivalent to the SQL-standard command
|
language extension. It is equivalent to the SQL-standard command
|
||||||
<xref linkend="sql-start-transaction"/>, whose reference page
|
<link linkend="sql-start-transaction"><command>START TRANSACTION</command></link>, whose reference page
|
||||||
contains additional compatibility information.
|
contains additional compatibility information.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ CLOSE { <replaceable class="parameter">name</replaceable> | ALL }
|
|||||||
<productname>PostgreSQL</productname> does not have an explicit
|
<productname>PostgreSQL</productname> does not have an explicit
|
||||||
<command>OPEN</command> cursor statement; a cursor is considered
|
<command>OPEN</command> cursor statement; a cursor is considered
|
||||||
open when it is declared. Use the
|
open when it is declared. Use the
|
||||||
<xref linkend="sql-declare"/>
|
<link linkend="sql-declare"><command>DECLARE</command></link>
|
||||||
statement to declare a cursor.
|
statement to declare a cursor.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ CLUSTER [VERBOSE]
|
|||||||
<command>CLUSTER <replaceable class="parameter">table_name</replaceable></command>
|
<command>CLUSTER <replaceable class="parameter">table_name</replaceable></command>
|
||||||
reclusters the table using the same index as before. You can also
|
reclusters the table using the same index as before. You can also
|
||||||
use the <literal>CLUSTER</literal> or <literal>SET WITHOUT CLUSTER</literal>
|
use the <literal>CLUSTER</literal> or <literal>SET WITHOUT CLUSTER</literal>
|
||||||
forms of <xref linkend="sql-altertable"/> to set the index to be used for
|
forms of <link linkend="sql-altertable"><command>ALTER TABLE</command></link> to set the index to be used for
|
||||||
future cluster operations, or to clear any previous setting.
|
future cluster operations, or to clear any previous setting.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -159,7 +159,7 @@ CLUSTER [VERBOSE]
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
Because the planner records statistics about the ordering of
|
Because the planner records statistics about the ordering of
|
||||||
tables, it is advisable to run <xref linkend="sql-analyze"/>
|
tables, it is advisable to run <link linkend="sql-analyze"><command>ANALYZE</command></link>
|
||||||
on the newly clustered table.
|
on the newly clustered table.
|
||||||
Otherwise, the planner might make poor choices of query plans.
|
Otherwise, the planner might make poor choices of query plans.
|
||||||
</para>
|
</para>
|
||||||
|
@ -112,9 +112,11 @@ COPY { <replaceable class="parameter">table_name</replaceable> [ ( <replaceable
|
|||||||
<term><replaceable class="parameter">query</replaceable></term>
|
<term><replaceable class="parameter">query</replaceable></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
A <xref linkend="sql-select"/>, <xref linkend="sql-values"/>,
|
A <link linkend="sql-select"><command>SELECT</command></link>,
|
||||||
<xref linkend="sql-insert"/>, <xref linkend="sql-update"/> or
|
<link linkend="sql-values"><command>VALUES</command></link>,
|
||||||
<xref linkend="sql-delete"/> command whose results are to be
|
<link linkend="sql-insert"><command>INSERT</command></link>,
|
||||||
|
<link linkend="sql-update"><command>UPDATE</command></link>, or
|
||||||
|
<link linkend="sql-delete"><command>DELETE</command></link> command whose results are to be
|
||||||
copied. Note that parentheses are required around the query.
|
copied. Note that parentheses are required around the query.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
|
@ -629,7 +629,7 @@ SELECT col FROM tab ORDER BY col USING sortop LIMIT 1;
|
|||||||
<para>
|
<para>
|
||||||
The meanings of <literal>PARALLEL SAFE</literal>, <literal>PARALLEL
|
The meanings of <literal>PARALLEL SAFE</literal>, <literal>PARALLEL
|
||||||
RESTRICTED</literal>, and <literal>PARALLEL UNSAFE</literal> are the same as
|
RESTRICTED</literal>, and <literal>PARALLEL UNSAFE</literal> are the same as
|
||||||
in <xref linkend="sql-createfunction"/>. An aggregate will not be
|
in <link linkend="sql-createfunction"><command>CREATE FUNCTION</command></link>. An aggregate will not be
|
||||||
considered for parallelization if it is marked <literal>PARALLEL
|
considered for parallelization if it is marked <literal>PARALLEL
|
||||||
UNSAFE</literal> (which is the default!) or <literal>PARALLEL RESTRICTED</literal>.
|
UNSAFE</literal> (which is the default!) or <literal>PARALLEL RESTRICTED</literal>.
|
||||||
Note that the parallel-safety markings of the aggregate's support
|
Note that the parallel-safety markings of the aggregate's support
|
||||||
|
@ -304,7 +304,7 @@ SELECT CAST ( 2 AS numeric ) + 4.0;
|
|||||||
<title>Notes</title>
|
<title>Notes</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Use <xref linkend="sql-dropcast"/> to remove user-defined casts.
|
Use <link linkend="sql-dropcast"><command>DROP CAST</command></link> to remove user-defined casts.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
|
@ -226,7 +226,7 @@ CREATE DATABASE <replaceable class="parameter">name</replaceable>
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Use <xref linkend="sql-dropdatabase"/> to remove a database.
|
Use <link linkend="sql-dropdatabase"><command>DROP DATABASE</command></link> to remove a database.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
@ -235,9 +235,9 @@ CREATE DATABASE <replaceable class="parameter">name</replaceable>
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Database-level configuration parameters (set via <xref
|
Database-level configuration parameters (set via <link
|
||||||
linkend="sql-alterdatabase"/>) and database-level permissions (set via
|
linkend="sql-alterdatabase"><command>ALTER DATABASE</command></link>) and database-level permissions (set via
|
||||||
<xref linkend="sql-grant"/>) are not copied from the template database.
|
<link linkend="sql-grant"><command>GRANT</command></link>) are not copied from the template database.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
|
@ -159,7 +159,7 @@ CHECK ( <replaceable class="parameter">expression</replaceable> ) [ NO INHERIT ]
|
|||||||
tables from which the new foreign table automatically inherits
|
tables from which the new foreign table automatically inherits
|
||||||
all columns. Parent tables can be plain tables or foreign tables.
|
all columns. Parent tables can be plain tables or foreign tables.
|
||||||
See the similar form of
|
See the similar form of
|
||||||
<xref linkend="sql-createtable"/> for more details.
|
<link linkend="sql-createtable"><command>CREATE TABLE</command></link> for more details.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -171,7 +171,7 @@ CHECK ( <replaceable class="parameter">expression</replaceable> ) [ NO INHERIT ]
|
|||||||
This form can be used to create the foreign table as partition of
|
This form can be used to create the foreign table as partition of
|
||||||
the given parent table with specified partition bound values.
|
the given parent table with specified partition bound values.
|
||||||
See the similar form of
|
See the similar form of
|
||||||
<xref linkend="sql-createtable"/> for more details.
|
<link linkend="sql-createtable"><command>CREATE TABLE</command></link> for more details.
|
||||||
Note that it is currently not allowed to create the foreign table as a
|
Note that it is currently not allowed to create the foreign table as a
|
||||||
partition of the parent table if there are <literal>UNIQUE</literal>
|
partition of the parent table if there are <literal>UNIQUE</literal>
|
||||||
indexes on the parent table. (See also
|
indexes on the parent table. (See also
|
||||||
|
@ -557,7 +557,7 @@ CREATE [ OR REPLACE ] FUNCTION
|
|||||||
the SQL function. The string <replaceable
|
the SQL function. The string <replaceable
|
||||||
class="parameter">obj_file</replaceable> is the name of the shared
|
class="parameter">obj_file</replaceable> is the name of the shared
|
||||||
library file containing the compiled C function, and is interpreted
|
library file containing the compiled C function, and is interpreted
|
||||||
as for the <xref linkend="sql-load"/> command. The string
|
as for the <link linkend="sql-load"><command>LOAD</command></link> command. The string
|
||||||
<replaceable class="parameter">link_symbol</replaceable> is the
|
<replaceable class="parameter">link_symbol</replaceable> is the
|
||||||
function's link symbol, that is, the name of the function in the C
|
function's link symbol, that is, the name of the function in the C
|
||||||
language source code. If the link symbol is omitted, it is assumed to
|
language source code. If the link symbol is omitted, it is assumed to
|
||||||
|
@ -779,8 +779,8 @@ Indexes:
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Setting a value for <literal>parallel_workers</literal> via <xref
|
Setting a value for <literal>parallel_workers</literal> via <link
|
||||||
linkend="sql-altertable"/> directly controls how many parallel
|
linkend="sql-altertable"><command>ALTER TABLE</command></link> directly controls how many parallel
|
||||||
worker processes will be requested by a <command>CREATE
|
worker processes will be requested by a <command>CREATE
|
||||||
INDEX</command> against the table. This bypasses the cost model
|
INDEX</command> against the table. This bypasses the cost model
|
||||||
completely, and prevents <varname>maintenance_work_mem</varname>
|
completely, and prevents <varname>maintenance_work_mem</varname>
|
||||||
@ -808,7 +808,7 @@ Indexes:
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Use <xref linkend="sql-dropindex"/>
|
Use <link linkend="sql-dropindex"><command>DROP INDEX</command></link>
|
||||||
to remove an index.
|
to remove an index.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ CREATE [ OR REPLACE ] [ TRUSTED ] [ PROCEDURAL ] LANGUAGE <replaceable class="pa
|
|||||||
<para><replaceable class="parameter">inline_handler</replaceable> is the
|
<para><replaceable class="parameter">inline_handler</replaceable> is the
|
||||||
name of a previously registered function that will be called
|
name of a previously registered function that will be called
|
||||||
to execute an anonymous code block
|
to execute an anonymous code block
|
||||||
(<xref linkend="sql-do"/> command)
|
(<link linkend="sql-do"><command>DO</command></link> command)
|
||||||
in this language.
|
in this language.
|
||||||
If no <replaceable class="parameter">inline_handler</replaceable>
|
If no <replaceable class="parameter">inline_handler</replaceable>
|
||||||
function is specified, the language does not support anonymous code
|
function is specified, the language does not support anonymous code
|
||||||
@ -183,7 +183,7 @@ CREATE [ OR REPLACE ] [ TRUSTED ] [ PROCEDURAL ] LANGUAGE <replaceable class="pa
|
|||||||
<title>Notes</title>
|
<title>Notes</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Use <xref linkend="sql-droplanguage"/> to drop procedural languages.
|
Use <link linkend="sql-droplanguage"><command>DROP LANGUAGE</command></link> to drop procedural languages.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
|
@ -132,8 +132,8 @@ CREATE MATERIALIZED VIEW [ IF NOT EXISTS ] <replaceable>table_name</replaceable>
|
|||||||
<term><replaceable>query</replaceable></term>
|
<term><replaceable>query</replaceable></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
A <xref linkend="sql-select"/>, <link linkend="sql-table">TABLE</link>,
|
A <link linkend="sql-select"><command>SELECT</command></link>, <link linkend="sql-table"><command>TABLE</command></link>,
|
||||||
or <xref linkend="sql-values"/> command. This query will run within a
|
or <link linkend="sql-values"><command>VALUES</command></link> command. This query will run within a
|
||||||
security-restricted operation; in particular, calls to functions that
|
security-restricted operation; in particular, calls to functions that
|
||||||
themselves create temporary tables will fail.
|
themselves create temporary tables will fail.
|
||||||
</para>
|
</para>
|
||||||
|
@ -251,8 +251,8 @@ COMMUTATOR = OPERATOR(myschema.===) ,
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Use <xref linkend="sql-dropoperator"/> to delete user-defined operators
|
Use <link linkend="sql-dropoperator"><command>DROP OPERATOR</command></link> to delete user-defined operators
|
||||||
from a database. Use <xref linkend="sql-alteroperator"/> to modify operators in a
|
from a database. Use <link linkend="sql-alteroperator"><command>ALTER OPERATOR</command></link> to modify operators in a
|
||||||
database.
|
database.
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
@ -285,7 +285,7 @@ CREATE [ OR REPLACE ] PROCEDURE
|
|||||||
the SQL procedure. The string <replaceable
|
the SQL procedure. The string <replaceable
|
||||||
class="parameter">obj_file</replaceable> is the name of the shared
|
class="parameter">obj_file</replaceable> is the name of the shared
|
||||||
library file containing the compiled C procedure, and is interpreted
|
library file containing the compiled C procedure, and is interpreted
|
||||||
as for the <xref linkend="sql-load"/> command. The string
|
as for the <link linkend="sql-load"><command>LOAD</command></link> command. The string
|
||||||
<replaceable class="parameter">link_symbol</replaceable> is the
|
<replaceable class="parameter">link_symbol</replaceable> is the
|
||||||
procedure's link symbol, that is, the name of the procedure in the C
|
procedure's link symbol, that is, the name of the procedure in the C
|
||||||
language source code. If the link symbol is omitted, it is assumed
|
language source code. If the link symbol is omitted, it is assumed
|
||||||
|
@ -162,7 +162,7 @@ in sync when changing the above synopsis!
|
|||||||
If not specified,
|
If not specified,
|
||||||
<literal>NOLOGIN</literal> is the default, except when
|
<literal>NOLOGIN</literal> is the default, except when
|
||||||
<command>CREATE ROLE</command> is invoked through its alternative spelling
|
<command>CREATE ROLE</command> is invoked through its alternative spelling
|
||||||
<xref linkend="sql-createuser"/>.
|
<link linkend="sql-createuser"><command>CREATE USER</command></link>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -335,8 +335,8 @@ in sync when changing the above synopsis!
|
|||||||
<title>Notes</title>
|
<title>Notes</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Use <xref linkend="sql-alterrole"/> to
|
Use <link linkend="sql-alterrole"><command>ALTER ROLE</command></link> to
|
||||||
change the attributes of a role, and <xref linkend="sql-droprole"/>
|
change the attributes of a role, and <link linkend="sql-droprole"><command>DROP ROLE</command></link>
|
||||||
to remove a role. All the attributes
|
to remove a role. All the attributes
|
||||||
specified by <command>CREATE ROLE</command> can be modified by later
|
specified by <command>CREATE ROLE</command> can be modified by later
|
||||||
<command>ALTER ROLE</command> commands.
|
<command>ALTER ROLE</command> commands.
|
||||||
@ -345,8 +345,8 @@ in sync when changing the above synopsis!
|
|||||||
<para>
|
<para>
|
||||||
The preferred way to add and remove members of roles that are being
|
The preferred way to add and remove members of roles that are being
|
||||||
used as groups is to use
|
used as groups is to use
|
||||||
<xref linkend="sql-grant"/> and
|
<link linkend="sql-grant"><command>GRANT</command></link> and
|
||||||
<xref linkend="sql-revoke"/>.
|
<link linkend="sql-revoke"><command>REVOKE</command></link>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
@ -364,7 +364,7 @@ in sync when changing the above synopsis!
|
|||||||
a member of a role with <literal>CREATEDB</literal> privilege does not immediately
|
a member of a role with <literal>CREATEDB</literal> privilege does not immediately
|
||||||
grant the ability to create databases, even if <literal>INHERIT</literal> is set;
|
grant the ability to create databases, even if <literal>INHERIT</literal> is set;
|
||||||
it would be necessary to become that role via
|
it would be necessary to become that role via
|
||||||
<xref linkend="sql-set-role"/> before
|
<link linkend="sql-set-role"><command>SET ROLE</command></link> before
|
||||||
creating a database.
|
creating a database.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
@ -1152,7 +1152,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
|
|||||||
constraint that is not deferrable will be checked immediately
|
constraint that is not deferrable will be checked immediately
|
||||||
after every command. Checking of constraints that are
|
after every command. Checking of constraints that are
|
||||||
deferrable can be postponed until the end of the transaction
|
deferrable can be postponed until the end of the transaction
|
||||||
(using the <xref linkend="sql-set-constraints"/> command).
|
(using the <link linkend="sql-set-constraints"><command>SET CONSTRAINTS</command></link> command).
|
||||||
<literal>NOT DEFERRABLE</literal> is the default.
|
<literal>NOT DEFERRABLE</literal> is the default.
|
||||||
Currently, only <literal>UNIQUE</literal>, <literal>PRIMARY KEY</literal>,
|
Currently, only <literal>UNIQUE</literal>, <literal>PRIMARY KEY</literal>,
|
||||||
<literal>EXCLUDE</literal>, and
|
<literal>EXCLUDE</literal>, and
|
||||||
@ -1176,7 +1176,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
|
|||||||
statement. This is the default. If the constraint is
|
statement. This is the default. If the constraint is
|
||||||
<literal>INITIALLY DEFERRED</literal>, it is checked only at the
|
<literal>INITIALLY DEFERRED</literal>, it is checked only at the
|
||||||
end of the transaction. The constraint check time can be
|
end of the transaction. The constraint check time can be
|
||||||
altered with the <xref linkend="sql-set-constraints"/> command.
|
altered with the <link linkend="sql-set-constraints"><command>SET CONSTRAINTS</command></link> command.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -1244,8 +1244,8 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
All rows in the temporary table will be deleted at the end
|
All rows in the temporary table will be deleted at the end
|
||||||
of each transaction block. Essentially, an automatic <xref
|
of each transaction block. Essentially, an automatic <link
|
||||||
linkend="sql-truncate"/> is done
|
linkend="sql-truncate"><command>TRUNCATE</command></link> is done
|
||||||
at each commit. When used on a partitioned table, this
|
at each commit. When used on a partitioned table, this
|
||||||
is not cascaded to its partitions.
|
is not cascaded to its partitions.
|
||||||
</para>
|
</para>
|
||||||
@ -1430,7 +1430,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
|
|||||||
Disabling index cleanup can speed up <command>VACUUM</command> very
|
Disabling index cleanup can speed up <command>VACUUM</command> very
|
||||||
significantly, but may also lead to severely bloated indexes if table
|
significantly, but may also lead to severely bloated indexes if table
|
||||||
modifications are frequent. The <literal>INDEX_CLEANUP</literal>
|
modifications are frequent. The <literal>INDEX_CLEANUP</literal>
|
||||||
parameter of <xref linkend="sql-vacuum"/>, if specified, overrides
|
parameter of <link linkend="sql-vacuum"><command>VACUUM</command></link>, if specified, overrides
|
||||||
the value of this option.
|
the value of this option.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -1451,7 +1451,7 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
|
|||||||
the truncated pages is returned to the operating system.
|
the truncated pages is returned to the operating system.
|
||||||
Note that the truncation requires <literal>ACCESS EXCLUSIVE</literal>
|
Note that the truncation requires <literal>ACCESS EXCLUSIVE</literal>
|
||||||
lock on the table. The <literal>TRUNCATE</literal> parameter
|
lock on the table. The <literal>TRUNCATE</literal> parameter
|
||||||
of <xref linkend="sql-vacuum"/>, if specified, overrides the value
|
of <link linkend="sql-vacuum"><command>VACUUM</command></link>, if specified, overrides the value
|
||||||
of this option.
|
of this option.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
@ -185,8 +185,8 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXI
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
All rows in the temporary table will be deleted at the end
|
All rows in the temporary table will be deleted at the end
|
||||||
of each transaction block. Essentially, an automatic <xref
|
of each transaction block. Essentially, an automatic <link
|
||||||
linkend="sql-truncate"/> is done
|
linkend="sql-truncate"><command>TRUNCATE</command></link> is done
|
||||||
at each commit.
|
at each commit.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -222,9 +222,9 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } | UNLOGGED ] TABLE [ IF NOT EXI
|
|||||||
<term><replaceable>query</replaceable></term>
|
<term><replaceable>query</replaceable></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
A <xref linkend="sql-select"/>, <link
|
A <link linkend="sql-select"><command>SELECT</command></link>, <link
|
||||||
linkend="sql-table">TABLE</link>, or <xref linkend="sql-values"/>
|
linkend="sql-table"><command>TABLE</command></link>, or <link linkend="sql-values"><command>VALUES</command></link>
|
||||||
command, or an <xref linkend="sql-execute"/> command that runs a
|
command, or an <link linkend="sql-execute"><command>EXECUTE</command></link> command that runs a
|
||||||
prepared <command>SELECT</command>, <command>TABLE</command>, or
|
prepared <command>SELECT</command>, <command>TABLE</command>, or
|
||||||
<command>VALUES</command> query.
|
<command>VALUES</command> query.
|
||||||
</para>
|
</para>
|
||||||
|
@ -147,7 +147,7 @@ CREATE [ OR REPLACE ] TRANSFORM FOR <replaceable>type_name</replaceable> LANGUAG
|
|||||||
<title>Notes</title>
|
<title>Notes</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Use <xref linkend="sql-droptransform"/> to remove transforms.
|
Use <link linkend="sql-droptransform"><command>DROP TRANSFORM</command></link> to remove transforms.
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@ CREATE [ CONSTRAINT ] TRIGGER <replaceable class="parameter">name</replaceable>
|
|||||||
When the <literal>CONSTRAINT</literal> option is specified, this command creates a
|
When the <literal>CONSTRAINT</literal> option is specified, this command creates a
|
||||||
<firstterm>constraint trigger</firstterm>. This is the same as a regular trigger
|
<firstterm>constraint trigger</firstterm>. This is the same as a regular trigger
|
||||||
except that the timing of the trigger firing can be adjusted using
|
except that the timing of the trigger firing can be adjusted using
|
||||||
<xref linkend="sql-set-constraints"/>.
|
<link linkend="sql-set-constraints"><command>SET CONSTRAINTS</command></link>.
|
||||||
Constraint triggers must be <literal>AFTER ROW</literal> triggers on plain
|
Constraint triggers must be <literal>AFTER ROW</literal> triggers on plain
|
||||||
tables (not foreign tables). They
|
tables (not foreign tables). They
|
||||||
can be fired either at the end of the statement causing the triggering
|
can be fired either at the end of the statement causing the triggering
|
||||||
@ -442,7 +442,7 @@ UPDATE OF <replaceable>column_name1</replaceable> [, <replaceable>column_name2</
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Use <xref linkend="sql-droptrigger"/> to remove a trigger.
|
Use <link linkend="sql-droptrigger"><command>DROP TRIGGER</command></link> to remove a trigger.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
|
@ -121,8 +121,8 @@ CREATE TYPE <replaceable class="parameter">name</replaceable>
|
|||||||
must be less than <symbol>NAMEDATALEN</symbol> bytes long (64 bytes in a
|
must be less than <symbol>NAMEDATALEN</symbol> bytes long (64 bytes in a
|
||||||
standard <productname>PostgreSQL</productname> build). (It is possible to
|
standard <productname>PostgreSQL</productname> build). (It is possible to
|
||||||
create an enumerated type with zero labels, but such a type cannot be used
|
create an enumerated type with zero labels, but such a type cannot be used
|
||||||
to hold values before at least one label is added using <xref
|
to hold values before at least one label is added using <link
|
||||||
linkend="sql-altertype"/>.)
|
linkend="sql-altertype"><command>ALTER TYPE</command></link>.)
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ CREATE USER <replaceable class="parameter">name</replaceable> [ [ WITH ] <replac
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
<command>CREATE USER</command> is now an alias for
|
<command>CREATE USER</command> is now an alias for
|
||||||
<xref linkend="sql-createrole"/>.
|
<link linkend="sql-createrole"><command>CREATE ROLE</command></link>.
|
||||||
The only difference is that when the command is spelled
|
The only difference is that when the command is spelled
|
||||||
<command>CREATE USER</command>, <literal>LOGIN</literal> is assumed
|
<command>CREATE USER</command>, <literal>LOGIN</literal> is assumed
|
||||||
by default, whereas <literal>NOLOGIN</literal> is assumed when
|
by default, whereas <literal>NOLOGIN</literal> is assumed when
|
||||||
|
@ -137,8 +137,8 @@ CREATE VIEW [ <replaceable>schema</replaceable> . ] <replaceable>view_name</repl
|
|||||||
This parameter may be either <literal>local</literal> or
|
This parameter may be either <literal>local</literal> or
|
||||||
<literal>cascaded</literal>, and is equivalent to specifying
|
<literal>cascaded</literal>, and is equivalent to specifying
|
||||||
<literal>WITH [ CASCADED | LOCAL ] CHECK OPTION</literal> (see below).
|
<literal>WITH [ CASCADED | LOCAL ] CHECK OPTION</literal> (see below).
|
||||||
This option can be changed on existing views using <xref
|
This option can be changed on existing views using <link
|
||||||
linkend="sql-alterview"/>.
|
linkend="sql-alterview"><command>ALTER VIEW</command></link>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -160,8 +160,8 @@ CREATE VIEW [ <replaceable>schema</replaceable> . ] <replaceable>view_name</repl
|
|||||||
<term><replaceable class="parameter">query</replaceable></term>
|
<term><replaceable class="parameter">query</replaceable></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
A <xref linkend="sql-select"/> or
|
A <link linkend="sql-select"><command>SELECT</command></link> or
|
||||||
<xref linkend="sql-values"/> command
|
<link linkend="sql-values"><command>VALUES</command></link> command
|
||||||
which will provide the columns and rows of the view.
|
which will provide the columns and rows of the view.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -245,7 +245,7 @@ CREATE VIEW [ <replaceable>schema</replaceable> . ] <replaceable>view_name</repl
|
|||||||
<title>Notes</title>
|
<title>Notes</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Use the <xref linkend="sql-dropview"/>
|
Use the <link linkend="sql-dropview"><command>DROP VIEW</command></link>
|
||||||
statement to drop views.
|
statement to drop views.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ PostgreSQL documentation
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
<application>createdb</application> is a wrapper around the
|
<application>createdb</application> is a wrapper around the
|
||||||
<acronym>SQL</acronym> command <xref linkend="sql-createdatabase"/>.
|
<acronym>SQL</acronym> command <link linkend="sql-createdatabase"><command>CREATE DATABASE</command></link>.
|
||||||
There is no effective difference between creating databases via
|
There is no effective difference between creating databases via
|
||||||
this utility and via other methods for accessing the server.
|
this utility and via other methods for accessing the server.
|
||||||
</para>
|
</para>
|
||||||
@ -197,7 +197,7 @@ PostgreSQL documentation
|
|||||||
The options <option>-D</option>, <option>-l</option>, <option>-E</option>,
|
The options <option>-D</option>, <option>-l</option>, <option>-E</option>,
|
||||||
<option>-O</option>, and
|
<option>-O</option>, and
|
||||||
<option>-T</option> correspond to options of the underlying
|
<option>-T</option> correspond to options of the underlying
|
||||||
SQL command <xref linkend="sql-createdatabase"/>; see there for more information
|
SQL command <link linkend="sql-createdatabase"><command>CREATE DATABASE</command></link>; see there for more information
|
||||||
about them.
|
about them.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ PostgreSQL documentation
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
<application>createuser</application> is a wrapper around the
|
<application>createuser</application> is a wrapper around the
|
||||||
<acronym>SQL</acronym> command <xref linkend="sql-createrole"/>.
|
<acronym>SQL</acronym> command <link linkend="sql-createrole"><command>CREATE ROLE</command></link>.
|
||||||
There is no effective difference between creating users via
|
There is no effective difference between creating users via
|
||||||
this utility and via other methods for accessing the server.
|
this utility and via other methods for accessing the server.
|
||||||
</para>
|
</para>
|
||||||
|
@ -39,7 +39,7 @@ DECLARE <replaceable class="parameter">name</replaceable> [ BINARY ] [ INSENSITI
|
|||||||
can be used to retrieve
|
can be used to retrieve
|
||||||
a small number of rows at a time out of a larger query.
|
a small number of rows at a time out of a larger query.
|
||||||
After the cursor is created, rows are fetched from it using
|
After the cursor is created, rows are fetched from it using
|
||||||
<xref linkend="sql-fetch"/>.
|
<link linkend="sql-fetch"><command>FETCH</command></link>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<note>
|
<note>
|
||||||
@ -124,8 +124,8 @@ DECLARE <replaceable class="parameter">name</replaceable> [ BINARY ] [ INSENSITI
|
|||||||
<term><replaceable class="parameter">query</replaceable></term>
|
<term><replaceable class="parameter">query</replaceable></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
A <xref linkend="sql-select"/> or
|
A <link linkend="sql-select"><command>SELECT</command></link> or
|
||||||
<xref linkend="sql-values"/> command
|
<link linkend="sql-values"><command>VALUES</command></link> command
|
||||||
which will provide the rows to be returned by the cursor.
|
which will provide the rows to be returned by the cursor.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -183,9 +183,9 @@ DECLARE <replaceable class="parameter">name</replaceable> [ BINARY ] [ INSENSITI
|
|||||||
<productname>PostgreSQL</productname> reports an error if such a
|
<productname>PostgreSQL</productname> reports an error if such a
|
||||||
command is used outside a transaction block.
|
command is used outside a transaction block.
|
||||||
Use
|
Use
|
||||||
<xref linkend="sql-begin"/> and
|
<link linkend="sql-begin"><command>BEGIN</command></link> and
|
||||||
<xref linkend="sql-commit"/>
|
<link linkend="sql-commit"><command>COMMIT</command></link>
|
||||||
(or <xref linkend="sql-rollback"/>)
|
(or <link linkend="sql-rollback"><command>ROLLBACK</command></link>)
|
||||||
to define a transaction block.
|
to define a transaction block.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -244,7 +244,7 @@ DECLARE <replaceable class="parameter">name</replaceable> [ BINARY ] [ INSENSITI
|
|||||||
If the cursor's query includes <literal>FOR UPDATE</literal> or <literal>FOR
|
If the cursor's query includes <literal>FOR UPDATE</literal> or <literal>FOR
|
||||||
SHARE</literal>, then returned rows are locked at the time they are first
|
SHARE</literal>, then returned rows are locked at the time they are first
|
||||||
fetched, in the same way as for a regular
|
fetched, in the same way as for a regular
|
||||||
<xref linkend="sql-select"/> command with
|
<link linkend="sql-select"><command>SELECT</command></link> command with
|
||||||
these options.
|
these options.
|
||||||
In addition, the returned rows will be the most up-to-date versions;
|
In addition, the returned rows will be the most up-to-date versions;
|
||||||
therefore these options provide the equivalent of what the SQL standard
|
therefore these options provide the equivalent of what the SQL standard
|
||||||
|
@ -41,7 +41,7 @@ DELETE FROM [ ONLY ] <replaceable class="parameter">table_name</replaceable> [ *
|
|||||||
|
|
||||||
<tip>
|
<tip>
|
||||||
<para>
|
<para>
|
||||||
<xref linkend="sql-truncate"/> provides a
|
<link linkend="sql-truncate"><command>TRUNCATE</command></link> provides a
|
||||||
faster mechanism to remove all rows from a table.
|
faster mechanism to remove all rows from a table.
|
||||||
</para>
|
</para>
|
||||||
</tip>
|
</tip>
|
||||||
|
@ -30,7 +30,7 @@ DROP GROUP [ IF EXISTS ] <replaceable class="parameter">name</replaceable> [, ..
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
<command>DROP GROUP</command> is now an alias for
|
<command>DROP GROUP</command> is now an alias for
|
||||||
<xref linkend="sql-droprole"/>.
|
<link linkend="sql-droprole"><command>DROP ROLE</command></link>.
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ DROP [ PROCEDURAL ] LANGUAGE [ IF EXISTS ] <replaceable class="parameter">name</
|
|||||||
<para>
|
<para>
|
||||||
As of <productname>PostgreSQL</productname> 9.1, most procedural
|
As of <productname>PostgreSQL</productname> 9.1, most procedural
|
||||||
languages have been made into <quote>extensions</quote>, and should
|
languages have been made into <quote>extensions</quote>, and should
|
||||||
therefore be removed with <xref linkend="sql-dropextension"/>
|
therefore be removed with <link linkend="sql-dropextension"><command>DROP EXTENSION</command></link>
|
||||||
not <command>DROP LANGUAGE</command>.
|
not <command>DROP LANGUAGE</command>.
|
||||||
</para>
|
</para>
|
||||||
</note>
|
</note>
|
||||||
|
@ -90,7 +90,7 @@ DROP OWNED BY { <replaceable class="parameter">name</replaceable> | CURRENT_ROLE
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The <xref linkend="sql-reassign-owned"/> command is an alternative that
|
The <link linkend="sql-reassign-owned"><command>REASSIGN OWNED</command></link> command is an alternative that
|
||||||
reassigns the ownership of all the database objects owned by one or
|
reassigns the ownership of all the database objects owned by one or
|
||||||
more roles. However, <command>REASSIGN OWNED</command> does not deal with
|
more roles. However, <command>REASSIGN OWNED</command> does not deal with
|
||||||
privileges for other objects.
|
privileges for other objects.
|
||||||
|
@ -40,7 +40,9 @@ DROP ROLE [ IF EXISTS ] <replaceable class="parameter">name</replaceable> [, ...
|
|||||||
of the cluster; an error will be raised if so. Before dropping the role,
|
of the cluster; an error will be raised if so. Before dropping the role,
|
||||||
you must drop all the objects it owns (or reassign their ownership)
|
you must drop all the objects it owns (or reassign their ownership)
|
||||||
and revoke any privileges the role has been granted on other objects.
|
and revoke any privileges the role has been granted on other objects.
|
||||||
The <xref linkend="sql-reassign-owned"/> and <xref linkend="sql-drop-owned"/>
|
The <link linkend="sql-reassign-owned"><command>REASSIGN
|
||||||
|
OWNED</command></link> and <link linkend="sql-drop-owned"><command>DROP
|
||||||
|
OWNED</command></link>
|
||||||
commands can be useful for this purpose; see <xref linkend="role-removal"/>
|
commands can be useful for this purpose; see <xref linkend="role-removal"/>
|
||||||
for more discussion.
|
for more discussion.
|
||||||
</para>
|
</para>
|
||||||
|
@ -32,8 +32,8 @@ DROP TABLE [ IF EXISTS ] <replaceable class="parameter">name</replaceable> [, ..
|
|||||||
<command>DROP TABLE</command> removes tables from the database.
|
<command>DROP TABLE</command> removes tables from the database.
|
||||||
Only the table owner, the schema owner, and superuser can drop a
|
Only the table owner, the schema owner, and superuser can drop a
|
||||||
table. To empty a table of rows
|
table. To empty a table of rows
|
||||||
without destroying the table, use <xref linkend="sql-delete"/>
|
without destroying the table, use <link linkend="sql-delete"><command>DELETE</command></link>
|
||||||
or <xref linkend="sql-truncate"/>.
|
or <link linkend="sql-truncate"><command>TRUNCATE</command></link>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
|
@ -30,7 +30,7 @@ DROP USER [ IF EXISTS ] <replaceable class="parameter">name</replaceable> [, ...
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
<command>DROP USER</command> is simply an alternate spelling of
|
<command>DROP USER</command> is simply an alternate spelling of
|
||||||
<xref linkend="sql-droprole"/>.
|
<link linkend="sql-droprole"><command>DROP ROLE</command></link>.
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ PostgreSQL documentation
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
<application>dropdb</application> is a wrapper around the
|
<application>dropdb</application> is a wrapper around the
|
||||||
<acronym>SQL</acronym> command <xref linkend="sql-dropdatabase"/>.
|
<acronym>SQL</acronym> command <link linkend="sql-dropdatabase"><command>DROP DATABASE</command></link>.
|
||||||
There is no effective difference between dropping databases via
|
There is no effective difference between dropping databases via
|
||||||
this utility and via other methods for accessing the server.
|
this utility and via other methods for accessing the server.
|
||||||
</para>
|
</para>
|
||||||
|
@ -42,7 +42,7 @@ PostgreSQL documentation
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
<application>dropuser</application> is a wrapper around the
|
<application>dropuser</application> is a wrapper around the
|
||||||
<acronym>SQL</acronym> command <xref linkend="sql-droprole"/>.
|
<acronym>SQL</acronym> command <link linkend="sql-droprole"><command>DROP ROLE</command></link>.
|
||||||
There is no effective difference between dropping users via
|
There is no effective difference between dropping users via
|
||||||
this utility and via other methods for accessing the server.
|
this utility and via other methods for accessing the server.
|
||||||
</para>
|
</para>
|
||||||
|
@ -33,7 +33,7 @@ END [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]
|
|||||||
made by the transaction become visible to others and are guaranteed
|
made by the transaction become visible to others and are guaranteed
|
||||||
to be durable if a crash occurs. This command is a
|
to be durable if a crash occurs. This command is a
|
||||||
<productname>PostgreSQL</productname> extension
|
<productname>PostgreSQL</productname> extension
|
||||||
that is equivalent to <xref linkend="sql-commit"/>.
|
that is equivalent to <link linkend="sql-commit"><command>COMMIT</command></link>.
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ END [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]
|
|||||||
<title>Notes</title>
|
<title>Notes</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Use <xref linkend="sql-rollback"/> to
|
Use <link linkend="sql-rollback"><command>ROLLBACK</command></link> to
|
||||||
abort a transaction.
|
abort a transaction.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -94,8 +94,8 @@ END;
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
<command>END</command> is a <productname>PostgreSQL</productname>
|
<command>END</command> is a <productname>PostgreSQL</productname>
|
||||||
extension that provides functionality equivalent to <xref
|
extension that provides functionality equivalent to <link
|
||||||
linkend="sql-commit"/>, which is
|
linkend="sql-commit"><command>COMMIT</command></link>, which is
|
||||||
specified in the SQL standard.
|
specified in the SQL standard.
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
@ -302,7 +302,7 @@ ROLLBACK;
|
|||||||
the <link linkend="autovacuum">autovacuum daemon</link> will take care
|
the <link linkend="autovacuum">autovacuum daemon</link> will take care
|
||||||
of that automatically. But if a table has recently had substantial
|
of that automatically. But if a table has recently had substantial
|
||||||
changes in its contents, you might need to do a manual
|
changes in its contents, you might need to do a manual
|
||||||
<xref linkend="sql-analyze"/> rather than wait for autovacuum to catch up
|
<link linkend="sql-analyze"><command>ANALYZE</command></link> rather than wait for autovacuum to catch up
|
||||||
with the changes.
|
with the changes.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
@ -335,9 +335,9 @@ FETCH <replaceable class="parameter">count</replaceable>
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<xref linkend="sql-declare"/>
|
<link linkend="sql-declare"><command>DECLARE</command></link>
|
||||||
is used to define a cursor. Use
|
is used to define a cursor. Use
|
||||||
<xref linkend="sql-move"/>
|
<link linkend="sql-move"><command>MOVE</command></link>
|
||||||
to change cursor position without retrieving data.
|
to change cursor position without retrieving data.
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
@ -259,7 +259,7 @@ GRANT <replaceable class="parameter">role_name</replaceable> [, ...] TO <replace
|
|||||||
<title>Notes</title>
|
<title>Notes</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The <xref linkend="sql-revoke"/> command is used
|
The <link linkend="sql-revoke"><command>REVOKE</command></link> command is used
|
||||||
to revoke access privileges.
|
to revoke access privileges.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
@ -186,9 +186,9 @@ LOCK [ TABLE ] [ ONLY ] <replaceable class="parameter">name</replaceable> [ * ]
|
|||||||
<productname>PostgreSQL</productname> reports an error if <command>LOCK</command>
|
<productname>PostgreSQL</productname> reports an error if <command>LOCK</command>
|
||||||
is used outside a transaction block.
|
is used outside a transaction block.
|
||||||
Use
|
Use
|
||||||
<xref linkend="sql-begin"/> and
|
<link linkend="sql-begin"><command>BEGIN</command></link> and
|
||||||
<xref linkend="sql-commit"/>
|
<link linkend="sql-commit"><command>COMMIT</command></link>
|
||||||
(or <xref linkend="sql-rollback"/>)
|
(or <link linkend="sql-rollback"><command>ROLLBACK</command></link>)
|
||||||
to define a transaction block.
|
to define a transaction block.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
@ -143,8 +143,8 @@ PostgreSQL documentation
|
|||||||
<para>
|
<para>
|
||||||
This option is meant for other programs that interact with a server
|
This option is meant for other programs that interact with a server
|
||||||
instance, such as <xref linkend="app-pg-ctl"/>, to query configuration
|
instance, such as <xref linkend="app-pg-ctl"/>, to query configuration
|
||||||
parameter values. User-facing applications should instead use <xref
|
parameter values. User-facing applications should instead use <link
|
||||||
linkend="sql-show"/> or the <structname>pg_settings</structname> view.
|
linkend="sql-show"><command>SHOW</command></link> or the <structname>pg_settings</structname> view.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -66,7 +66,7 @@ PREPARE <replaceable class="parameter">name</replaceable> [ ( <replaceable class
|
|||||||
also means that a single prepared statement cannot be used by
|
also means that a single prepared statement cannot be used by
|
||||||
multiple simultaneous database clients; however, each client can create
|
multiple simultaneous database clients; however, each client can create
|
||||||
their own prepared statement to use. Prepared statements can be
|
their own prepared statement to use. Prepared statements can be
|
||||||
manually cleaned up using the <xref linkend="sql-deallocate"/> command.
|
manually cleaned up using the <link linkend="sql-deallocate"><command>DEALLOCATE</command></link> command.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
@ -163,7 +163,7 @@ PREPARE <replaceable class="parameter">name</replaceable> [ ( <replaceable class
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
To examine the query plan <productname>PostgreSQL</productname> is using
|
To examine the query plan <productname>PostgreSQL</productname> is using
|
||||||
for a prepared statement, use <xref linkend="sql-explain"/>, for example
|
for a prepared statement, use <link linkend="sql-explain"><command>EXPLAIN</command></link>, for example
|
||||||
<programlisting>
|
<programlisting>
|
||||||
EXPLAIN EXECUTE <replaceable>name</replaceable>(<replaceable>parameter_values</replaceable>);
|
EXPLAIN EXECUTE <replaceable>name</replaceable>(<replaceable>parameter_values</replaceable>);
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
@ -39,8 +39,8 @@ PREPARE TRANSACTION <replaceable class="parameter">transaction_id</replaceable>
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
Once prepared, a transaction can later be committed or rolled back
|
Once prepared, a transaction can later be committed or rolled back
|
||||||
with <xref linkend="sql-commit-prepared"/>
|
with <link linkend="sql-commit-prepared"><command>COMMIT PREPARED</command></link>
|
||||||
or <xref linkend="sql-rollback-prepared"/>,
|
or <link linkend="sql-rollback-prepared"><command>ROLLBACK PREPARED</command></link>,
|
||||||
respectively. Those commands can be issued from any session, not
|
respectively. Those commands can be issued from any session, not
|
||||||
only the one that executed the original transaction.
|
only the one that executed the original transaction.
|
||||||
</para>
|
</para>
|
||||||
@ -92,8 +92,8 @@ PREPARE TRANSACTION <replaceable class="parameter">transaction_id</replaceable>
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
This command must be used inside a transaction block. Use <xref
|
This command must be used inside a transaction block. Use <link
|
||||||
linkend="sql-begin"/> to start one.
|
linkend="sql-begin"><command>BEGIN</command></link> to start one.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
|
@ -756,8 +756,8 @@ testdb=>
|
|||||||
<para>
|
<para>
|
||||||
Whenever a command is executed, <application>psql</application> also polls
|
Whenever a command is executed, <application>psql</application> also polls
|
||||||
for asynchronous notification events generated by
|
for asynchronous notification events generated by
|
||||||
<xref linkend="sql-listen"/> and
|
<link linkend="sql-listen"><command>LISTEN</command></link> and
|
||||||
<xref linkend="sql-notify"/>.
|
<link linkend="sql-notify"><command>NOTIFY</command></link>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
@ -993,7 +993,7 @@ testdb=>
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Performs a frontend (client) copy. This is an operation that
|
Performs a frontend (client) copy. This is an operation that
|
||||||
runs an <acronym>SQL</acronym> <xref linkend="sql-copy"/>
|
runs an <acronym>SQL</acronym> <link linkend="sql-copy"><command>COPY</command></link>
|
||||||
command, but instead of the server
|
command, but instead of the server
|
||||||
reading or writing the specified file,
|
reading or writing the specified file,
|
||||||
<application>psql</application> reads or writes the file and
|
<application>psql</application> reads or writes the file and
|
||||||
@ -1030,9 +1030,9 @@ testdb=>
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
The syntax of this command is similar to that of the
|
The syntax of this command is similar to that of the
|
||||||
<acronym>SQL</acronym> <xref linkend="sql-copy"/>
|
<acronym>SQL</acronym> <link linkend="sql-copy"><command>COPY</command></link>
|
||||||
command. All options other than the data source/destination are
|
command. All options other than the data source/destination are
|
||||||
as specified for <xref linkend="sql-copy"/>.
|
as specified for <command>COPY</command>.
|
||||||
Because of this, special parsing rules apply to the <command>\copy</command>
|
Because of this, special parsing rules apply to the <command>\copy</command>
|
||||||
meta-command. Unlike most other meta-commands, the entire remainder
|
meta-command. Unlike most other meta-commands, the entire remainder
|
||||||
of the line is always taken to be the arguments of <command>\copy</command>,
|
of the line is always taken to be the arguments of <command>\copy</command>,
|
||||||
@ -1397,8 +1397,8 @@ testdb=>
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Descriptions for objects can be created with the <xref
|
Descriptions for objects can be created with the <link
|
||||||
linkend="sql-comment"/>
|
linkend="sql-comment"><command>COMMENT</command></link>
|
||||||
<acronym>SQL</acronym> command.
|
<acronym>SQL</acronym> command.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -1435,9 +1435,9 @@ testdb=>
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The <xref linkend="sql-alterdefaultprivileges"/> command is used to set
|
The <link linkend="sql-alterdefaultprivileges"><command>ALTER DEFAULT
|
||||||
default access privileges. The meaning of the
|
PRIVILEGES</command></link> command is used to set default access
|
||||||
privilege display is explained in
|
privileges. The meaning of the privilege display is explained in
|
||||||
<xref linkend="ddl-priv"/>.
|
<xref linkend="ddl-priv"/>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -1751,8 +1751,8 @@ testdb=>
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The <xref linkend="sql-grant"/> and
|
The <link linkend="sql-grant"><command>GRANT</command></link> and
|
||||||
<xref linkend="sql-revoke"/>
|
<link linkend="sql-revoke"><command>REVOKE</command></link>
|
||||||
commands are used to set access privileges. The meaning of the
|
commands are used to set access privileges. The meaning of the
|
||||||
privilege display is explained in
|
privilege display is explained in
|
||||||
<xref linkend="ddl-priv"/>.
|
<xref linkend="ddl-priv"/>.
|
||||||
@ -1807,8 +1807,8 @@ testdb=>
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The <xref linkend="sql-alterrole"/> and
|
The <link linkend="sql-alterrole"><command>ALTER ROLE</command></link> and
|
||||||
<xref linkend="sql-alterdatabase"/>
|
<link linkend="sql-alterdatabase"><command>ALTER DATABASE</command></link>
|
||||||
commands are used to define per-role and per-database configuration
|
commands are used to define per-role and per-database configuration
|
||||||
settings.
|
settings.
|
||||||
</para>
|
</para>
|
||||||
@ -3179,7 +3179,7 @@ lo_import 152801
|
|||||||
<note>
|
<note>
|
||||||
<para>
|
<para>
|
||||||
This command is unrelated to the <acronym>SQL</acronym>
|
This command is unrelated to the <acronym>SQL</acronym>
|
||||||
command <xref linkend="sql-set"/>.
|
command <link linkend="sql-set"><command>SET</command></link>.
|
||||||
</para>
|
</para>
|
||||||
</note>
|
</note>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
@ -82,7 +82,7 @@ REASSIGN OWNED BY { <replaceable class="parameter">old_role</replaceable> | CURR
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The <xref linkend="sql-drop-owned"/> command is an alternative that
|
The <link linkend="sql-drop-owned"><command>DROP OWNED</command></link> command is an alternative that
|
||||||
simply drops all the database objects owned by one or more roles.
|
simply drops all the database objects owned by one or more roles.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ REFRESH MATERIALIZED VIEW [ CONCURRENTLY ] <replaceable class="parameter">name</
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
While the default index for future
|
While the default index for future
|
||||||
<xref linkend="sql-cluster"/>
|
<link linkend="sql-cluster"><command>CLUSTER</command></link>
|
||||||
operations is retained, <command>REFRESH MATERIALIZED VIEW</command> does not
|
operations is retained, <command>REFRESH MATERIALIZED VIEW</command> does not
|
||||||
order the generated rows based on this property. If you want the data
|
order the generated rows based on this property. If you want the data
|
||||||
to be ordered upon generation, you must use an <literal>ORDER BY</literal>
|
to be ordered upon generation, you must use an <literal>ORDER BY</literal>
|
||||||
|
@ -93,7 +93,7 @@ PostgreSQL documentation
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
<application>reindexdb</application> is a wrapper around the SQL
|
<application>reindexdb</application> is a wrapper around the SQL
|
||||||
command <xref linkend="sql-reindex"/>.
|
command <link linkend="sql-reindex"><command>REINDEX</command></link>.
|
||||||
There is no effective difference between reindexing databases via
|
There is no effective difference between reindexing databases via
|
||||||
this utility and via other methods for accessing the server.
|
this utility and via other methods for accessing the server.
|
||||||
</para>
|
</para>
|
||||||
|
@ -131,7 +131,7 @@ REVOKE [ ADMIN OPTION FOR ]
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
See the description of the <xref linkend="sql-grant"/> command for
|
See the description of the <link linkend="sql-grant"><command>GRANT</command></link> command for
|
||||||
the meaning of the privilege types.
|
the meaning of the privilege types.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -292,7 +292,7 @@ REVOKE admins FROM joe;
|
|||||||
<title>Compatibility</title>
|
<title>Compatibility</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The compatibility notes of the <xref linkend="sql-grant"/> command
|
The compatibility notes of the <link linkend="sql-grant"><command>GRANT</command></link> command
|
||||||
apply analogously to <command>REVOKE</command>.
|
apply analogously to <command>REVOKE</command>.
|
||||||
The keyword <literal>RESTRICT</literal> or <literal>CASCADE</literal>
|
The keyword <literal>RESTRICT</literal> or <literal>CASCADE</literal>
|
||||||
is required according to the standard, but <productname>PostgreSQL</productname>
|
is required according to the standard, but <productname>PostgreSQL</productname>
|
||||||
|
@ -70,7 +70,7 @@ ROLLBACK [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]
|
|||||||
<title>Notes</title>
|
<title>Notes</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Use <xref linkend="sql-commit"/> to
|
Use <link linkend="sql-commit"><command>COMMIT</command></link> to
|
||||||
successfully terminate a transaction.
|
successfully terminate a transaction.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ ROLLBACK [ WORK | TRANSACTION ] TO [ SAVEPOINT ] <replaceable>savepoint_name</re
|
|||||||
<title>Notes</title>
|
<title>Notes</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Use <xref linkend="sql-release-savepoint"/> to destroy a savepoint
|
Use <link linkend="sql-release-savepoint"><command>RELEASE SAVEPOINT</command></link> to destroy a savepoint
|
||||||
without discarding the effects of commands executed after it was
|
without discarding the effects of commands executed after it was
|
||||||
established.
|
established.
|
||||||
</para>
|
</para>
|
||||||
|
@ -64,8 +64,8 @@ SAVEPOINT <replaceable>savepoint_name</replaceable>
|
|||||||
<title>Notes</title>
|
<title>Notes</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Use <xref linkend="sql-rollback-to"/> to
|
Use <link linkend="sql-rollback-to"><command>ROLLBACK TO</command></link> to
|
||||||
rollback to a savepoint. Use <xref linkend="sql-release-savepoint"/>
|
rollback to a savepoint. Use <link linkend="sql-release-savepoint"><command>RELEASE SAVEPOINT</command></link>
|
||||||
to destroy a savepoint, keeping
|
to destroy a savepoint, keeping
|
||||||
the effects of commands executed after it was established.
|
the effects of commands executed after it was established.
|
||||||
</para>
|
</para>
|
||||||
|
@ -446,7 +446,7 @@ TABLE [ ONLY ] <replaceable class="parameter">table_name</replaceable> [ * ]
|
|||||||
sub-<command>SELECT</command> must be surrounded by
|
sub-<command>SELECT</command> must be surrounded by
|
||||||
parentheses, and an alias <emphasis>must</emphasis> be
|
parentheses, and an alias <emphasis>must</emphasis> be
|
||||||
provided for it. A
|
provided for it. A
|
||||||
<xref linkend="sql-values"/> command
|
<link linkend="sql-values"><command>VALUES</command></link> command
|
||||||
can also be used here.
|
can also be used here.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -1534,7 +1534,7 @@ KEY SHARE
|
|||||||
to the row-level lock(s) — the required <literal>ROW SHARE</literal>
|
to the row-level lock(s) — the required <literal>ROW SHARE</literal>
|
||||||
table-level lock is still taken in the ordinary way (see
|
table-level lock is still taken in the ordinary way (see
|
||||||
<xref linkend="mvcc"/>). You can use
|
<xref linkend="mvcc"/>). You can use
|
||||||
<xref linkend="sql-lock"/>
|
<link linkend="sql-lock"><command>LOCK</command></link>
|
||||||
with the <literal>NOWAIT</literal> option first,
|
with the <literal>NOWAIT</literal> option first,
|
||||||
if you need to acquire the table-level lock without waiting.
|
if you need to acquire the table-level lock without waiting.
|
||||||
</para>
|
</para>
|
||||||
|
@ -95,7 +95,7 @@ SELECT [ ALL | DISTINCT [ ON ( <replaceable class="parameter">expression</replac
|
|||||||
<title>Notes</title>
|
<title>Notes</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<xref linkend="sql-createtableas"/> is functionally similar to
|
<link linkend="sql-createtableas"><command>CREATE TABLE AS</command></link> is functionally similar to
|
||||||
<command>SELECT INTO</command>. <command>CREATE TABLE AS</command>
|
<command>SELECT INTO</command>. <command>CREATE TABLE AS</command>
|
||||||
is the recommended syntax, since this form of <command>SELECT
|
is the recommended syntax, since this form of <command>SELECT
|
||||||
INTO</command> is not available in <application>ECPG</application>
|
INTO</command> is not available in <application>ECPG</application>
|
||||||
@ -109,8 +109,8 @@ SELECT [ ALL | DISTINCT [ ON ( <replaceable class="parameter">expression</replac
|
|||||||
In contrast to <command>CREATE TABLE AS</command>, <command>SELECT
|
In contrast to <command>CREATE TABLE AS</command>, <command>SELECT
|
||||||
INTO</command> does not allow to specify properties like a table's access
|
INTO</command> does not allow to specify properties like a table's access
|
||||||
method with <xref linkend="sql-createtable-method" /> or the table's
|
method with <xref linkend="sql-createtable-method" /> or the table's
|
||||||
tablespace with <xref linkend="sql-createtable-tablespace" />. Use <xref
|
tablespace with <xref linkend="sql-createtable-tablespace" />. Use
|
||||||
linkend="sql-createtableas"/> if necessary. Therefore, the default table
|
<command>CREATE TABLE AS</command> if necessary. Therefore, the default table
|
||||||
access method is chosen for the new table. See <xref
|
access method is chosen for the new table. See <xref
|
||||||
linkend="guc-default-table-access-method"/> for more information.
|
linkend="guc-default-table-access-method"/> for more information.
|
||||||
</para>
|
</para>
|
||||||
|
@ -48,7 +48,7 @@ RESET ROLE
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
The <literal>SESSION</literal> and <literal>LOCAL</literal> modifiers act the same
|
The <literal>SESSION</literal> and <literal>LOCAL</literal> modifiers act the same
|
||||||
as for the regular <xref linkend="sql-set"/>
|
as for the regular <link linkend="sql-set"><command>SET</command></link>
|
||||||
command.
|
command.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ RESET ROLE
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
<command>SET ROLE</command> has effects comparable to
|
<command>SET ROLE</command> has effects comparable to
|
||||||
<xref linkend="sql-set-session-authorization"/>, but the privilege
|
<link linkend="sql-set-session-authorization"><command>SET SESSION AUTHORIZATION</command></link>, but the privilege
|
||||||
checks involved are quite different. Also,
|
checks involved are quite different. Also,
|
||||||
<command>SET SESSION AUTHORIZATION</command> determines which roles are
|
<command>SET SESSION AUTHORIZATION</command> determines which roles are
|
||||||
allowable for later <command>SET ROLE</command> commands, whereas changing
|
allowable for later <command>SET ROLE</command> commands, whereas changing
|
||||||
@ -92,7 +92,7 @@ RESET ROLE
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
<command>SET ROLE</command> does not process session variables as specified by
|
<command>SET ROLE</command> does not process session variables as specified by
|
||||||
the role's <xref linkend="sql-alterrole"/> settings; this only happens during
|
the role's <link linkend="sql-alterrole"><command>ALTER ROLE</command></link> settings; this only happens during
|
||||||
login.
|
login.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ RESET SESSION AUTHORIZATION
|
|||||||
identifier is normally equal to the session user identifier, but
|
identifier is normally equal to the session user identifier, but
|
||||||
might change temporarily in the context of <literal>SECURITY DEFINER</literal>
|
might change temporarily in the context of <literal>SECURITY DEFINER</literal>
|
||||||
functions and similar mechanisms; it can also be changed by
|
functions and similar mechanisms; it can also be changed by
|
||||||
<xref linkend="sql-set-role"/>.
|
<link linkend="sql-set-role"><command>SET ROLE</command></link>.
|
||||||
The current user identifier is relevant for permission checking.
|
The current user identifier is relevant for permission checking.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ RESET SESSION AUTHORIZATION
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
The <literal>SESSION</literal> and <literal>LOCAL</literal> modifiers act the same
|
The <literal>SESSION</literal> and <literal>LOCAL</literal> modifiers act the same
|
||||||
as for the regular <xref linkend="sql-set"/>
|
as for the regular <link linkend="sql-set"><command>SET</command></link>
|
||||||
command.
|
command.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
@ -37,8 +37,8 @@ START TRANSACTION [ <replaceable class="parameter">transaction_mode</replaceable
|
|||||||
<para>
|
<para>
|
||||||
This command begins a new transaction block. If the isolation level,
|
This command begins a new transaction block. If the isolation level,
|
||||||
read/write mode, or deferrable mode is specified, the new transaction has those
|
read/write mode, or deferrable mode is specified, the new transaction has those
|
||||||
characteristics, as if <xref linkend="sql-set-transaction"/> was executed. This is the same
|
characteristics, as if <link linkend="sql-set-transaction"><command>SET TRANSACTION</command></link> was executed. This is the same
|
||||||
as the <xref linkend="sql-begin"/> command.
|
as the <link linkend="sql-begin"><command>BEGIN</command></link> command.
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ PostgreSQL documentation
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
<application>vacuumdb</application> is a wrapper around the SQL
|
<application>vacuumdb</application> is a wrapper around the SQL
|
||||||
command <xref linkend="sql-vacuum"/>.
|
command <link linkend="sql-vacuum"><command>VACUUM</command></link>.
|
||||||
There is no effective difference between vacuuming and analyzing
|
There is no effective difference between vacuuming and analyzing
|
||||||
databases via this utility and via other methods for accessing the
|
databases via this utility and via other methods for accessing the
|
||||||
server.
|
server.
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The <xref linkend="sql-security-label"/> statement allows assignment of
|
The <link linkend="sql-security-label"><command>SECURITY LABEL</command></link> statement allows assignment of
|
||||||
a security label to a database object.
|
a security label to a database object.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -451,7 +451,7 @@ UPDATE t1 SET x = 2, y = func1(y) WHERE z = 100;
|
|||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
<xref linkend="sql-createdatabase"/> additionally requires
|
<link linkend="sql-createdatabase"><command>CREATE DATABASE</command></link> additionally requires
|
||||||
<literal>getattr</literal> permission for the source or template database.
|
<literal>getattr</literal> permission for the source or template database.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -509,7 +509,7 @@ UPDATE t1 SET x = 2, y = func1(y) WHERE z = 100;
|
|||||||
</listitem>
|
</listitem>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Using <xref linkend="sql-security-label"/> on an object additionally
|
Using <link linkend="sql-security-label"><command>SECURITY LABEL</command></link> on an object additionally
|
||||||
requires <literal>relabelfrom</literal> permission for the object in
|
requires <literal>relabelfrom</literal> permission for the object in
|
||||||
conjunction with its old security label and <literal>relabelto</literal>
|
conjunction with its old security label and <literal>relabelto</literal>
|
||||||
permission for the object in conjunction with its new security label.
|
permission for the object in conjunction with its new security label.
|
||||||
@ -644,7 +644,7 @@ ERROR: SELinux: security policy violation
|
|||||||
<sect3>
|
<sect3>
|
||||||
<title>Miscellaneous</title>
|
<title>Miscellaneous</title>
|
||||||
<para>
|
<para>
|
||||||
We reject the <xref linkend="sql-load"/> command across the board, because
|
We reject the <link linkend="sql-load"><command>LOAD</command></link> command across the board, because
|
||||||
any module loaded could easily circumvent security policy enforcement.
|
any module loaded could easily circumvent security policy enforcement.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<para>
|
<para>
|
||||||
The <filename>tsm_system_rows</filename> module provides the table sampling method
|
The <filename>tsm_system_rows</filename> module provides the table sampling method
|
||||||
<literal>SYSTEM_ROWS</literal>, which can be used in
|
<literal>SYSTEM_ROWS</literal>, which can be used in
|
||||||
the <literal>TABLESAMPLE</literal> clause of a <xref linkend="sql-select"/>
|
the <literal>TABLESAMPLE</literal> clause of a <link linkend="sql-select"><command>SELECT</command></link>
|
||||||
command.
|
command.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<para>
|
<para>
|
||||||
The <filename>tsm_system_time</filename> module provides the table sampling method
|
The <filename>tsm_system_time</filename> module provides the table sampling method
|
||||||
<literal>SYSTEM_TIME</literal>, which can be used in
|
<literal>SYSTEM_TIME</literal>, which can be used in
|
||||||
the <literal>TABLESAMPLE</literal> clause of a <xref linkend="sql-select"/>
|
the <literal>TABLESAMPLE</literal> clause of a <link linkend="sql-select"><command>SELECT</command></link>
|
||||||
command.
|
command.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
@ -51,8 +51,8 @@
|
|||||||
operating system users. In practice it might be convenient to
|
operating system users. In practice it might be convenient to
|
||||||
maintain a correspondence, but this is not required. Database roles
|
maintain a correspondence, but this is not required. Database roles
|
||||||
are global across a database cluster installation (and not
|
are global across a database cluster installation (and not
|
||||||
per individual database). To create a role use the <xref
|
per individual database). To create a role use the <link
|
||||||
linkend="sql-createrole"/> SQL command:
|
linkend="sql-createrole"><command>CREATE ROLE</command></link> SQL command:
|
||||||
<synopsis>
|
<synopsis>
|
||||||
CREATE ROLE <replaceable>name</replaceable>;
|
CREATE ROLE <replaceable>name</replaceable>;
|
||||||
</synopsis>
|
</synopsis>
|
||||||
@ -61,7 +61,7 @@ CREATE ROLE <replaceable>name</replaceable>;
|
|||||||
double-quoted. (In practice, you will usually want to add additional
|
double-quoted. (In practice, you will usually want to add additional
|
||||||
options, such as <literal>LOGIN</literal>, to the command. More details appear
|
options, such as <literal>LOGIN</literal>, to the command. More details appear
|
||||||
below.) To remove an existing role, use the analogous
|
below.) To remove an existing role, use the analogous
|
||||||
<xref linkend="sql-droprole"/> command:
|
<link linkend="sql-droprole"><command>DROP ROLE</command></link> command:
|
||||||
<synopsis>
|
<synopsis>
|
||||||
DROP ROLE <replaceable>name</replaceable>;
|
DROP ROLE <replaceable>name</replaceable>;
|
||||||
</synopsis>
|
</synopsis>
|
||||||
@ -303,8 +303,8 @@ CREATE ROLE <replaceable>name</replaceable>;
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
Once the group role exists, you can add and remove members using the
|
Once the group role exists, you can add and remove members using the
|
||||||
<xref linkend="sql-grant"/> and
|
<link linkend="sql-grant"><command>GRANT</command></link> and
|
||||||
<xref linkend="sql-revoke"/> commands:
|
<link linkend="sql-revoke"><command>REVOKE</command></link> commands:
|
||||||
<synopsis>
|
<synopsis>
|
||||||
GRANT <replaceable>group_role</replaceable> TO <replaceable>role1</replaceable>, ... ;
|
GRANT <replaceable>group_role</replaceable> TO <replaceable>role1</replaceable>, ... ;
|
||||||
REVOKE <replaceable>group_role</replaceable> FROM <replaceable>role1</replaceable>, ... ;
|
REVOKE <replaceable>group_role</replaceable> FROM <replaceable>role1</replaceable>, ... ;
|
||||||
@ -319,7 +319,7 @@ REVOKE <replaceable>group_role</replaceable> FROM <replaceable>role1</replaceabl
|
|||||||
<para>
|
<para>
|
||||||
The members of a group role can use the privileges of the role in two
|
The members of a group role can use the privileges of the role in two
|
||||||
ways. First, every member of a group can explicitly do
|
ways. First, every member of a group can explicitly do
|
||||||
<xref linkend="sql-set-role"/> to
|
<link linkend="sql-set-role"><command>SET ROLE</command></link> to
|
||||||
temporarily <quote>become</quote> the group role. In this state, the
|
temporarily <quote>become</quote> the group role. In this state, the
|
||||||
database session has access to the privileges of the group role rather
|
database session has access to the privileges of the group role rather
|
||||||
than the original login role, and any database objects created are
|
than the original login role, and any database objects created are
|
||||||
@ -402,8 +402,8 @@ RESET ROLE;
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
To destroy a group role, use <xref
|
To destroy a group role, use <link
|
||||||
linkend="sql-droprole"/>:
|
linkend="sql-droprole"><command>DROP ROLE</command></link>:
|
||||||
<synopsis>
|
<synopsis>
|
||||||
DROP ROLE <replaceable>name</replaceable>;
|
DROP ROLE <replaceable>name</replaceable>;
|
||||||
</synopsis>
|
</synopsis>
|
||||||
@ -418,7 +418,7 @@ DROP ROLE <replaceable>name</replaceable>;
|
|||||||
<para>
|
<para>
|
||||||
Because roles can own database objects and can hold privileges
|
Because roles can own database objects and can hold privileges
|
||||||
to access other objects, dropping a role is often not just a matter of a
|
to access other objects, dropping a role is often not just a matter of a
|
||||||
quick <xref linkend="sql-droprole"/>. Any objects owned by the role must
|
quick <link linkend="sql-droprole"><command>DROP ROLE</command></link>. Any objects owned by the role must
|
||||||
first be dropped or reassigned to other owners; and any permissions
|
first be dropped or reassigned to other owners; and any permissions
|
||||||
granted to the role must be revoked.
|
granted to the role must be revoked.
|
||||||
</para>
|
</para>
|
||||||
@ -429,7 +429,7 @@ DROP ROLE <replaceable>name</replaceable>;
|
|||||||
<programlisting>
|
<programlisting>
|
||||||
ALTER TABLE bobs_table OWNER TO alice;
|
ALTER TABLE bobs_table OWNER TO alice;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
Alternatively, the <xref linkend="sql-reassign-owned"/> command can be
|
Alternatively, the <link linkend="sql-reassign-owned"><command>REASSIGN OWNED</command></link> command can be
|
||||||
used to reassign ownership of all objects owned by the role-to-be-dropped
|
used to reassign ownership of all objects owned by the role-to-be-dropped
|
||||||
to a single other role. Because <command>REASSIGN OWNED</command> cannot access
|
to a single other role. Because <command>REASSIGN OWNED</command> cannot access
|
||||||
objects in other databases, it is necessary to run it in each database
|
objects in other databases, it is necessary to run it in each database
|
||||||
@ -442,7 +442,7 @@ ALTER TABLE bobs_table OWNER TO alice;
|
|||||||
<para>
|
<para>
|
||||||
Once any valuable objects have been transferred to new owners, any
|
Once any valuable objects have been transferred to new owners, any
|
||||||
remaining objects owned by the role-to-be-dropped can be dropped with
|
remaining objects owned by the role-to-be-dropped can be dropped with
|
||||||
the <xref linkend="sql-drop-owned"/> command. Again, this command cannot
|
the <link linkend="sql-drop-owned"><command>DROP OWNED</command></link> command. Again, this command cannot
|
||||||
access objects in other databases, so it is necessary to run it in each
|
access objects in other databases, so it is necessary to run it in each
|
||||||
database that contains objects owned by the role. Also, <command>DROP
|
database that contains objects owned by the role. Also, <command>DROP
|
||||||
OWNED</command> will not drop entire databases or tablespaces, so it is
|
OWNED</command> will not drop entire databases or tablespaces, so it is
|
||||||
@ -598,7 +598,7 @@ DROP ROLE doomed_role;
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
Administrators can grant access to these roles to users using the
|
Administrators can grant access to these roles to users using the
|
||||||
<xref linkend="sql-grant"/> command, for example:
|
<link linkend="sql-grant"><command>GRANT</command></link> command, for example:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
GRANT pg_signal_backend TO admin_user;
|
GRANT pg_signal_backend TO admin_user;
|
||||||
|
@ -490,7 +490,7 @@ SELECT percentile_disc(0.5) WITHIN GROUP (ORDER BY income) FROM households;
|
|||||||
Also, because the final function performs the sort, it is not possible
|
Also, because the final function performs the sort, it is not possible
|
||||||
to continue adding input rows by executing the transition function again
|
to continue adding input rows by executing the transition function again
|
||||||
later. This means the final function is not <literal>READ_ONLY</literal>;
|
later. This means the final function is not <literal>READ_ONLY</literal>;
|
||||||
it must be declared in <xref linkend="sql-createaggregate"/>
|
it must be declared in <link linkend="sql-createaggregate"><command>CREATE AGGREGATE</command></link>
|
||||||
as <literal>READ_WRITE</literal>, or as <literal>SHAREABLE</literal> if
|
as <literal>READ_WRITE</literal>, or as <literal>SHAREABLE</literal> if
|
||||||
it's possible for additional final-function calls to make use of the
|
it's possible for additional final-function calls to make use of the
|
||||||
already-sorted state.
|
already-sorted state.
|
||||||
|
@ -85,7 +85,7 @@
|
|||||||
that a procedure does not return a value, so there is no return type
|
that a procedure does not return a value, so there is no return type
|
||||||
declaration. While a function is called as part of a query or DML
|
declaration. While a function is called as part of a query or DML
|
||||||
command, a procedure is called in isolation using
|
command, a procedure is called in isolation using
|
||||||
the <xref linkend="sql-call"/> command. If the CALL command is not
|
the <link linkend="sql-call"><command>CALL</command></link> command. If the <command>CALL</command> command is not
|
||||||
part of an explicit transaction, a procedure in many server-side
|
part of an explicit transaction, a procedure in many server-side
|
||||||
languages can commit, rollback, and begin new transactions during
|
languages can commit, rollback, and begin new transactions during
|
||||||
its execution, which is not possible in functions.
|
its execution, which is not possible in functions.
|
||||||
@ -94,15 +94,15 @@
|
|||||||
<para>
|
<para>
|
||||||
The explanations on how to define user-defined functions in the rest of
|
The explanations on how to define user-defined functions in the rest of
|
||||||
this chapter apply to procedures as well, except that
|
this chapter apply to procedures as well, except that
|
||||||
the <xref linkend="sql-createprocedure"/> command is used instead, there is
|
the <link linkend="sql-createprocedure"><command>CREATE PROCEDURE</command></link> command is used instead, there is
|
||||||
no return type, and some other features such as strictness don't apply.
|
no return type, and some other features such as strictness don't apply.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Collectively, functions and procedures are also known
|
Collectively, functions and procedures are also known
|
||||||
as <firstterm>routines</firstterm><indexterm><primary>routine</primary></indexterm>.
|
as <firstterm>routines</firstterm><indexterm><primary>routine</primary></indexterm>.
|
||||||
There are commands such as <xref linkend="sql-alterroutine"/>
|
There are commands such as <link linkend="sql-alterroutine"><command>ALTER ROUTINE</command></link>
|
||||||
and <xref linkend="sql-droproutine"/> that can operate on functions and
|
and <link linkend="sql-droproutine"><command>DROP ROUTINE</command></link> that can operate on functions and
|
||||||
procedures without having to know which kind it is. Note, however, that
|
procedures without having to know which kind it is. Note, however, that
|
||||||
there is no <literal>CREATE ROUTINE</literal> command.
|
there is no <literal>CREATE ROUTINE</literal> command.
|
||||||
</para>
|
</para>
|
||||||
@ -1531,7 +1531,7 @@ CREATE FUNCTION test(int, int) RETURNS int
|
|||||||
Every function has a <firstterm>volatility</firstterm> classification, with
|
Every function has a <firstterm>volatility</firstterm> classification, with
|
||||||
the possibilities being <literal>VOLATILE</literal>, <literal>STABLE</literal>, or
|
the possibilities being <literal>VOLATILE</literal>, <literal>STABLE</literal>, or
|
||||||
<literal>IMMUTABLE</literal>. <literal>VOLATILE</literal> is the default if the
|
<literal>IMMUTABLE</literal>. <literal>VOLATILE</literal> is the default if the
|
||||||
<xref linkend="sql-createfunction"/>
|
<link linkend="sql-createfunction"><command>CREATE FUNCTION</command></link>
|
||||||
command does not specify a category. The volatility category is a
|
command does not specify a category. The volatility category is a
|
||||||
promise to the optimizer about the behavior of the function:
|
promise to the optimizer about the behavior of the function:
|
||||||
|
|
||||||
@ -3432,7 +3432,7 @@ if (!ptr)
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
Some basic facts can be supplied by declarative annotations provided in
|
Some basic facts can be supplied by declarative annotations provided in
|
||||||
the <xref linkend="sql-createfunction"/> command. Most important of
|
the <link linkend="sql-createfunction"><command>CREATE FUNCTION</command></link> command. Most important of
|
||||||
these is the function's <link linkend="xfunc-volatility">volatility
|
these is the function's <link linkend="xfunc-volatility">volatility
|
||||||
category</link> (<literal>IMMUTABLE</literal>, <literal>STABLE</literal>,
|
category</link> (<literal>IMMUTABLE</literal>, <literal>STABLE</literal>,
|
||||||
or <literal>VOLATILE</literal>); one should always be careful to
|
or <literal>VOLATILE</literal>); one should always be careful to
|
||||||
|
@ -103,7 +103,7 @@ CREATE FUNCTION <replaceable>handler_function_name</replaceable>()
|
|||||||
<para>
|
<para>
|
||||||
Optionally, the language handler can provide an <quote>inline</quote>
|
Optionally, the language handler can provide an <quote>inline</quote>
|
||||||
handler function that executes anonymous code blocks
|
handler function that executes anonymous code blocks
|
||||||
(<xref linkend="sql-do"/> commands)
|
(<link linkend="sql-do"><command>DO</command></link> commands)
|
||||||
written in this language. If an inline handler function
|
written in this language. If an inline handler function
|
||||||
is provided by the language, declare it with a command like
|
is provided by the language, declare it with a command like
|
||||||
<synopsis>
|
<synopsis>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user