Fix markup for docbook2man man page generation.
No big deal; fixed lots of other markup at the same time. Bigest change: make sure there is no whitespace in front of <term> contents. This will probably help the other output types too.
This commit is contained in:
parent
192a66e3da
commit
a4ac2f458e
|
@ -1,135 +1,152 @@
|
||||||
<REFENTRY ID="SQL-ABORT">
|
<refentry id="SQL-ABORT">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
ABORT
|
|
||||||
</REFENTRYTITLE>
|
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
|
||||||
</REFMETA>
|
|
||||||
<REFNAMEDIV>
|
|
||||||
<REFNAME>
|
|
||||||
ABORT
|
|
||||||
</REFNAME>
|
|
||||||
<REFPURPOSE>
|
|
||||||
Aborts the current transaction
|
|
||||||
</REFPURPOSE>
|
|
||||||
</REFNAMEDIV>
|
|
||||||
<REFSYNOPSISDIV>
|
|
||||||
<REFSYNOPSISDIVINFO>
|
|
||||||
<DATE>1998-09-27</DATE>
|
|
||||||
</REFSYNOPSISDIVINFO>
|
|
||||||
<SYNOPSIS>
|
|
||||||
ABORT
|
|
||||||
</SYNOPSIS>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-ABORT-1">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-09-27</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Inputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
None.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
</REFSECT2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-ABORT-2">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-09-27</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Outputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
ABORT
|
ABORT
|
||||||
</TERM>
|
</refentrytitle>
|
||||||
<LISTITEM>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
<PARA>
|
</refmeta>
|
||||||
Message returned if successful.
|
<refnamediv>
|
||||||
</para>
|
<refname>
|
||||||
</listitem>
|
ABORT
|
||||||
</VARLISTENTRY>
|
</refname>
|
||||||
<VARLISTENTRY>
|
<refpurpose>
|
||||||
<TERM>
|
Aborts the current transaction
|
||||||
|
</refpurpose>
|
||||||
|
</refnamediv>
|
||||||
|
<refsynopsisdiv>
|
||||||
|
<refsynopsisdivinfo>
|
||||||
|
<date>1998-09-27</date>
|
||||||
|
</refsynopsisdivinfo>
|
||||||
|
<synopsis>
|
||||||
|
ABORT [ TRANSACTION | WORK ]
|
||||||
|
</synopsis>
|
||||||
|
|
||||||
|
<refsect2 id="R2-SQL-ABORT-1">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-09-27</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
Inputs
|
||||||
|
</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
None.
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
|
||||||
|
<refsect2 id="R2-SQL-ABORT-2">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-09-27</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
Outputs
|
||||||
|
</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
ABORT
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Message returned if successful.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
NOTICE: UserAbortTransactionBlock and not in in-progress state
|
NOTICE: UserAbortTransactionBlock and not in in-progress state
|
||||||
ABORT
|
ABORT
|
||||||
</TERM>
|
</computeroutput></term>
|
||||||
<LISTITEM>
|
<listitem>
|
||||||
<PARA>
|
<para>
|
||||||
If there is not any transaction currently in progress.
|
If there is not any transaction currently in progress.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</VARLISTENTRY>
|
</varlistentry>
|
||||||
</VARIABLELIST>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</REFSYNOPSISDIV>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-ABORT-1">
|
<refsect1 id="R1-SQL-ABORT-1">
|
||||||
<REFSECT1INFO>
|
<refsect1info>
|
||||||
<DATE>1998-09-27</DATE>
|
<date>1998-09-27</date>
|
||||||
</REFSECT1INFO>
|
</refsect1info>
|
||||||
<TITLE>
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<command>ABORT</command> rolls back the current transaction and causes
|
<command>ABORT</command> rolls back the current transaction and causes
|
||||||
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 <acronym>SQL92</acronym> command <command>ROLLBACK</command>,
|
in behavior to the <acronym>SQL92</acronym> command <command>ROLLBACK</command>,
|
||||||
and is present only for historical reasons.
|
and is present only for historical reasons.
|
||||||
</para>
|
</para>
|
||||||
<REFSECT2 ID="R2-SQL-ABORT-3">
|
<refsect2 id="R2-SQL-ABORT-3">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-27</DATE>
|
<date>1998-09-27</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Notes
|
Notes
|
||||||
</TITLE>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
Use the <command>COMMIT</command> statement to successfully
|
Use <command>COMMIT</command> to successfully
|
||||||
terminate a transaction.
|
terminate a transaction.
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</REFSECT1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-ABORT-2">
|
<refsect1 id="R1-SQL-ABORT-2">
|
||||||
<TITLE>
|
<title>
|
||||||
Usage
|
Usage
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<ProgramListing>
|
To abort all changes:
|
||||||
--To abort all changes
|
<programlisting>
|
||||||
--
|
|
||||||
ABORT WORK;
|
ABORT WORK;
|
||||||
</ProgramListing>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
</REFSECT1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-ABORT-3">
|
<refsect1 id="R1-SQL-ABORT-3">
|
||||||
<TITLE>
|
<title>
|
||||||
Compatibility
|
Compatibility
|
||||||
</TITLE>
|
</title>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-ABORT-4">
|
<refsect2 id="R2-SQL-ABORT-4">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-27</DATE>
|
<date>1998-09-27</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
SQL92
|
SQL92
|
||||||
</TITLE>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
This command is a <productname>Postgres</productname> extension present
|
This command is a <productname>Postgres</productname> extension present
|
||||||
for historical reasons. <command>ROLLBACK</command> is the <acronym>SQL92</acronym>
|
for historical reasons. <command>ROLLBACK</command> is the <acronym>SQL92</acronym>
|
||||||
equivalent command.
|
equivalent command.
|
||||||
</PARA>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
</REFENTRY>
|
</refentry>
|
||||||
|
|
||||||
|
<!-- Keep this comment at the end of the file
|
||||||
|
Local variables:
|
||||||
|
mode: sgml
|
||||||
|
sgml-omittag:nil
|
||||||
|
sgml-shorttag:t
|
||||||
|
sgml-minimize-attributes:nil
|
||||||
|
sgml-always-quote-attributes:t
|
||||||
|
sgml-indent-step:1
|
||||||
|
sgml-indent-data:t
|
||||||
|
sgml-parent-document:nil
|
||||||
|
sgml-default-dtd-file:"../reference.ced"
|
||||||
|
sgml-exposed-tags:nil
|
||||||
|
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
||||||
|
sgml-local-ecat-files:nil
|
||||||
|
End:
|
||||||
|
-->
|
||||||
|
|
|
@ -1,153 +1,145 @@
|
||||||
<REFENTRY ID="SQL-ALTERTABLE">
|
<refentry id="SQL-ALTERTABLE">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
ALTER TABLE
|
ALTER TABLE
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
ALTER TABLE
|
ALTER TABLE
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Modifies table properties
|
Modifies table properties
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
ALTER TABLE <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>
|
ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
|
||||||
[ * ] ADD [ COLUMN ] <REPLACEABLE CLASS="PARAMETER">column</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">type</REPLACEABLE>
|
[ * ] ADD [ COLUMN ] <replaceable class="PARAMETER">ER">co</replaceable>BLE> <replaceable
|
||||||
ALTER TABLE <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>
|
class="PARAMETER">type</replaceable>
|
||||||
[ * ] RENAME [ COLUMN ] <REPLACEABLE CLASS="PARAMETER">column</REPLACEABLE> TO <REPLACEABLE CLASS="PARAMETER">newcolumn</REPLACEABLE>
|
ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
|
||||||
ALTER TABLE <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>
|
[ * ] RENAME [ COLUMN ] <replaceable class="PARAMETER">ER">co</replaceable>BLE> TO <replaceable
|
||||||
RENAME TO <REPLACEABLE CLASS="PARAMETER">newtable</REPLACEABLE>
|
class="PARAMETER">newcolumn</replaceable>
|
||||||
</SYNOPSIS>
|
ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
|
||||||
|
RENAME TO <replaceable class="PARAMETER">newtable</replaceable>
|
||||||
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-ALTERTABLE-1">
|
<refsect2 id="R2-SQL-ALTERTABLE-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<VARIABLELIST>
|
<variablelist>
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term><replaceable class="PARAMETER"> table </replaceable></term>
|
||||||
<REPLACEABLE CLASS="PARAMETER"> table </REPLACEABLE>
|
<listitem>
|
||||||
</TERM>
|
<para>
|
||||||
<LISTITEM>
|
The name of an existing table to alter.
|
||||||
<PARA>
|
</para>
|
||||||
The name of an existing table to alter.
|
</listitem>
|
||||||
</PARA>
|
</varlistentry>
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term><replaceable class="PARAMETER"> column </replaceable></term>
|
||||||
<REPLACEABLE CLASS="PARAMETER"> column </REPLACEABLE>
|
<listitem>
|
||||||
</TERM>
|
<para>
|
||||||
<LISTITEM>
|
Name of a new or existing column.
|
||||||
<PARA>
|
</para>
|
||||||
Name of a new or existing column.
|
</listitem>
|
||||||
</PARA>
|
</varlistentry>
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term><replaceable class="PARAMETER"> type </replaceable></term>
|
||||||
<REPLACEABLE CLASS="PARAMETER"> type </REPLACEABLE>
|
<listitem>
|
||||||
</TERM>
|
<para>
|
||||||
<LISTITEM>
|
Type of the new column.
|
||||||
<PARA>
|
</para>
|
||||||
Type of the new column.
|
</listitem>
|
||||||
</PARA>
|
</varlistentry>
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term><replaceable class="PARAMETER"> newcolumn </replaceable></term>
|
||||||
<REPLACEABLE CLASS="PARAMETER"> newcolumn </REPLACEABLE>
|
<listitem>
|
||||||
</TERM>
|
<para>
|
||||||
<LISTITEM>
|
New name for an existing column.
|
||||||
<PARA>
|
</para>
|
||||||
New name for an existing column.
|
</listitem>
|
||||||
</PARA>
|
</varlistentry>
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term><replaceable class="PARAMETER"> newtable </replaceable></term>
|
||||||
<REPLACEABLE CLASS="PARAMETER"> newtable </REPLACEABLE>
|
<listitem>
|
||||||
</TERM>
|
<para>
|
||||||
<LISTITEM>
|
New name for an existing column.
|
||||||
<PARA>
|
</para>
|
||||||
New name for an existing column.
|
</listitem>
|
||||||
</PARA>
|
</varlistentry>
|
||||||
</LISTITEM>
|
</variablelist>
|
||||||
</VARLISTENTRY>
|
</para>
|
||||||
</VARIABLELIST>
|
</refsect2>
|
||||||
</para>
|
|
||||||
</REFSECT2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-ALTERTABLE-2">
|
<refsect2 id="R2-SQL-ALTERTABLE-2">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Outputs
|
Outputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
|
|
||||||
<VARIABLELIST>
|
<variablelist>
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term><computeroutput>
|
||||||
<returnvalue>ALTER</returnvalue>
|
ALTER
|
||||||
</TERM>
|
</computeroutput></term>
|
||||||
<LISTITEM>
|
<listitem>
|
||||||
<PARA>
|
<para>
|
||||||
Message returned from column or table renaming.
|
Message returned from column or table renaming.
|
||||||
</PARA>
|
</para>
|
||||||
</LISTITEM>
|
</listitem>
|
||||||
</VARLISTENTRY>
|
</varlistentry>
|
||||||
|
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term><computeroutput>
|
||||||
<returnvalue>NEW</returnvalue>
|
NEW
|
||||||
</TERM>
|
</computeroutput></term>
|
||||||
<LISTITEM>
|
<listitem>
|
||||||
<PARA>
|
<para>
|
||||||
Message returned from column addition.
|
Message returned from column addition.
|
||||||
</PARA>
|
</para>
|
||||||
</LISTITEM>
|
</listitem>
|
||||||
</VARLISTENTRY>
|
</varlistentry>
|
||||||
|
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term><computeroutput>
|
||||||
<ReturnValue>ERROR</ReturnValue>
|
ERROR
|
||||||
</TERM>
|
</computeroutput></term>
|
||||||
<LISTITEM>
|
<listitem>
|
||||||
<PARA>
|
<para>
|
||||||
Message returned if table or column is not available.
|
Message returned if table or column is not available.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</VARLISTENTRY>
|
</varlistentry>
|
||||||
</VARIABLELIST>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</REFSYNOPSISDIV>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-ALTERTABLE-1">
|
<refsect1 id="R1-SQL-ALTERTABLE-1">
|
||||||
<REFSECT1INFO>
|
<refsect1info>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSECT1INFO>
|
</refsect1info>
|
||||||
<TITLE>
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<command>ALTER TABLE</command> changes the definition of an existing table.
|
<command>ALTER TABLE</command> changes the definition of an existing table.
|
||||||
The new columns and their types are specified in the same style
|
The new columns and their types are specified in the same style
|
||||||
and with the the same restrictions as in <command>CREATE TABLE</command>.
|
and with the the same restrictions as in <command>CREATE TABLE</command>.
|
||||||
|
@ -156,114 +148,117 @@ Description
|
||||||
the affected table. Thus, the table or column will
|
the affected table. Thus, the table or column will
|
||||||
remain of the same type and size after this command is
|
remain of the same type and size after this command is
|
||||||
executed.
|
executed.
|
||||||
</para>
|
</para>
|
||||||
<PARA>
|
|
||||||
|
<para>
|
||||||
You must own the table in order to change its schema.
|
You must own the table in order to change its schema.
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-ALTERTABLE-3">
|
<refsect2 id="R2-SQL-ALTERTABLE-3">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Notes
|
Notes
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
The keyword COLUMN is noise and can be omitted.
|
The keyword <literal>COLUMN</literal> is noise and can be omitted.
|
||||||
</para>
|
</para>
|
||||||
<PARA>
|
|
||||||
<Quote>[*]</Quote> following a name of a table indicates that statement
|
<para>
|
||||||
should be run over that table and all tables below it in the
|
<quote>[*]</quote> following a name of a table indicates that statement
|
||||||
inheritance hierarchy.
|
should be run over that table and all tables below it in the
|
||||||
|
inheritance hierarchy.
|
||||||
The <citetitle>PostgreSQL User's Guide</citetitle> has further
|
The <citetitle>PostgreSQL User's Guide</citetitle> has further
|
||||||
information on inheritance.
|
information on inheritance.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<PARA>
|
<para>
|
||||||
Refer to CREATE TABLE for a further description
|
Refer to <command>CREATE TABLE</command> for a further description
|
||||||
of valid arguments.
|
of valid arguments.
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</REFSECT1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-ALTERTABLE-2">
|
<refsect1 id="R1-SQL-ALTERTABLE-2">
|
||||||
<TITLE>
|
<title>
|
||||||
Usage
|
Usage
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
To add a column of type VARCHAR to a table:
|
To add a column of type VARCHAR to a table:
|
||||||
<ProgramListing>
|
<programlisting>
|
||||||
ALTER TABLE distributors ADD COLUMN address VARCHAR(30);
|
ALTER TABLE distributors ADD COLUMN address VARCHAR(30);
|
||||||
</ProgramListing>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<PARA>
|
<para>
|
||||||
To rename an existing column:
|
To rename an existing column:
|
||||||
<ProgramListing>
|
<programlisting>
|
||||||
ALTER TABLE distributors RENAME COLUMN address TO city;
|
ALTER TABLE distributors RENAME COLUMN address TO city;
|
||||||
</ProgramListing>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<PARA>
|
<para>
|
||||||
To rename an existing table:
|
To rename an existing table:
|
||||||
<ProgramListing>
|
<programlisting>
|
||||||
ALTER TABLE distributors RENAME TO suppliers;
|
ALTER TABLE distributors RENAME TO suppliers;
|
||||||
</ProgramListing>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
</REFSECT1>
|
<refsect1 id="R1-SQL-ALTERTABLE-3">
|
||||||
|
<title>
|
||||||
|
Compatibility
|
||||||
|
</title>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-ALTERTABLE-3">
|
<refsect2 id="R2-SQL-ALTERTABLE-4">
|
||||||
<TITLE>
|
<refsect2info>
|
||||||
Compatibility
|
<date>1998-04-15</date>
|
||||||
</TITLE>
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
SQL92
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
<command>ALTER TABLE/RENAME</command>
|
||||||
|
is a <productname>Postgres</productname> language extension.
|
||||||
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-ALTERTABLE-4">
|
<para>
|
||||||
<REFSECT2INFO>
|
SQL92 specifies some additional capabilities for <command>ALTER TABLE</command>
|
||||||
<DATE>1998-04-15</DATE>
|
statement which are not yet directly supported by
|
||||||
</REFSECT2INFO>
|
<productname>Postgres</productname>:
|
||||||
<TITLE>
|
</para>
|
||||||
SQL92
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
<command>ALTER TABLE/RENAME</command>
|
|
||||||
is a <productname>Postgres</productname> language extension.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<PARA>
|
<variablelist>
|
||||||
SQL92 specifies some additional capabilities for <command>ALTER TABLE</command>
|
<varlistentry>
|
||||||
statement which are not yet directly supported by
|
<term>
|
||||||
<ProductName>Postgres</ProductName>:
|
<synopsis>
|
||||||
</para>
|
ALTER TABLE <replaceable class="PARAMETER">table</replaceable> ALTER [
|
||||||
|
COLUMN ] <replaceable class="PARAMETER">column</replaceable>
|
||||||
|
SET DEFAULT <replaceable class="PARAMETER">default</replaceable>
|
||||||
|
ALTER TABLE <replaceable class="PARAMETER">table</replaceable> ALTER [
|
||||||
|
COLUMN ] <replaceable class="PARAMETER">column</replaceable>
|
||||||
|
ADD [ CONSTRAINT <replaceable class="PARAMETER">>constrain</replaceable>> ] <replaceable
|
||||||
|
class="PARAMETER">table-constraint</replaceable>
|
||||||
|
</synopsis>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Puts the default value or constraint specified into the
|
||||||
|
definition of column in the table.
|
||||||
|
See <command>CREATE TABLE</command> for the
|
||||||
|
syntax of the default and table-constraint clauses.
|
||||||
|
If a default clause already exists, it will be replaced by
|
||||||
|
the new definition. If any constraints on this column already
|
||||||
|
exist, they will be retained using a boolean AND with the new
|
||||||
|
constraint.
|
||||||
|
</para>
|
||||||
|
|
||||||
<VARIABLELIST>
|
<para>
|
||||||
<VARLISTENTRY>
|
Currently, to set new default constraints on an existing column
|
||||||
<TERM>
|
the table must be recreated and reloaded:
|
||||||
<Synopsis>
|
|
||||||
ALTER TABLE <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> ALTER [ COLUMN ] <REPLACEABLE CLASS="PARAMETER">column</REPLACEABLE>
|
|
||||||
SET DEFAULT <REPLACEABLE CLASS="PARAMETER">default</REPLACEABLE>
|
|
||||||
|
|
||||||
ALTER TABLE <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> ALTER [ COLUMN ] <REPLACEABLE CLASS="PARAMETER">column</REPLACEABLE>
|
<programlisting>
|
||||||
ADD [ CONSTRAINT <REPLACEABLE CLASS="PARAMETER">constraint</REPLACEABLE> ] <REPLACEABLE CLASS="PARAMETER">table-constraint</REPLACEABLE>
|
|
||||||
</Synopsis>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Puts the default value or constraint specified into the
|
|
||||||
definition of column in the table.
|
|
||||||
See <command>CREATE TABLE</command> for the
|
|
||||||
syntax of the default and table-constraint clauses.
|
|
||||||
If a default clause already exists, it will be replaced by
|
|
||||||
the new definition. If any constraints on this column already
|
|
||||||
exist, they will be retained using a boolean AND with the new
|
|
||||||
constraint.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<PARA>
|
|
||||||
Currently, to set new default constraints on an existing column
|
|
||||||
the table must be recreated and reloaded:
|
|
||||||
|
|
||||||
<ProgramListing>
|
|
||||||
CREATE TABLE temp AS SELECT * FROM distributors;
|
CREATE TABLE temp AS SELECT * FROM distributors;
|
||||||
DROP TABLE distributors;
|
DROP TABLE distributors;
|
||||||
CREATE TABLE distributors (
|
CREATE TABLE distributors (
|
||||||
|
@ -273,65 +268,65 @@ CREATE TABLE distributors (
|
||||||
);
|
);
|
||||||
INSERT INTO distributors SELECT * FROM temp;
|
INSERT INTO distributors SELECT * FROM temp;
|
||||||
DROP TABLE temp;
|
DROP TABLE temp;
|
||||||
</ProgramListing>
|
</programlisting>
|
||||||
</PARA>
|
</para>
|
||||||
</LISTITEM>
|
</listitem>
|
||||||
</VARLISTENTRY>
|
</varlistentry>
|
||||||
|
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term>
|
||||||
<Synopsis>
|
<synopsis>
|
||||||
ALTER TABLE <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>
|
ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
|
||||||
DROP DEFAULT <REPLACEABLE CLASS="PARAMETER">default</REPLACEABLE>
|
DROP DEFAULT <replaceable class="PARAMETER">default</replaceable>
|
||||||
ALTER TABLE <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>
|
ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
|
||||||
DROP CONSTRAINT <REPLACEABLE CLASS="PARAMETER">constraint</REPLACEABLE> { RESTRICT | CASCADE }
|
DROP CONSTRAINT <replaceable class="PARAMETER">constraint</replaceable> { RESTRICT | CASCADE }
|
||||||
</Synopsis>
|
</synopsis>
|
||||||
</TERM>
|
</term>
|
||||||
<LISTITEM>
|
<listitem>
|
||||||
<PARA>
|
<para>
|
||||||
Removes the default value specified by default or the rule
|
Removes the default value specified by default or the rule
|
||||||
specified by constraint from the definition of a table.
|
specified by constraint from the definition of a table.
|
||||||
If RESTRICT is specified only a constraint with no dependent
|
If RESTRICT is specified only a constraint with no dependent
|
||||||
constraints can be destroyed.
|
constraints can be destroyed.
|
||||||
If CASCADE is specified, Any constraints that are dependent on
|
If CASCADE is specified, Any constraints that are dependent on
|
||||||
this constraint are also dropped.
|
this constraint are also dropped.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<PARA>
|
<para>
|
||||||
Currently, to remove a default value or constraints on an
|
Currently, to remove a default value or constraints on an
|
||||||
existing column the table must be recreated and reloaded:
|
existing column the table must be recreated and reloaded:
|
||||||
|
|
||||||
<ProgramListing>
|
<programlisting>
|
||||||
CREATE TABLE temp AS SELECT * FROM distributors;
|
CREATE TABLE temp AS SELECT * FROM distributors;
|
||||||
DROP TABLE distributors;
|
DROP TABLE distributors;
|
||||||
CREATE TABLE distributors AS SELECT * FROM temp;
|
CREATE TABLE distributors AS SELECT * FROM temp;
|
||||||
DROP TABLE temp;
|
DROP TABLE temp;
|
||||||
</ProgramListing>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<Synopsis>
|
|
||||||
ALTER TABLE <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>
|
|
||||||
DROP [ COLUMN ] <REPLACEABLE CLASS="PARAMETER">column</REPLACEABLE> { RESTRICT | CASCADE }
|
|
||||||
</Synopsis>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Removes a column from a table.
|
|
||||||
If RESTRICT is specified only a column with no dependent
|
|
||||||
objects can be destroyed.
|
|
||||||
If CASCADE is specified, all objects that are dependent on
|
|
||||||
this column are also dropped.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<PARA>
|
<varlistentry>
|
||||||
Currently, to remove an existing column the table must be
|
<term>
|
||||||
recreated and reloaded:
|
<synopsis>
|
||||||
|
ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
|
||||||
|
DROP [ COLUMN ] <replaceable class="PARAMETER">column</replaceable> { RESTRICT | CASCADE }
|
||||||
|
</synopsis>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Removes a column from a table.
|
||||||
|
If RESTRICT is specified only a column with no dependent
|
||||||
|
objects can be destroyed.
|
||||||
|
If CASCADE is specified, all objects that are dependent on
|
||||||
|
this column are also dropped.
|
||||||
|
</para>
|
||||||
|
|
||||||
<ProgramListing>
|
<para>
|
||||||
|
Currently, to remove an existing column the table must be
|
||||||
|
recreated and reloaded:
|
||||||
|
|
||||||
|
<programlisting>
|
||||||
CREATE TABLE temp AS SELECT did, city FROM distributors;
|
CREATE TABLE temp AS SELECT did, city FROM distributors;
|
||||||
DROP TABLE distributors;
|
DROP TABLE distributors;
|
||||||
CREATE TABLE distributors (
|
CREATE TABLE distributors (
|
||||||
|
@ -340,11 +335,28 @@ CREATE TABLE distributors (
|
||||||
);
|
);
|
||||||
INSERT INTO distributors SELECT * FROM temp;
|
INSERT INTO distributors SELECT * FROM temp;
|
||||||
DROP TABLE temp;
|
DROP TABLE temp;
|
||||||
</ProgramListing>
|
</programlisting>
|
||||||
</PARA>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</VARIABLELIST>
|
</variablelist>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
</refentry>
|
||||||
|
|
||||||
|
<!-- Keep this comment at the end of the file
|
||||||
|
Local variables:
|
||||||
|
mode: sgml
|
||||||
|
sgml-omittag:nil
|
||||||
|
sgml-shorttag:t
|
||||||
|
sgml-minimize-attributes:nil
|
||||||
|
sgml-always-quote-attributes:t
|
||||||
|
sgml-indent-step:1
|
||||||
|
sgml-indent-data:t
|
||||||
|
sgml-parent-document:nil
|
||||||
|
sgml-default-dtd-file:"../reference.ced"
|
||||||
|
sgml-exposed-tags:nil
|
||||||
|
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
||||||
|
sgml-local-ecat-files:nil
|
||||||
|
End:
|
||||||
|
-->
|
||||||
|
|
|
@ -1,103 +1,97 @@
|
||||||
<refentry id="SQL-ALTERUSER">
|
<refentry id="SQL-ALTERUSER">
|
||||||
<refmeta>
|
<refmeta>
|
||||||
<refentrytitle>
|
<refentrytitle>
|
||||||
ALTER USER
|
ALTER USER
|
||||||
</refentrytitle>
|
</refentrytitle>
|
||||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</refmeta>
|
</refmeta>
|
||||||
<refnamediv>
|
<refnamediv>
|
||||||
<refname>
|
<refname>
|
||||||
ALTER USER
|
ALTER USER
|
||||||
</refname>
|
</refname>
|
||||||
<refpurpose>
|
<refpurpose>
|
||||||
Modifies user account information
|
Modifies user account information
|
||||||
</refpurpose>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<refsynopsisdivinfo>
|
<refsynopsisdivinfo>
|
||||||
<date>1998-09-08</date>
|
<date>1998-09-08</date>
|
||||||
</refsynopsisdivinfo>
|
</refsynopsisdivinfo>
|
||||||
<synopsis>
|
<synopsis>
|
||||||
ALTER USER <replaceable class="PARAMETER">username</replaceable>
|
ALTER USER <replaceable class="PARAMETER">username</replaceable> [ WITH PASSWORD <replaceable class="PARAMETER">password</replaceable> ]
|
||||||
[ WITH PASSWORD <replaceable class="PARAMETER">password</replaceable> ]
|
[ CREATEDB | NOCREATEDB ] [ CREATEUSER | NOCREATEUSER ]
|
||||||
[ CREATEDB | NOCREATEDB ]
|
|
||||||
[ CREATEUSER | NOCREATEUSER ]
|
|
||||||
[ IN GROUP <replaceable class="PARAMETER">groupname</replaceable> [, ...] ]
|
[ IN GROUP <replaceable class="PARAMETER">groupname</replaceable> [, ...] ]
|
||||||
[ VALID UNTIL '<replaceable class="PARAMETER">abstime</replaceable>' ]
|
[ VALID UNTIL '<replaceable class="PARAMETER">abstime</replaceable>' ]
|
||||||
</synopsis>
|
</synopsis>
|
||||||
|
|
||||||
<refsect2 id="R2-SQL-ALTERUSER-1">
|
|
||||||
<refsect2info>
|
|
||||||
<date>1998-09-08</date>
|
|
||||||
</refsect2info>
|
|
||||||
<title>
|
|
||||||
Inputs
|
|
||||||
</title>
|
|
||||||
<para>
|
|
||||||
Refer to <command>CREATE USER</command> for a detailed description of each
|
|
||||||
clause.
|
|
||||||
</para>
|
|
||||||
<variablelist>
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
<replaceable class="PARAMETER"> username </replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
The Postgres account name of the user whose details are to be altered.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<refsect2 id="R2-SQL-ALTERUSER-1">
|
||||||
<term>
|
<refsect2info>
|
||||||
<replaceable class="PARAMETER"> password </replaceable>
|
<date>1998-09-08</date>
|
||||||
</term>
|
</refsect2info>
|
||||||
<listitem>
|
<title>
|
||||||
<para>
|
Inputs
|
||||||
The new password to be used for this account.
|
</title>
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<para>
|
||||||
<term>
|
Refer to <command>CREATE USER</command> for a detailed description of each
|
||||||
<replaceable class="PARAMETER"> groupname </replaceable>
|
clause.
|
||||||
</term>
|
</para>
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
The name of an access group into which this account is to be put.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
<replaceable class="PARAMETER"> abstime </replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
The date (and, optionally, the time)
|
|
||||||
at which this user's access is to be terminated.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
</variablelist>
|
|
||||||
</refsect2>
|
|
||||||
|
|
||||||
<refsect2 id="R2-SQL-ALTERUSER-2">
|
|
||||||
<refsect2info>
|
|
||||||
<date>1998-09-08</date>
|
|
||||||
</refsect2info>
|
|
||||||
<title>
|
|
||||||
Outputs
|
|
||||||
</title>
|
|
||||||
<para>
|
<para>
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><replaceable class="PARAMETER"> username </replaceable></term>
|
||||||
<returnvalue>ALTER USER</returnvalue>
|
<listitem>
|
||||||
</term>
|
<para>
|
||||||
|
The Postgres account name of the user whose details are to be altered.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="PARAMETER"> password </replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The new password to be used for this account.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="PARAMETER"> groupname </replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The name of an access group into which this account is to be put.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="PARAMETER"> abstime </replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The date (and, optionally, the time)
|
||||||
|
at which this user's access is to be terminated.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
|
||||||
|
<refsect2 id="R2-SQL-ALTERUSER-2">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-09-08</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
Outputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
ALTER USER
|
||||||
|
</computeroutput></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Message returned if the alteration was successful.
|
Message returned if the alteration was successful.
|
||||||
|
@ -106,13 +100,13 @@ ALTER USER <replaceable class="PARAMETER">username</replaceable>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><computeroutput>
|
||||||
<returnvalue>ERROR: alterUser: user "username" does not exist</returnvalue>
|
ERROR: alterUser: user "username" does not exist
|
||||||
</term>
|
</computeroutput></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Error message returned if the user specified doesn't
|
Error message returned if the specified user is not known to
|
||||||
exist.
|
the database.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -120,116 +114,116 @@ ALTER USER <replaceable class="PARAMETER">username</replaceable>
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
<refsect1 id="R1-SQL-ALTERUSER-1">
|
<refsect1 id="R1-SQL-ALTERUSER-1">
|
||||||
<refsect1info>
|
<refsect1info>
|
||||||
<date>1998-09-08</date>
|
<date>1998-09-08</date>
|
||||||
</refsect1info>
|
</refsect1info>
|
||||||
<title>
|
<title>
|
||||||
Description
|
Description
|
||||||
</title>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
<command>ALTER USER</command> is used to change the attributes of a user's
|
<command>ALTER USER</command> is used to change the attributes of a user's
|
||||||
<productname>Postgres</productname> account.
|
<productname>Postgres</productname> account.
|
||||||
Please note that it is not possible
|
Please note that it is not possible
|
||||||
to alter a user's "usesysid" via the alter user
|
to alter a user's "usesysid" via the alter user
|
||||||
statement. Also, it is only possible for the
|
statement. Also, it is only possible for the
|
||||||
<productname>Postgres</productname>
|
<productname>Postgres</productname>
|
||||||
user or any user with read and modify permissions on
|
user or any user with read and modify permissions on
|
||||||
"pg_shadow" to alter user passwords.
|
<literal>pg_shadow</literal> to alter user passwords.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
|
||||||
If any of the clauses of the alter user statement are
|
<para>
|
||||||
omitted, the corresponding value in the "pg_shadow" table
|
If any of the clauses of the alter user statement are
|
||||||
is left unchanged.
|
omitted, the corresponding value in the "pg_shadow" table
|
||||||
</para>
|
is left unchanged.
|
||||||
|
</para>
|
||||||
|
|
||||||
<refsect2 id="R2-SQL-ALTERUSER-3">
|
<refsect2 id="R2-SQL-ALTERUSER-3">
|
||||||
<refsect2info>
|
<refsect2info>
|
||||||
<date>1998-09-08</date>
|
<date>1998-09-08</date>
|
||||||
</refsect2info>
|
</refsect2info>
|
||||||
<title>
|
<title>
|
||||||
Notes
|
Notes
|
||||||
</title>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
<command>ALTER USER</command> statement
|
<command>ALTER USER</command>
|
||||||
is a <productname>Postgres</productname>
|
is a <productname>Postgres</productname>
|
||||||
language extension.
|
language extension.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
Refer to <command>CREATE/DROP USER</command>
|
Refer to <command>CREATE/DROP USER</command>
|
||||||
to create or remove a user
|
to create or remove a user account.
|
||||||
account.
|
</para>
|
||||||
</para>
|
<para>
|
||||||
<para>
|
In the current release (v6.5), the IN GROUP clause is parsed
|
||||||
In the current release (v6.5), the IN GROUP clause is parsed
|
but has no affect. When it is fully implemented, it is
|
||||||
but has no affect. When it is fully implemented, it is
|
intended to modify the pg_group relation.
|
||||||
intended to modify the pg_group relation.
|
</para>
|
||||||
</para>
|
</refsect2>
|
||||||
</refsect2>
|
</refsect1>
|
||||||
</refsect1>
|
|
||||||
|
<refsect1 id="R1-SQL-ALTERUSER-2">
|
||||||
<refsect1 id="R1-SQL-ALTERUSER-2">
|
<title>
|
||||||
<title>
|
Usage
|
||||||
Usage
|
</title>
|
||||||
</title>
|
<para>
|
||||||
<para>
|
Change a user password:
|
||||||
Change a user password
|
|
||||||
</para>
|
<programlisting>
|
||||||
<programlisting>
|
|
||||||
ALTER USER davide WITH PASSWORD hu8jmn3;
|
ALTER USER davide WITH PASSWORD hu8jmn3;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
<para>
|
|
||||||
Change a user's valid until date
|
Change a user's valid until date
|
||||||
</para>
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
ALTER USER manuel VALID UNTIL 'Jan 31 2030';
|
ALTER USER manuel VALID UNTIL 'Jan 31 2030';
|
||||||
</programlisting>
|
</programlisting>
|
||||||
<para>
|
|
||||||
Change a user's valid until date, specifying that his
|
Change a user's valid until date, specifying that his
|
||||||
authorisation should expire at midday on 4th May 1998 using
|
authorisation should expire at midday on 4th May 1998 using
|
||||||
the time zone which is one hour ahead of UTC
|
the time zone which is one hour ahead of UTC
|
||||||
</para>
|
<programlisting>
|
||||||
<programlisting>
|
|
||||||
ALTER USER chris VALID UNTIL 'May 4 12:00:00 1998 +1';
|
ALTER USER chris VALID UNTIL 'May 4 12:00:00 1998 +1';
|
||||||
</programlisting>
|
</programlisting>
|
||||||
<para>
|
|
||||||
Give a user the ability to create other users and new databases.
|
Give a user the ability to create other users and new databases.
|
||||||
</para>
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
ALTER USER miriam CREATEUSER CREATEDB;
|
ALTER USER miriam CREATEUSER CREATEDB;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
<para>
|
|
||||||
Place a user in two groups
|
Place a user in two groups
|
||||||
</para>
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
ALTER USER miriam IN GROUP sales, payroll;
|
ALTER USER miriam IN GROUP sales, payroll;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</refsect1>
|
</para>
|
||||||
|
</refsect1>
|
||||||
<refsect1 id="R1-SQL-ALTERUSER-3">
|
|
||||||
<title>
|
<refsect1 id="R1-SQL-ALTERUSER-3">
|
||||||
Compatibility
|
<title>
|
||||||
</title>
|
Compatibility
|
||||||
<para>
|
</title>
|
||||||
</para>
|
<para>
|
||||||
|
</para>
|
||||||
|
|
||||||
<refsect2 id="R2-SQL-ALTERUSER-4">
|
<refsect2 id="R2-SQL-ALTERUSER-4">
|
||||||
<refsect2info>
|
<refsect2info>
|
||||||
<date>1998-09-08</date>
|
<date>1998-09-08</date>
|
||||||
</refsect2info>
|
</refsect2info>
|
||||||
<title>
|
<title>
|
||||||
SQL92
|
SQL92
|
||||||
</title>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
There is no <command>ALTER USER</command> statement in
|
There is no <command>ALTER USER</command> statement in
|
||||||
<acronym>SQL92</acronym>.
|
<acronym>SQL92</acronym>.
|
||||||
The standard leaves
|
The standard leaves
|
||||||
the definition of users to the implementation.
|
the definition of users to the implementation.
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
|
|
|
@ -30,7 +30,7 @@ BEGIN [ WORK | TRANSACTION ]
|
||||||
Inputs
|
Inputs
|
||||||
</title>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
None
|
None.
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
|
|
||||||
|
@ -45,9 +45,9 @@ BEGIN [ WORK | TRANSACTION ]
|
||||||
<para>
|
<para>
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><computeroutput>
|
||||||
<returnvalue>BEGIN</returnvalue>
|
BEGIN
|
||||||
</term>
|
</computeroutput></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
This signifies that a new transaction has been started.
|
This signifies that a new transaction has been started.
|
||||||
|
@ -55,9 +55,9 @@ BEGIN [ WORK | TRANSACTION ]
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><computeroutput>
|
||||||
<returnvalue>NOTICE: BeginTransactionBlock and not in default state</returnvalue>
|
NOTICE: BeginTransactionBlock and not in default state
|
||||||
</term>
|
</computeroutput></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
This indicates that a transaction was already in progress.
|
This indicates that a transaction was already in progress.
|
||||||
|
|
|
@ -1,153 +1,152 @@
|
||||||
<REFENTRY ID="SQL-CLOSE">
|
<refentry id="SQL-CLOSE">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
CLOSE
|
CLOSE
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
CLOSE
|
CLOSE
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Close a cursor
|
Close a cursor
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-09-08</DATE>
|
<date>1998-09-08</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
CLOSE <REPLACEABLE CLASS="PARAMETER">cursor</REPLACEABLE>
|
CLOSE <replaceable class="PARAMETER">cursor</replaceable>
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CLOSE-1">
|
<refsect2 id="R2-SQL-CLOSE-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-08</DATE>
|
<date>1998-09-08</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
<variablelist>
|
||||||
<TERM>
|
<varlistentry>
|
||||||
<REPLACEABLE CLASS="PARAMETER">cursor</REPLACEABLE>
|
<term><replaceable class="PARAMETER">cursor</replaceable></term>
|
||||||
</TERM>
|
<listitem>
|
||||||
<LISTITEM>
|
<para>
|
||||||
<PARA>
|
The name of an open cursor to close.
|
||||||
The name of an open cursor to close.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
</variablelist>
|
|
||||||
</para>
|
|
||||||
</REFSECT2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CLOSE-2">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-09-08</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Outputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>CLOSE</ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Message returned if the cursor is successfully closed.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>NOTICE PerformPortalClose: portal "<REPLACEABLE CLASS="PARAMETER">cursor</REPLACEABLE>" not found</ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
This warning is given if
|
|
||||||
<REPLACEABLE CLASS="PARAMETER">cursor</REPLACEABLE> is not
|
|
||||||
declared or has already been closed.
|
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</VARIABLELIST>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</REFSYNOPSISDIV>
|
|
||||||
|
<refsect2 id="R2-SQL-CLOSE-2">
|
||||||
<REFSECT1 ID="R1-SQL-CLOSE-1">
|
<refsect2info>
|
||||||
<REFSECT1INFO>
|
<date>1998-09-08</date>
|
||||||
<DATE>1998-09-08</DATE>
|
</refsect2info>
|
||||||
</REFSECT1INFO>
|
<title>
|
||||||
<TITLE>
|
Outputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
CLOSE
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Message returned if the cursor is successfully closed.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
NOTICE PerformPortalClose: portal "<replaceable class="PARAMETER">cursor</replaceable>" not found
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
This warning is given if
|
||||||
|
<replaceable class="PARAMETER">cursor</replaceable> is not
|
||||||
|
declared or has already been closed.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-CLOSE-1">
|
||||||
|
<refsect1info>
|
||||||
|
<date>1998-09-08</date>
|
||||||
|
</refsect1info>
|
||||||
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<command>CLOSE</command> frees the resources associated with an open cursor.
|
<command>CLOSE</command> frees the resources associated with an open cursor.
|
||||||
After the cursor is closed, no subsequent operations
|
After the cursor is closed, no subsequent operations
|
||||||
are allowed on it. A cursor should be closed when it is
|
are allowed on it. A cursor should be closed when it is
|
||||||
no longer needed.
|
no longer needed.
|
||||||
</PARA>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
An implicit close is executed for every open cursor when a
|
An implicit close is executed for every open cursor when a
|
||||||
transaction is terminated by <command>COMMIT</command>
|
transaction is terminated by <command>COMMIT</command>
|
||||||
or <command>ROLLBACK</command>.
|
or <command>ROLLBACK</command>.
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CLOSE-3">
|
<refsect2 id="R2-SQL-CLOSE-3">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-08</DATE>
|
<date>1998-09-08</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Notes
|
Notes
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<productname>Postgres</productname> does not have
|
<productname>Postgres</productname> does not have
|
||||||
an explicit <command>OPEN</command> cursor statement;
|
an explicit <command>OPEN</command> cursor statement;
|
||||||
a cursor is considered open when it is declared.
|
a cursor is considered open when it is declared.
|
||||||
Use the <command>DECLARE</command> statement to declare a cursor.
|
Use the <command>DECLARE</command> statement to declare a cursor.
|
||||||
</PARA>
|
</para>
|
||||||
</REFSECT2>
|
|
||||||
</refsect1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-CLOSE-2">
|
|
||||||
<TITLE>
|
|
||||||
Usage
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
Close the cursor liahona:
|
|
||||||
</PARA>
|
|
||||||
<ProgramListing>
|
|
||||||
CLOSE liahona;
|
|
||||||
</ProgramListing>
|
|
||||||
</REFSECT1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-CLOSE-3">
|
|
||||||
<TITLE>
|
|
||||||
Compatibility
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
</PARA>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CLOSE-4">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-09-08</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
SQL92
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
<command>CLOSE</command> is fully compatible with SQL92.
|
|
||||||
</PARA>
|
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-CLOSE-2">
|
||||||
|
<title>
|
||||||
|
Usage
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
Close the cursor liahona:
|
||||||
|
</para>
|
||||||
|
<programlisting>
|
||||||
|
CLOSE liahona;
|
||||||
|
</programlisting>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-CLOSE-3">
|
||||||
|
<title>
|
||||||
|
Compatibility
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<refsect2 id="R2-SQL-CLOSE-4">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-09-08</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
SQL92
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
<command>CLOSE</command> is fully compatible with SQL92.
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
|
|
|
@ -1,238 +1,231 @@
|
||||||
<REFENTRY ID="SQL-CLUSTER">
|
<refentry id="SQL-CLUSTER">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
CLUSTER
|
CLUSTER
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
CLUSTER
|
CLUSTER
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Gives storage clustering advice to the backend
|
Gives storage clustering advice to the backend
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-09-08</DATE>
|
<date>1998-09-08</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
CLUSTER <REPLACEABLE CLASS="PARAMETER">indexname</REPLACEABLE> ON <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>
|
CLUSTER <replaceable class="PARAMETER">indexname</replaceable> ON <replaceable class="PARAMETER">table</replaceable>
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CLUSTER-1">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-09-08</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Inputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
</PARA>
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<REPLACEABLE CLASS="PARAMETER">indexname</REPLACEABLE>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The name of an index.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The name of a table.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
</VARIABLELIST>
|
|
||||||
</REFSECT2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CLUSTER-2">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-09-08</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Outputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<returnvalue>CLUSTER</returnvalue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The clustering was done successfully.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<returnvalue>ERROR: relation <<REPLACEABLE CLASS="PARAMETER">tablerelation_number</REPLACEABLE>> inherits "invoice"</returnvalue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
|
|
||||||
<comment>
|
<refsect2 id="R2-SQL-CLUSTER-1">
|
||||||
This is not documented anywhere. It seems not to be possible to
|
<refsect2info>
|
||||||
cluster a table that is inherited.
|
<date>1998-09-08</date>
|
||||||
</comment>
|
</refsect2info>
|
||||||
</PARA>
|
<title>
|
||||||
</LISTITEM>
|
Inputs
|
||||||
</VARLISTENTRY>
|
</title>
|
||||||
<VARLISTENTRY>
|
<para>
|
||||||
<TERM>
|
|
||||||
<returnvalue>ERROR: Relation x does not exist!</returnvalue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
|
|
||||||
<comment>
|
|
||||||
The relation complained of was not shown in the error message,
|
|
||||||
which contained a random string instead of the relation name.
|
|
||||||
</comment>
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
|
|
||||||
</VARIABLELIST>
|
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
<variablelist>
|
||||||
</REFSYNOPSISDIV>
|
<varlistentry>
|
||||||
|
<term><replaceable class="PARAMETER">indexname</replaceable></term>
|
||||||
<REFSECT1 ID="R1-SQL-CLUSTER-1">
|
<listitem>
|
||||||
<REFSECT1INFO>
|
<para>
|
||||||
<DATE>1998-09-08</DATE>
|
The name of an index.
|
||||||
</REFSECT1INFO>
|
</para>
|
||||||
<TITLE>
|
</listitem>
|
||||||
Description
|
</varlistentry>
|
||||||
</TITLE>
|
<varlistentry>
|
||||||
<PARA>
|
<term><replaceable class="PARAMETER">table</replaceable></term>
|
||||||
<command>CLUSTER</command> instructs <productname>Postgres</productname>
|
<listitem>
|
||||||
to cluster the class specified
|
<para>
|
||||||
by <replaceable class="parameter">classname</replaceable> approximately
|
The name of a table.
|
||||||
based on the index specified by
|
</para>
|
||||||
<replaceable class="parameter">indexname</replaceable>. The index must
|
</listitem>
|
||||||
already have been defined on
|
</varlistentry>
|
||||||
<replaceable class="parameter">classname</replaceable>.
|
</variablelist>
|
||||||
</PARA>
|
</refsect2>
|
||||||
<para>
|
|
||||||
When a class is clustered, it is physically reordered
|
<refsect2 id="R2-SQL-CLUSTER-2">
|
||||||
based on the index information. The clustering is static.
|
<refsect2info>
|
||||||
In other words, as the class is updated, the changes are
|
<date>1998-09-08</date>
|
||||||
not clustered. No attempt is made to keep new instances or
|
</refsect2info>
|
||||||
updated tuples clustered. If one wishes, one can
|
<title>
|
||||||
recluster manually by issuing the command again.
|
Outputs
|
||||||
</para>
|
</title>
|
||||||
|
<para>
|
||||||
<REFSECT2 ID="R2-SQL-CLUSTER-3">
|
|
||||||
<REFSECT2INFO>
|
<variablelist>
|
||||||
<DATE>1998-09-08</DATE>
|
<varlistentry>
|
||||||
</REFSECT2INFO>
|
<term><computeroutput>
|
||||||
<TITLE>
|
CLUSTER
|
||||||
Notes
|
</computeroutput></term>
|
||||||
</TITLE>
|
<listitem>
|
||||||
|
<para>
|
||||||
<para>
|
The clustering was done successfully.
|
||||||
The table is actually copied to a temporary table in index
|
</para>
|
||||||
order, then renamed back to the original name. For this
|
</listitem>
|
||||||
reason, all grant permissions and other indexes are lost
|
</varlistentry>
|
||||||
when clustering is performed.
|
<varlistentry>
|
||||||
</para>
|
<term><computeroutput>
|
||||||
|
ERROR: relation <<replaceable class="PARAMETER">tablerelation_number</replaceable>> inherits "invoice"
|
||||||
<para>
|
</computeroutput></term>
|
||||||
In cases where you are accessing single rows randomly
|
<listitem>
|
||||||
within a table, the actual order of the data in the heap
|
<para>
|
||||||
table is unimportant. However, if you tend to access some
|
<comment>
|
||||||
data more than others, and there is an index that groups
|
This is not documented anywhere. It seems not to be possible to
|
||||||
them together, you will benefit from using <command>CLUSTER</command>.
|
cluster a table that is inherited.
|
||||||
</para>
|
</comment>
|
||||||
|
</para>
|
||||||
<para>
|
</listitem>
|
||||||
Another place <command>CLUSTER</command> is helpful is in cases where you use an
|
</varlistentry>
|
||||||
index to pull out several rows from a table. If you are
|
<varlistentry>
|
||||||
requesting a range of indexed values from a table, or a
|
<term><computeroutput>
|
||||||
single indexed value that has multiple rows that match,
|
ERROR: Relation x does not exist!
|
||||||
<command>CLUSTER</command> will help because once the index identifies the
|
</computeroutput></term>
|
||||||
heap page for the first row that matches, all other rows
|
<listitem>
|
||||||
that match are probably already on the same heap page,
|
<para>
|
||||||
saving disk accesses and speeding up the query.
|
<comment>
|
||||||
</para>
|
The relation complained of was not shown in the error message,
|
||||||
|
which contained a random string instead of the relation name.
|
||||||
<para>
|
</comment>
|
||||||
There are two ways to cluster data. The first is with the
|
</para>
|
||||||
<command>CLUSTER</command> command, which reorders the original table with
|
</listitem>
|
||||||
the ordering of the index you specify. This can be slow
|
</varlistentry>
|
||||||
on large tables because the rows are fetched from the heap
|
</variablelist>
|
||||||
in index order, and if the heap table is unordered, the
|
</para>
|
||||||
entries are on random pages, so there is one disk page
|
</refsect2>
|
||||||
retrieved for every row moved. <productname>Postgres</productname> has a cache,
|
</refsynopsisdiv>
|
||||||
but the majority of a big table will not fit in the cache.
|
|
||||||
</para>
|
<refsect1 id="R1-SQL-CLUSTER-1">
|
||||||
|
<refsect1info>
|
||||||
<para>
|
<date>1998-09-08</date>
|
||||||
Another way to cluster data is to use
|
</refsect1info>
|
||||||
<programlisting>
|
<title>
|
||||||
|
Description
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
<command>CLUSTER</command> instructs <productname>Postgres</productname>
|
||||||
|
to cluster the class specified
|
||||||
|
by <replaceable class="parameter">classname</replaceable> approximately
|
||||||
|
based on the index specified by
|
||||||
|
<replaceable class="parameter">indexname</replaceable>. The index must
|
||||||
|
already have been defined on
|
||||||
|
<replaceable class="parameter">classname</replaceable>.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
When a class is clustered, it is physically reordered
|
||||||
|
based on the index information. The clustering is static.
|
||||||
|
In other words, as the class is updated, the changes are
|
||||||
|
not clustered. No attempt is made to keep new instances or
|
||||||
|
updated tuples clustered. If one wishes, one can
|
||||||
|
recluster manually by issuing the command again.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<refsect2 id="R2-SQL-CLUSTER-3">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-09-08</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
Notes
|
||||||
|
</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
The table is actually copied to a temporary table in index
|
||||||
|
order, then renamed back to the original name. For this
|
||||||
|
reason, all grant permissions and other indexes are lost
|
||||||
|
when clustering is performed.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
In cases where you are accessing single rows randomly
|
||||||
|
within a table, the actual order of the data in the heap
|
||||||
|
table is unimportant. However, if you tend to access some
|
||||||
|
data more than others, and there is an index that groups
|
||||||
|
them together, you will benefit from using <command>CLUSTER</command>.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Another place <command>CLUSTER</command> is helpful is in cases where you use an
|
||||||
|
index to pull out several rows from a table. If you are
|
||||||
|
requesting a range of indexed values from a table, or a
|
||||||
|
single indexed value that has multiple rows that match,
|
||||||
|
<command>CLUSTER</command> will help because once the index identifies the
|
||||||
|
heap page for the first row that matches, all other rows
|
||||||
|
that match are probably already on the same heap page,
|
||||||
|
saving disk accesses and speeding up the query.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
There are two ways to cluster data. The first is with the
|
||||||
|
<command>CLUSTER</command> command, which reorders the original table with
|
||||||
|
the ordering of the index you specify. This can be slow
|
||||||
|
on large tables because the rows are fetched from the heap
|
||||||
|
in index order, and if the heap table is unordered, the
|
||||||
|
entries are on random pages, so there is one disk page
|
||||||
|
retrieved for every row moved. <productname>Postgres</productname> has a cache,
|
||||||
|
but the majority of a big table will not fit in the cache.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Another way to cluster data is to use
|
||||||
|
<programlisting>
|
||||||
SELECT ... INTO TABLE <replaceable class="parameter">temp</replaceable> FROM ... ORDER BY ...
|
SELECT ... INTO TABLE <replaceable class="parameter">temp</replaceable> FROM ... ORDER BY ...
|
||||||
</programlisting>
|
</programlisting>
|
||||||
This uses the <productname>Postgres</productname> sorting code in
|
This uses the <productname>Postgres</productname> sorting code in
|
||||||
ORDER BY to match the index, and is much faster for
|
ORDER BY to match the index, and is much faster for
|
||||||
unordered data. You then drop the old table, use
|
unordered data. You then drop the old table, use
|
||||||
<command>ALTER TABLE/RENAME</command>
|
<command>ALTER TABLE/RENAME</command>
|
||||||
to rename <replaceable class="parameter">temp</replaceable> to the old name, and
|
to rename <replaceable class="parameter">temp</replaceable> to the old name, and
|
||||||
recreate any indexes. The only problem is that <acronym>OID</acronym>s
|
recreate any indexes. The only problem is that <acronym>OID</acronym>s
|
||||||
will not be preserved. From then on, <command>CLUSTER</command> should be
|
will not be preserved. From then on, <command>CLUSTER</command> should be
|
||||||
fast because most of the heap data has already been
|
fast because most of the heap data has already been
|
||||||
ordered, and the existing index is used.
|
ordered, and the existing index is used.
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-CLUSTER-2">
|
<refsect1 id="R1-SQL-CLUSTER-2">
|
||||||
<TITLE>
|
<title>
|
||||||
Usage
|
Usage
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
Cluster the employees relation on the basis of its salary attribute
|
Cluster the employees relation on the basis of its salary attribute
|
||||||
</PARA>
|
</para>
|
||||||
<ProgramListing>
|
<programlisting>
|
||||||
CLUSTER emp_ind ON emp
|
CLUSTER emp_ind ON emp;
|
||||||
</ProgramListing>
|
</programlisting>
|
||||||
</REFSECT1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-CLUSTER-3">
|
<refsect1 id="R1-SQL-CLUSTER-3">
|
||||||
<TITLE>
|
<title>
|
||||||
Compatibility
|
Compatibility
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CLUSTER-4">
|
<refsect2 id="R2-SQL-CLUSTER-4">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-08</DATE>
|
<date>1998-09-08</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
SQL92
|
SQL92
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
There is no <command>CLUSTER</command> statement in SQL92.
|
There is no <command>CLUSTER</command> statement in SQL92.
|
||||||
</PARA>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
</refentry>
|
||||||
|
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
mode: sgml
|
mode: sgml
|
||||||
sgml-omittag:t
|
sgml-omittag:nil
|
||||||
sgml-shorttag:t
|
sgml-shorttag:t
|
||||||
sgml-minimize-attributes:nil
|
sgml-minimize-attributes:nil
|
||||||
sgml-always-quote-attributes:t
|
sgml-always-quote-attributes:t
|
||||||
|
|
|
@ -30,7 +30,7 @@ COMMIT [ WORK | TRANSACTION ]
|
||||||
Inputs
|
Inputs
|
||||||
</title>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
None
|
None.
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
|
|
||||||
|
@ -45,9 +45,9 @@ COMMIT [ WORK | TRANSACTION ]
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><computeroutput>
|
||||||
<returnvalue>END</returnvalue>
|
END
|
||||||
</term>
|
</computeroutput></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Message returned if the transaction is successfully committed.
|
Message returned if the transaction is successfully committed.
|
||||||
|
@ -55,9 +55,9 @@ COMMIT [ WORK | TRANSACTION ]
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><computeroutput>
|
||||||
<returnvalue>NOTICE EndTransactionBlock and not inprogress/abort state</returnvalue>
|
NOTICE EndTransactionBlock and not inprogress/abort state
|
||||||
</term>
|
</computeroutput></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
If there is no transaction in progress.
|
If there is no transaction in progress.
|
||||||
|
|
|
@ -1,176 +1,166 @@
|
||||||
<REFENTRY ID="SQL-COPY">
|
<refentry id="SQL-COPY">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
COPY
|
COPY
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
COPY
|
COPY
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Copies data between files and tables
|
Copies data between files and tables
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-09-08</DATE>
|
<date>1998-09-08</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
COPY [ BINARY ] <replaceable class="parameter">table</replaceable> [ WITH OIDS ]
|
COPY [ BINARY ] <replaceable class="parameter">table</replaceable> [ WITH OIDS ]
|
||||||
FROM { '<replaceable class="parameter">filename</replaceable>' | <filename>stdin</filename> }
|
FROM { '<replaceable class="parameter">filename</replaceable>' |
|
||||||
|
<filename>stdin</filename> }
|
||||||
[ USING DELIMITERS '<replaceable class="parameter">delimiter</replaceable>' ]
|
[ USING DELIMITERS '<replaceable class="parameter">delimiter</replaceable>' ]
|
||||||
COPY [ BINARY ] <replaceable class="parameter">table</replaceable> [ WITH OIDS ]
|
COPY [ BINARY ] <replaceable class="parameter">table</replaceable> [ WITH OIDS ]
|
||||||
TO { '<replaceable class="parameter">filename</replaceable>' | <filename>stdout</filename> }
|
TO { '<replaceable class="parameter">filename</replaceable>' |
|
||||||
|
<filename>stdout</filename> }
|
||||||
[ USING DELIMITERS '<replaceable class="parameter">delimiter</replaceable>' ]
|
[ USING DELIMITERS '<replaceable class="parameter">delimiter</replaceable>' ]
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-COPY-1">
|
<refsect2 id="R2-SQL-COPY-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-08</DATE>
|
<date>1998-09-08</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
<variablelist>
|
||||||
<TERM>
|
<varlistentry>
|
||||||
BINARY
|
<term>BINARY</term>
|
||||||
</TERM>
|
<listitem>
|
||||||
<LISTITEM>
|
<para>
|
||||||
<PARA>
|
Changes the behavior of field formatting, forcing all data to be
|
||||||
Changes the behavior of field formatting, forcing all data to be
|
stored or read as binary objects rather than as text.
|
||||||
stored or read as binary objects rather than as text.
|
</para>
|
||||||
</PARA>
|
</listitem>
|
||||||
</LISTITEM>
|
</varlistentry>
|
||||||
</VARLISTENTRY>
|
<varlistentry>
|
||||||
<VARLISTENTRY>
|
<term><replaceable class="parameter">table</replaceable></term>
|
||||||
<TERM>
|
<listitem>
|
||||||
<replaceable class="parameter">table</replaceable>
|
<para>
|
||||||
</TERM>
|
The name of an existing table.
|
||||||
<LISTITEM>
|
</para>
|
||||||
<PARA>
|
</listitem>
|
||||||
The name of an existing table.
|
</varlistentry>
|
||||||
</PARA>
|
<varlistentry>
|
||||||
</LISTITEM>
|
<term>WITH OIDS</term>
|
||||||
</VARLISTENTRY>
|
<listitem>
|
||||||
<VARLISTENTRY>
|
<para>
|
||||||
<TERM>
|
Copies the internal unique object id (OID) for each row.
|
||||||
WITH OIDS
|
</para>
|
||||||
</TERM>
|
</listitem>
|
||||||
<LISTITEM>
|
</varlistentry>
|
||||||
<PARA>
|
<varlistentry>
|
||||||
Copies the internal unique object id (OID) for each row.
|
<term><replaceable class="parameter">filename</replaceable></term>
|
||||||
</PARA>
|
<listitem>
|
||||||
</LISTITEM>
|
<para>
|
||||||
</VARLISTENTRY>
|
The absolute Unix pathname of the input or output file.
|
||||||
<VARLISTENTRY>
|
</para>
|
||||||
<TERM>
|
</listitem>
|
||||||
<replaceable class="parameter">filename</replaceable>
|
</varlistentry>
|
||||||
</TERM>
|
<varlistentry>
|
||||||
<LISTITEM>
|
<term><filename>stdin</filename></term>
|
||||||
<PARA>
|
<listitem>
|
||||||
The absolute Unix pathname of the input or output file.
|
<para>
|
||||||
</PARA>
|
Specifies that input comes from a pipe or terminal.
|
||||||
</LISTITEM>
|
</para>
|
||||||
</VARLISTENTRY>
|
</listitem>
|
||||||
<VARLISTENTRY>
|
</varlistentry>
|
||||||
<TERM>
|
<varlistentry>
|
||||||
<filename>stdin</filename>
|
<term><filename>stdout</filename></term>
|
||||||
</TERM>
|
<listitem>
|
||||||
<LISTITEM>
|
<para>
|
||||||
<PARA>
|
Specifies that output goes to a pipe or terminal.
|
||||||
Specifies that input comes from a pipe or terminal.
|
</para>
|
||||||
</PARA>
|
</listitem>
|
||||||
</LISTITEM>
|
</varlistentry>
|
||||||
</VARLISTENTRY>
|
<varlistentry>
|
||||||
<VARLISTENTRY>
|
<term><replaceable class="parameter">delimiter</replaceable></term>
|
||||||
<TERM>
|
<listitem>
|
||||||
<filename>stdout</filename>
|
<para>
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Specifies that output goes to a pipe or terminal.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">delimiter</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
A character that delimits the input or output fields.
|
A character that delimits the input or output fields.
|
||||||
</PARA>
|
</para>
|
||||||
</LISTITEM>
|
</listitem>
|
||||||
</VARLISTENTRY>
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-COPY-2">
|
<refsect2 id="R2-SQL-COPY-2">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-08</DATE>
|
<date>1998-09-08</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Outputs
|
Outputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
|
|
||||||
<VARIABLELIST>
|
<variablelist>
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term><computeroutput>
|
||||||
<ReturnValue>COPY</ReturnValue>
|
COPY
|
||||||
</TERM>
|
</computeroutput></term>
|
||||||
<LISTITEM>
|
<listitem>
|
||||||
<PARA>
|
<para>
|
||||||
The copy completed successfully.
|
The copy completed successfully.
|
||||||
</PARA>
|
</para>
|
||||||
</LISTITEM>
|
</listitem>
|
||||||
</VARLISTENTRY>
|
</varlistentry>
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term><computeroutput>
|
||||||
<ReturnValue>ERROR: <replaceable>error message</replaceable></ReturnValue>
|
ERROR: <replaceable>error message</replaceable>
|
||||||
</TERM>
|
</computeroutput></term>
|
||||||
<LISTITEM>
|
<listitem>
|
||||||
<PARA>
|
<para>
|
||||||
The copy failed for the reason stated in the error message.
|
The copy failed for the reason stated in the error message.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</VARIABLELIST>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</REFSYNOPSISDIV>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-COPY-1">
|
<refsect1 id="R1-SQL-COPY-1">
|
||||||
<REFSECT1INFO>
|
<refsect1info>
|
||||||
<DATE>1998-09-08</DATE>
|
<date>1998-09-08</date>
|
||||||
</REFSECT1INFO>
|
</refsect1info>
|
||||||
<TITLE>
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
<command>COPY</command> moves data between
|
<command>COPY</command> moves data between
|
||||||
<productname>Postgres</productname> tables and
|
<productname>Postgres</productname> tables and
|
||||||
standard Unix files.
|
standard Unix files.
|
||||||
|
|
||||||
<command>COPY</command> instructs
|
<command>COPY</command> instructs
|
||||||
the <productname>Postgres</productname> backend
|
the <productname>Postgres</productname> backend
|
||||||
to directly read from or write to a file. The file must be directly visible to
|
to directly read from or write to a file. The file must be directly visible to
|
||||||
the backend and the name must be specified from the viewpoint of the backend.
|
the backend and the name must be specified from the viewpoint of the backend.
|
||||||
If <filename>stdin</filename> or <filename>stdout</filename> are specified, data flows through the client frontend to
|
If <filename>stdin</filename> or <filename>stdout</filename> are
|
||||||
the backend.
|
specified, data flows through the client frontend to the backend.
|
||||||
</para>
|
</para>
|
||||||
<REFSECT2 ID="R2-SQL-COPY-3">
|
|
||||||
<REFSECT2INFO>
|
<refsect2 id="R2-SQL-COPY-3">
|
||||||
<DATE>1998-09-08</DATE>
|
<refsect2info>
|
||||||
</REFSECT2INFO>
|
<date>1998-09-08</date>
|
||||||
<TITLE>
|
</refsect2info>
|
||||||
|
<title>
|
||||||
Notes
|
Notes
|
||||||
</TITLE>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
The BINARY keyword will force all data to be
|
The BINARY keyword will force all data to be
|
||||||
stored/read as binary objects rather than as text. It is
|
stored/read as binary objects rather than as text. It is
|
||||||
|
@ -191,6 +181,7 @@ Specifies that output goes to a pipe or terminal.
|
||||||
The backend also needs appropriate Unix permissions for any file read
|
The backend also needs appropriate Unix permissions for any file read
|
||||||
or written by <command>COPY</command>.
|
or written by <command>COPY</command>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The keyword phrase USING DELIMITERS specifies a single character
|
The keyword phrase USING DELIMITERS specifies a single character
|
||||||
to be used for all delimiters between columns. If multiple characters
|
to be used for all delimiters between columns. If multiple characters
|
||||||
|
@ -204,10 +195,10 @@ Specifies that output goes to a pipe or terminal.
|
||||||
</para>
|
</para>
|
||||||
</tip>
|
</tip>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1 ID="R1-SQL-COPY-2">
|
<refsect1 id="R1-SQL-COPY-2">
|
||||||
<refsect1info>
|
<refsect1info>
|
||||||
<date>1998-05-04</date>
|
<date>1998-05-04</date>
|
||||||
</refsect1info>
|
</refsect1info>
|
||||||
|
@ -231,9 +222,9 @@ Specifies that output goes to a pipe or terminal.
|
||||||
The actual format for each instance is
|
The actual format for each instance is
|
||||||
<programlisting>
|
<programlisting>
|
||||||
<attr1><<replaceable class=parameter>separator</replaceable>><attr2><<replaceable class=parameter>separator</replaceable>>...<<replaceable class=parameter>separator</replaceable>><attr<replaceable class="parameter">n</replaceable>><newline>
|
<attr1><<replaceable class=parameter>separator</replaceable>><attr2><<replaceable class=parameter>separator</replaceable>>...<<replaceable class=parameter>separator</replaceable>><attr<replaceable class="parameter">n</replaceable>><newline>
|
||||||
</programlisting>
|
</programlisting>
|
||||||
The oid is placed on the beginning of the line
|
The oid is placed on the beginning of the line
|
||||||
if WITH OIDS is specified.
|
if WITH OIDS is specified.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
If <command>COPY</command> is sending its output to standard
|
If <command>COPY</command> is sending its output to standard
|
||||||
|
@ -253,7 +244,7 @@ Specifies that output goes to a pipe or terminal.
|
||||||
as a backslash and a tab. A literal newline character is
|
as a backslash and a tab. A literal newline character is
|
||||||
represented as a backslash and a newline. When loading text data
|
represented as a backslash and a newline. When loading text data
|
||||||
not generated by <acronym>Postgres</acronym>,
|
not generated by <acronym>Postgres</acronym>,
|
||||||
you will need to convert backslash
|
you will need to convert backslash
|
||||||
characters ("\") to double-backslashes ("\\") to ensure that they are loaded
|
characters ("\") to double-backslashes ("\\") to ensure that they are loaded
|
||||||
properly.
|
properly.
|
||||||
</para>
|
</para>
|
||||||
|
@ -279,20 +270,20 @@ Specifies that output goes to a pipe or terminal.
|
||||||
</para>
|
</para>
|
||||||
<table frame="all">
|
<table frame="all">
|
||||||
<title>Contents of a binary copy file</title>
|
<title>Contents of a binary copy file</title>
|
||||||
<tgroup cols="2"colsep="1" rowsep="1" align="center">
|
<tgroup cols="2" colsep="1" rowsep="1" align="center">
|
||||||
<COLSPEC COLNAME="col1">
|
<colspec colname="col1">
|
||||||
<COLSPEC COLNAME="col2">
|
<colspec colname="col2">
|
||||||
<spanspec namest="col1" nameend="col2" spanname="subhead">
|
<spanspec namest="col1" nameend="col2" spanname="subhead">
|
||||||
<tbody>
|
<tbody>
|
||||||
<row>
|
<row>
|
||||||
<entry align="center" spanname="subhead">At the start of the file</entry>
|
<entry spanname="subhead" align="center">At the start of the file</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>uint32</entry>
|
<entry>uint32</entry>
|
||||||
<entry>number of tuples</entry>
|
<entry>number of tuples</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry align="center" spanname="subhead">For each tuple</entry>
|
<entry spanname="subhead" align="center">For each tuple</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry>uint32</entry>
|
<entry>uint32</entry>
|
||||||
|
@ -337,30 +328,30 @@ Specifies that output goes to a pipe or terminal.
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-COPY-3">
|
<refsect1 id="R1-SQL-COPY-3">
|
||||||
<TITLE>
|
<title>
|
||||||
Usage
|
Usage
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
The following example copies a table to standard output,
|
The following example copies a table to standard output,
|
||||||
using a vertical bar ("|") as the field
|
using a vertical bar ("|") as the field
|
||||||
delimiter:
|
delimiter:
|
||||||
</PARA>
|
</para>
|
||||||
<ProgramListing>
|
<programlisting>
|
||||||
COPY country TO <filename>stdout</filename> USING DELIMITERS '|';
|
COPY country TO <filename>stdout</filename> USING DELIMITERS '|';
|
||||||
</ProgramListing>
|
</programlisting>
|
||||||
<PARA>
|
<para>
|
||||||
To copy data from a Unix file into a table "country":
|
To copy data from a Unix file into a table "country":
|
||||||
</PARA>
|
</para>
|
||||||
<ProgramListing>
|
<programlisting>
|
||||||
COPY country FROM '/usr1/proj/bray/sql/country_data';
|
COPY country FROM '/usr1/proj/bray/sql/country_data';
|
||||||
</ProgramListing>
|
</programlisting>
|
||||||
<PARA>
|
<para>
|
||||||
Here is a sample of data suitable for copying into a table
|
Here is a sample of data suitable for copying into a table
|
||||||
from <filename>stdin</filename> (so it
|
from <filename>stdin</filename> (so it
|
||||||
has the termination sequence on the last line):
|
has the termination sequence on the last line):
|
||||||
</PARA>
|
</para>
|
||||||
<ProgramListing>
|
<programlisting>
|
||||||
AF AFGHANISTAN
|
AF AFGHANISTAN
|
||||||
AL ALBANIA
|
AL ALBANIA
|
||||||
DZ ALGERIA
|
DZ ALGERIA
|
||||||
|
@ -368,8 +359,8 @@ has the termination sequence on the last line):
|
||||||
ZM ZAMBIA
|
ZM ZAMBIA
|
||||||
ZW ZIMBABWE
|
ZW ZIMBABWE
|
||||||
\.
|
\.
|
||||||
</ProgramListing>
|
</programlisting>
|
||||||
<PARA>
|
<para>
|
||||||
The same data, output in binary format on a Linux/i586 machine.
|
The same data, output in binary format on a Linux/i586 machine.
|
||||||
The data is shown after filtering through
|
The data is shown after filtering through
|
||||||
the Unix utility <command>od -c</command>. The table has
|
the Unix utility <command>od -c</command>. The table has
|
||||||
|
@ -379,8 +370,8 @@ has the termination sequence on the last line):
|
||||||
Notice how the <classname>char(2)</classname>
|
Notice how the <classname>char(2)</classname>
|
||||||
field is padded with nulls to four bytes and the text field is
|
field is padded with nulls to four bytes and the text field is
|
||||||
preceded by its length:
|
preceded by its length:
|
||||||
</PARA>
|
</para>
|
||||||
<ProgramListing>
|
<programlisting>
|
||||||
355 \0 \0 \0 027 \0 \0 \0 001 \0 \0 \0 002 \0 \0 \0
|
355 \0 \0 \0 027 \0 \0 \0 001 \0 \0 \0 002 \0 \0 \0
|
||||||
006 \0 \0 \0 A F \0 \0 017 \0 \0 \0 A F G H
|
006 \0 \0 \0 A F \0 \0 017 \0 \0 \0 A F G H
|
||||||
A N I S T A N 023 \0 \0 \0 001 \0 \0 \0 002
|
A N I S T A N 023 \0 \0 \0 001 \0 \0 \0 002
|
||||||
|
@ -391,10 +382,10 @@ has the termination sequence on the last line):
|
||||||
... \n \0 \0 \0 Z A M B I A 024 \0
|
... \n \0 \0 \0 Z A M B I A 024 \0
|
||||||
\0 \0 001 \0 \0 \0 002 \0 \0 \0 006 \0 \0 \0 Z W
|
\0 \0 001 \0 \0 \0 002 \0 \0 \0 006 \0 \0 \0 Z W
|
||||||
\0 \0 \f \0 \0 \0 Z I M B A B W E
|
\0 \0 \f \0 \0 \0 Z I M B A B W E
|
||||||
</ProgramListing>
|
</programlisting>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1 ID="R1-SQL-COPY-5">
|
<refsect1 id="R1-SQL-COPY-5">
|
||||||
<title>Bugs and features</title>
|
<title>Bugs and features</title>
|
||||||
<para>
|
<para>
|
||||||
<command>COPY</command> neither invokes rules nor acts on column defaults.
|
<command>COPY</command> neither invokes rules nor acts on column defaults.
|
||||||
|
@ -435,31 +426,31 @@ must reside on or be
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-COPY-6">
|
<refsect1 id="R1-SQL-COPY-6">
|
||||||
<TITLE>
|
<title>
|
||||||
Compatibility
|
Compatibility
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-COPY-4">
|
<refsect2 id="R2-SQL-COPY-4">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-08</DATE>
|
<date>1998-09-08</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
SQL92
|
SQL92
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
There is no <command>COPY</command> statement in SQL92.
|
There is no <command>COPY</command> statement in SQL92.
|
||||||
</PARA>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
</refentry>
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
mode: sgml
|
mode: sgml
|
||||||
sgml-omittag:t
|
sgml-omittag:nil
|
||||||
sgml-shorttag:t
|
sgml-shorttag:t
|
||||||
sgml-minimize-attributes:nil
|
sgml-minimize-attributes:nil
|
||||||
sgml-always-quote-attributes:t
|
sgml-always-quote-attributes:t
|
||||||
|
|
|
@ -1,193 +1,175 @@
|
||||||
<REFENTRY ID="SQL-CREATEAGGREGATE">
|
<refentry id="SQL-CREATEAGGREGATE">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
CREATE AGGREGATE
|
CREATE AGGREGATE
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
|
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
CREATE AGGREGATE
|
CREATE AGGREGATE
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Defines a new aggregate function
|
Defines a new aggregate function
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-09-09</DATE>
|
<date>1998-09-09</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
CREATE AGGREGATE <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE> [ AS ]
|
CREATE AGGREGATE <replaceable class="PARAMETER">name</replaceable> [ AS ]
|
||||||
( BASETYPE = <REPLACEABLE CLASS="PARAMETER">data_type</REPLACEABLE>
|
( BASETYPE = <replaceable class="PARAMETER">data_type</replaceable>
|
||||||
[ , SFUNC1 = <REPLACEABLE CLASS="PARAMETER">sfunc1</REPLACEABLE>
|
[ , SFUNC1 = <replaceable class="PARAMETER">sfunc1</replaceable>
|
||||||
, STYPE1 = <REPLACEABLE CLASS="PARAMETER">sfunc1_return_type</REPLACEABLE> ]
|
, STYPE1 = <replaceable class="PARAMETER">sfunc1_return_type</replaceable> ]
|
||||||
[ , SFUNC2 = <REPLACEABLE CLASS="PARAMETER">sfunc2</REPLACEABLE>
|
[ , SFUNC2 = <replaceable class="PARAMETER">sfunc2</replaceable>
|
||||||
, STYPE2 = <REPLACEABLE CLASS="PARAMETER">sfunc2_return_type</REPLACEABLE> ]
|
, STYPE2 = <replaceable class="PARAMETER">sfunc2_return_type</replaceable> ]
|
||||||
[ , FINALFUNC = <REPLACEABLE CLASS="PARAMETER">ffunc</REPLACEABLE> ]
|
[ , FINALFUNC = <replaceable class="PARAMETER">ffunc</replaceable> ]
|
||||||
[ , INITCOND1 = <REPLACEABLE CLASS="PARAMETER">initial_condition1</REPLACEABLE> ]
|
[ , INITCOND1 = <replaceable class="PARAMETER">initial_condition1</replaceable> ]
|
||||||
[ , INITCOND2 = <REPLACEABLE CLASS="PARAMETER">initial_condition2</REPLACEABLE> ]
|
[ , INITCOND2 = <replaceable class="PARAMETER">initial_condition2</replaceable> ]
|
||||||
)
|
)
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATEAGGREGATE-1">
|
<refsect2 id="R2-SQL-CREATEAGGREGATE-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-09</DATE>
|
<date>1998-09-09</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<VARIABLELIST>
|
<variablelist>
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term><replaceable class="PARAMETER">name</replaceable></term>
|
||||||
<REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE>
|
<listitem>
|
||||||
</TERM>
|
<para>
|
||||||
<LISTITEM>
|
The name of an aggregate function to create.
|
||||||
<para>
|
</para>
|
||||||
The name of an aggregate function to create.
|
</listitem>
|
||||||
</para>
|
</varlistentry>
|
||||||
</LISTITEM>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><replaceable class="PARAMETER">data_type</replaceable></term>
|
||||||
<REPLACEABLE CLASS="PARAMETER">data_type</REPLACEABLE>
|
<listitem>
|
||||||
</term>
|
<para>
|
||||||
<listitem>
|
The fundamental data type on which this aggregate function operates.
|
||||||
<para>
|
</para>
|
||||||
The fundamental data type on which this aggregate function operates.
|
</listitem>
|
||||||
</para>
|
</varlistentry>
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><replaceable class="PARAMETER">sfunc1</replaceable></term>
|
||||||
<REPLACEABLE CLASS="PARAMETER">sfunc1</REPLACEABLE>
|
<listitem>
|
||||||
</term>
|
<para>
|
||||||
<listitem>
|
The state transition function
|
||||||
<para>
|
to be called for every non-NULL field from the source column.
|
||||||
The state transition function
|
It takes a variable of
|
||||||
to be called for every non-NULL field from the source column.
|
type <replaceable class="PARAMETER">sfunc1_return_type</replaceable> as
|
||||||
It takes a variable of
|
the first argument and that field as the
|
||||||
type <REPLACEABLE CLASS="PARAMETER">sfunc1_return_type</REPLACEABLE> as
|
second argument.
|
||||||
the first argument and that field as the
|
</para>
|
||||||
second argument.
|
</listitem>
|
||||||
</para>
|
</varlistentry>
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><replaceable class="PARAMETER">sfunc1_return_type</replaceable></term>
|
||||||
<REPLACEABLE CLASS="PARAMETER">sfunc1_return_type</REPLACEABLE>
|
<listitem>
|
||||||
</term>
|
<para>
|
||||||
<listitem>
|
The return type of the first transition function.
|
||||||
<para>
|
</para>
|
||||||
The return type of the first transition function.
|
</listitem>
|
||||||
</para>
|
</varlistentry>
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><replaceable class="PARAMETER">sfunc2</replaceable></term>
|
||||||
<REPLACEABLE CLASS="PARAMETER">sfunc2</REPLACEABLE>
|
<listitem>
|
||||||
</term>
|
<para>
|
||||||
<listitem>
|
The state transition function
|
||||||
<para>
|
to be called for every non-NULL field from the source column.
|
||||||
The state transition function
|
It takes a variable
|
||||||
to be called for every non-NULL field from the source column.
|
of type <replaceable class="PARAMETER">sfunc2_return_type</replaceable>
|
||||||
It takes a variable
|
as the only argument and returns a variable of the same type.
|
||||||
of type <REPLACEABLE CLASS="PARAMETER">sfunc2_return_type</REPLACEABLE>
|
</para>
|
||||||
as the only argument and returns a variable of the same type.
|
</listitem>
|
||||||
</para>
|
</varlistentry>
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><replaceable class="PARAMETER">sfunc2_return_type</replaceable></term>
|
||||||
<REPLACEABLE CLASS="PARAMETER">sfunc2_return_type</REPLACEABLE>
|
<listitem>
|
||||||
</term>
|
<para>
|
||||||
<listitem>
|
The return type of the second transition function.
|
||||||
<para>
|
</para>
|
||||||
The return type of the second transition function.
|
</listitem>
|
||||||
</para>
|
</varlistentry>
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><replaceable class="PARAMETER">ffunc</replaceable></term>
|
||||||
<REPLACEABLE CLASS="PARAMETER">ffunc</REPLACEABLE>
|
<listitem>
|
||||||
</term>
|
<para>
|
||||||
<listitem>
|
The final function
|
||||||
<para>
|
called after traversing all input fields. This function must
|
||||||
The final function
|
take two arguments of types
|
||||||
called after traversing all input fields. This function must
|
<replaceable class="PARAMETER">sfunc1_return_type</replaceable>
|
||||||
take two arguments of types
|
and
|
||||||
<REPLACEABLE CLASS="PARAMETER">sfunc1_return_type</REPLACEABLE>
|
<replaceable class="PARAMETER">sfunc2_return_type</replaceable>.
|
||||||
and
|
</para>
|
||||||
<REPLACEABLE CLASS="PARAMETER">sfunc2_return_type</REPLACEABLE>.
|
</listitem>
|
||||||
</para>
|
</varlistentry>
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><replaceable class="PARAMETER">initial_condition1</replaceable></term>
|
||||||
<REPLACEABLE CLASS="PARAMETER">initial_condition1</REPLACEABLE>
|
<listitem>
|
||||||
</term>
|
<para>
|
||||||
<listitem>
|
The initial value for the first transition function argument.
|
||||||
<para>
|
</para>
|
||||||
The initial value for the first transition function argument.
|
</listitem>
|
||||||
</para>
|
</varlistentry>
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><replaceable class="PARAMETER">initial_condition2</replaceable></term>
|
||||||
<REPLACEABLE CLASS="PARAMETER">initial_condition2</REPLACEABLE>
|
<listitem>
|
||||||
</term>
|
<para>
|
||||||
<listitem>
|
The initial value for the second transition function argument.
|
||||||
<para>
|
</para>
|
||||||
The initial value for the second transition function argument.
|
</listitem>
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATEAGGREGATE-2">
|
<refsect2 id="R2-SQL-CREATEAGGREGATE-2">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-09</DATE>
|
<date>1998-09-09</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Outputs
|
Outputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
|
|
||||||
<VARIABLELIST>
|
<variablelist>
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term><computeroutput>
|
||||||
<ReturnValue>CREATE</ReturnValue>
|
CREATE
|
||||||
</TERM>
|
</computeroutput></term>
|
||||||
<LISTITEM>
|
<listitem>
|
||||||
<PARA>
|
<para>
|
||||||
Message returned if the command completes successfully.
|
Message returned if the command completes successfully.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</VARIABLELIST>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</REFSYNOPSISDIV>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-CREATEAGGREGATE-1">
|
<refsect1 id="R1-SQL-CREATEAGGREGATE-1">
|
||||||
<REFSECT1INFO>
|
<refsect1info>
|
||||||
<DATE>1998-09-09</DATE>
|
<date>1998-09-09</date>
|
||||||
</REFSECT1INFO>
|
</refsect1info>
|
||||||
<TITLE>
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
<command>CREATE AGGREGATE</command>
|
<command>CREATE AGGREGATE</command>
|
||||||
allows a user or programmer to extend <productname>Postgres</productname>
|
allows a user or programmer to extend <productname>Postgres</productname>
|
||||||
|
@ -198,25 +180,24 @@ The initial value for the second transition function argument.
|
||||||
already provided then <command>CREATE AGGREGATE</command>
|
already provided then <command>CREATE AGGREGATE</command>
|
||||||
can be used to provide the desired features.
|
can be used to provide the desired features.
|
||||||
</para>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
An aggregate function can require up to three functions, two
|
An aggregate function can require up to three functions, two
|
||||||
state transition functions,
|
state transition functions,
|
||||||
<REPLACEABLE CLASS="PARAMETER">sfunc1</REPLACEABLE>
|
<replaceable class="PARAMETER">sfunc1</replaceable>
|
||||||
and <REPLACEABLE CLASS="PARAMETER">sfunc2</REPLACEABLE>:
|
and <replaceable class="PARAMETER">sfunc2</replaceable>:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
<REPLACEABLE CLASS="PARAMETER">sfunc1</REPLACEABLE>( internal-state1, next-data_item ) ---> next-internal-state1
|
<replaceable class="PARAMETER">sfunc1</replaceable>( internal-state1, next-data_item ) ---> next-internal-state1 <replaceable class="PARAMETER">sfunc2</replaceable>( internal-state2 ) ---> next-internal-state2
|
||||||
<REPLACEABLE CLASS="PARAMETER">sfunc2</REPLACEABLE>( internal-state2 ) ---> next-internal-state2
|
|
||||||
</programlisting>
|
</programlisting>
|
||||||
and a final calculation function,
|
and a final calculation function,
|
||||||
<REPLACEABLE CLASS="PARAMETER">ffunc</REPLACEABLE>:
|
<replaceable class="PARAMETER">ffunc</replaceable>:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
<REPLACEABLE CLASS="PARAMETER">ffunc</REPLACEABLE>(internal-state1, internal-state2) ---> aggregate-value
|
<replaceable class="PARAMETER">ffunc</replaceable>(internal-state1, internal-state2) ---> aggregate-value
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
<productname>Postgres</productname> creates up to two temporary variables
|
<productname>Postgres</productname> creates up to two temporary variables
|
||||||
(referred to here as <REPLACEABLE CLASS="PARAMETER">temp1</REPLACEABLE>
|
(referred to here as <replaceable class="PARAMETER">temp1</replaceable>
|
||||||
and <REPLACEABLE CLASS="PARAMETER">temp2</REPLACEABLE>)
|
and <replaceable class="PARAMETER">temp2</replaceable>)
|
||||||
to hold intermediate results used as arguments to the transition functions.
|
to hold intermediate results used as arguments to the transition functions.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
|
@ -225,42 +206,42 @@ The initial value for the second transition function argument.
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The arguments to
|
The arguments to
|
||||||
<REPLACEABLE CLASS="PARAMETER">sfunc1</REPLACEABLE>
|
<replaceable class="PARAMETER">sfunc1</replaceable>
|
||||||
must be
|
must be
|
||||||
<REPLACEABLE CLASS="PARAMETER">temp1</REPLACEABLE>
|
<replaceable class="PARAMETER">temp1</replaceable>
|
||||||
of type
|
of type
|
||||||
<REPLACEABLE CLASS="PARAMETER">sfunc1_return_type</REPLACEABLE>
|
<replaceable class="PARAMETER">sfunc1_return_type</replaceable>
|
||||||
and
|
and
|
||||||
<REPLACEABLE CLASS="PARAMETER">column_value</REPLACEABLE>
|
<replaceable class="PARAMETER">column_value</replaceable>
|
||||||
of type <REPLACEABLE CLASS="PARAMETER">data_type</REPLACEABLE>.
|
of type <replaceable class="PARAMETER">data_type</replaceable>.
|
||||||
The return value must be of type
|
The return value must be of type
|
||||||
<REPLACEABLE CLASS="PARAMETER">sfunc1_return_type</REPLACEABLE>
|
<replaceable class="PARAMETER">sfunc1_return_type</replaceable>
|
||||||
and will be used as the first argument in the next call to
|
and will be used as the first argument in the next call to
|
||||||
<REPLACEABLE CLASS="PARAMETER">sfunc1</REPLACEABLE>.
|
<replaceable class="PARAMETER">sfunc1</replaceable>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The argument and return value of
|
The argument and return value of
|
||||||
<REPLACEABLE CLASS="PARAMETER">sfunc2</REPLACEABLE>
|
<replaceable class="PARAMETER">sfunc2</replaceable>
|
||||||
must be
|
must be
|
||||||
<REPLACEABLE CLASS="PARAMETER">temp2</REPLACEABLE>
|
<replaceable class="PARAMETER">temp2</replaceable>
|
||||||
of type
|
of type
|
||||||
<REPLACEABLE CLASS="PARAMETER">sfunc2_return_type</REPLACEABLE>.
|
<replaceable class="PARAMETER">sfunc2_return_type</replaceable>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The arguments to the final-calculation-function
|
The arguments to the final-calculation-function
|
||||||
must be
|
must be
|
||||||
<REPLACEABLE CLASS="PARAMETER">temp1</REPLACEABLE>
|
<replaceable class="PARAMETER">temp1</replaceable>
|
||||||
and
|
and
|
||||||
<REPLACEABLE CLASS="PARAMETER">temp2</REPLACEABLE>
|
<replaceable class="PARAMETER">temp2</replaceable>
|
||||||
and its return value must
|
and its return value must
|
||||||
be a <productname>Postgres</productname>
|
be a <productname>Postgres</productname>
|
||||||
base type (not necessarily
|
base type (not necessarily
|
||||||
<REPLACEABLE CLASS="PARAMETER">data_type</REPLACEABLE>
|
<replaceable class="PARAMETER">data_type</replaceable>
|
||||||
which had been specified for BASETYPE).
|
which had been specified for BASETYPE).
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
@ -269,10 +250,9 @@ The initial value for the second transition function argument.
|
||||||
FINALFUNC should be specified
|
FINALFUNC should be specified
|
||||||
if and only if both state-transition functions are
|
if and only if both state-transition functions are
|
||||||
specified.
|
specified.
|
||||||
</para
|
</para></listitem>
|
||||||
</listitem>
|
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
An aggregate function may also require one or two initial conditions,
|
An aggregate function may also require one or two initial conditions,
|
||||||
|
@ -281,72 +261,72 @@ The initial value for the second transition function argument.
|
||||||
in the database as fields of type <type>text</type>.
|
in the database as fields of type <type>text</type>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATEAGGREGATE-3">
|
<refsect2 id="R2-SQL-CREATEAGGREGATE-3">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-09</DATE>
|
<date>1998-09-09</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Notes
|
Notes
|
||||||
</TITLE>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
Use <command>DROP AGGREGATE</command>
|
Use <command>DROP AGGREGATE</command>
|
||||||
to drop aggregate functions.
|
to drop aggregate functions.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
It is possible to specify aggregate functions
|
It is possible to specify aggregate functions
|
||||||
that have varying combinations of state and final functions.
|
that have varying combinations of state and final functions.
|
||||||
For example, the <function>count</function> aggregate requires SFUNC2
|
For example, the <function>count</function> aggregate requires SFUNC2
|
||||||
(an incrementing function) but not SFUNC1 or FINALFUNC,
|
(an incrementing function) but not SFUNC1 or FINALFUNC,
|
||||||
whereas the <function>sum</function> aggregate requires SFUNC1 (an addition
|
whereas the <function>sum</function> aggregate requires SFUNC1 (an addition
|
||||||
function) but not SFUNC2 or FINALFUNC and the <function>avg</function>
|
function) but not SFUNC2 or FINALFUNC and the <function>avg</function>
|
||||||
aggregate requires
|
aggregate requires
|
||||||
both of the above state functions as
|
both of the above state functions as
|
||||||
well as a FINALFUNC (a division function) to produce its
|
well as a FINALFUNC (a division function) to produce its
|
||||||
answer. In any case, at least one state function must be
|
answer. In any case, at least one state function must be
|
||||||
defined, and any SFUNC2 must have a corresponding INITCOND2.
|
defined, and any SFUNC2 must have a corresponding INITCOND2.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-CREATEAGGREGATE-2">
|
<refsect1 id="R1-SQL-CREATEAGGREGATE-2">
|
||||||
<TITLE>
|
<title>
|
||||||
Usage
|
Usage
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
Refer to the chapter on aggregate functions
|
Refer to the chapter on aggregate functions
|
||||||
in the <citetitle>PostgreSQL Programmer's Guide</citetitle>
|
in the <citetitle>PostgreSQL Programmer's Guide</citetitle>
|
||||||
on aggregate functions for
|
on aggregate functions for
|
||||||
complete examples of usage.
|
complete examples of usage.
|
||||||
</para>
|
</para>
|
||||||
</REFSECT1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-CREATEAGGREGATE-3">
|
<refsect1 id="R1-SQL-CREATEAGGREGATE-3">
|
||||||
<TITLE>
|
<title>
|
||||||
Compatibility
|
Compatibility
|
||||||
</TITLE>
|
</title>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATEAGGREGATE-4">
|
<refsect2 id="R2-SQL-CREATEAGGREGATE-4">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-09</DATE>
|
<date>1998-09-09</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
SQL92
|
SQL92
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<command>CREATE AGGREGATE</command>
|
<command>CREATE AGGREGATE</command>
|
||||||
is a <productname>Postgres</productname> language extension.
|
is a <productname>Postgres</productname> language extension.
|
||||||
There is no <command>CREATE AGGREGATE</command> in SQL92.
|
There is no <command>CREATE AGGREGATE</command> in SQL92.
|
||||||
</PARA>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
</refentry>
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
mode: sgml
|
mode: sgml
|
||||||
sgml-omittag:t
|
sgml-omittag:nil
|
||||||
sgml-shorttag:t
|
sgml-shorttag:t
|
||||||
sgml-minimize-attributes:nil
|
sgml-minimize-attributes:nil
|
||||||
sgml-always-quote-attributes:t
|
sgml-always-quote-attributes:t
|
||||||
|
|
|
@ -1,157 +1,155 @@
|
||||||
<REFENTRY ID="SQL-CREATEDATABASE">
|
<refentry id="SQL-CREATEDATABASE">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
CREATE DATABASE
|
CREATE DATABASE
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
CREATE DATABASE
|
CREATE DATABASE
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Creates a new database
|
Creates a new database
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
CREATE DATABASE <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE> [ WITH LOCATION = '<replaceable class="parameter">dbpath</replaceable>' ]
|
CREATE DATABASE <replaceable class="PARAMETER">name</replaceable> [ WITH LOCATION = '<replaceable class="parameter">dbpath</replaceable>' ]
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATEDATABASE-1">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-04-15</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Inputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">name</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The name of a database to create.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">dbpath</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
An alternate location can be specified as either an
|
|
||||||
environment variable known to the backend server
|
|
||||||
(e.g. '<envar>PGDATA2</envar>') or as an absolute path name
|
|
||||||
(e.g. '<filename>/usr/local/pgsql/data</filename>').
|
|
||||||
In either case, the location must be pre-configured
|
|
||||||
by <command>initlocation</command>.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
</VARIABLELIST>
|
|
||||||
</para>
|
|
||||||
</REFSECT2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATEDATABASE-2">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-04-15</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Outputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
|
|
||||||
<VARIABLELIST>
|
<refsect2 id="R2-SQL-CREATEDATABASE-1">
|
||||||
<VARLISTENTRY>
|
<refsect2info>
|
||||||
<TERM>
|
<date>1998-04-15</date>
|
||||||
<ReturnValue>CREATEDB</ReturnValue>
|
</refsect2info>
|
||||||
</TERM>
|
<title>
|
||||||
<LISTITEM>
|
Inputs
|
||||||
<PARA>
|
</title>
|
||||||
Message returned if the command completes successfully.
|
<para>
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
<variablelist>
|
||||||
</VARLISTENTRY>
|
<varlistentry>
|
||||||
<VARLISTENTRY>
|
<term><replaceable class="parameter">name</replaceable></term>
|
||||||
<TERM>
|
<listitem>
|
||||||
<ReturnValue>WARN: createdb: database "<replaceable class="parameter">name</replaceable>" already exists.</ReturnValue>
|
<para>
|
||||||
</TERM>
|
The name of a database to create.
|
||||||
<LISTITEM>
|
</para>
|
||||||
<PARA>
|
</listitem>
|
||||||
This occurs if <replaceable class="parameter">database</replaceable> specified already exists.
|
</varlistentry>
|
||||||
</PARA>
|
<varlistentry>
|
||||||
</LISTITEM>
|
<term><replaceable class="parameter">dbpath</replaceable></term>
|
||||||
</VARLISTENTRY>
|
<listitem>
|
||||||
<VARLISTENTRY>
|
<para>
|
||||||
<TERM>
|
An alternate location can be specified as either an
|
||||||
<ReturnValue>ERROR: Unable to create database directory <replaceable class="parameter">directory</replaceable>
|
environment variable known to the backend server
|
||||||
</ReturnValue>
|
(e.g. '<envar>PGDATA2</envar>') or as an absolute path name
|
||||||
</TERM>
|
(e.g. '<filename>/usr/local/pgsql/data</filename>').
|
||||||
<LISTITEM>
|
In either case, the location must be pre-configured
|
||||||
<PARA>
|
by <command>initlocation</command>.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
|
||||||
|
<refsect2 id="R2-SQL-CREATEDATABASE-2">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-04-15</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
Outputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
CREATEDB
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Message returned if the command completes successfully.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
WARN: createdb: database "<replaceable class="parameter">name</replaceable>" already exists.
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
This occurs if <replaceable class="parameter">database</replaceable> specified already exists.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
ERROR: Unable to create database directory <replaceable class="parameter">directory</replaceable>
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
There was a problem with creating the required directory; this operation will
|
There was a problem with creating the required directory; this operation will
|
||||||
need permissions for the <literal>postgres</literal> user on the specified location.
|
need permissions for the <literal>postgres</literal> user on the specified location.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</VARIABLELIST>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</REFSYNOPSISDIV>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-CREATEDATABASE-1">
|
<refsect1 id="R1-SQL-CREATEDATABASE-1">
|
||||||
<REFSECT1INFO>
|
<refsect1info>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSECT1INFO>
|
</refsect1info>
|
||||||
<TITLE>
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<command>CREATE DATABASE</command> creates a new Postgres database.
|
<command>CREATE DATABASE</command> creates a new Postgres database.
|
||||||
The creator becomes the administrator of the new database.
|
The creator becomes the administrator of the new database.
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATEDATABASE-3">
|
<refsect2 id="R2-SQL-CREATEDATABASE-3">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Notes
|
Notes
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<command>CREATE DATABASE</command> is a <productname>Postgres</productname>
|
<command>CREATE DATABASE</command> is a <productname>Postgres</productname>
|
||||||
language extension.
|
language extension.
|
||||||
</PARA>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
Use <command>DROP DATABASE</command> to remove a database.
|
Use <command>DROP DATABASE</command> to remove a database.
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-CREATEDATABASE-2">
|
<refsect1 id="R1-SQL-CREATEDATABASE-2">
|
||||||
<TITLE>
|
<title>
|
||||||
Usage
|
Usage
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
To create a new database:
|
To create a new database:
|
||||||
</PARA>
|
|
||||||
<ProgramListing>
|
<programlisting>
|
||||||
<prompt>olly=></prompt> <userinput>create database lusiadas;</userinput>
|
<prompt>olly=></prompt> <userinput>create database lusiadas;</userinput>
|
||||||
</ProgramListing>
|
</programlisting>
|
||||||
<PARA>
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
To create a new database in an alternate area <filename>~/private_db</filename>:
|
To create a new database in an alternate area <filename>~/private_db</filename>:
|
||||||
</PARA>
|
|
||||||
<ProgramListing>
|
<programlisting>
|
||||||
<prompt>$</prompt> <userinput>mkdir private_db</userinput>
|
<prompt>$</prompt> <userinput>mkdir private_db</userinput>
|
||||||
<prompt>$</prompt> <userinput>initlocation ~/private_db</userinput>
|
<prompt>$</prompt> <userinput>initlocation ~/private_db</userinput>
|
||||||
<computeroutput>Creating Postgres database system directory /home/olly/private_db/base</computeroutput>
|
<computeroutput>Creating Postgres database system directory /home/olly/private_db/base</computeroutput>
|
||||||
|
|
||||||
<prompt>$</prompt> <userinput>psql olly</userinput>
|
<prompt>$</prompt> <userinput>psql olly</userinput>
|
||||||
<computeroutput>Welcome to the POSTGRESQL interactive sql monitor:
|
<computeroutput>Welcome to the POSTGRESQL interactive sql monitor:
|
||||||
|
@ -164,21 +162,22 @@ CREATE DATABASE <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE> [ WITH LOCATIO
|
||||||
|
|
||||||
<prompt>olly=></prompt></computeroutput> <userinput>create database elsewhere with location = '/home/olly/private_db';</userinput>
|
<prompt>olly=></prompt></computeroutput> <userinput>create database elsewhere with location = '/home/olly/private_db';</userinput>
|
||||||
<computeroutput>CREATEDB</computeroutput>
|
<computeroutput>CREATEDB</computeroutput>
|
||||||
</ProgramListing>
|
</programlisting>
|
||||||
</REFSECT1>
|
</para>
|
||||||
|
</refsect1>
|
||||||
<REFSECT1 ID="R1-SQL-CREATEDATABASE-3">
|
|
||||||
<TITLE>
|
<refsect1 id="R1-SQL-CREATEDATABASE-3">
|
||||||
|
<title>
|
||||||
Bugs
|
Bugs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
There are security and data integrity issues
|
There are security and data integrity issues
|
||||||
involved with using alternate database locations
|
involved with using alternate database locations
|
||||||
specified with absolute path names, and by default
|
specified with absolute path names, and by default
|
||||||
only an environment variable known to the backend may be
|
only an environment variable known to the backend may be
|
||||||
specified for an alternate location.
|
specified for an alternate location.
|
||||||
See the Administrator's Guide for more information.
|
See the Administrator's Guide for more information.
|
||||||
</PARA>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
@ -192,33 +191,32 @@ Hmm. This isn't an issue since the upgrade would do a dump/reload from the main
|
||||||
Not sure if the dump/reload would guarantee that the alternate data area gets refreshed though...
|
Not sure if the dump/reload would guarantee that the alternate data area gets refreshed though...
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-CREATEDATABASE-4">
|
<refsect1 id="R1-SQL-CREATEDATABASE-4">
|
||||||
<TITLE>
|
<title>
|
||||||
Compatibility
|
Compatibility
|
||||||
</TITLE>
|
</title>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATEDATABASE-4">
|
<refsect2 id="R2-SQL-CREATEDATABASE-4">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
SQL92
|
SQL92
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
There is no <command>CREATE DATABASE</command> statement in SQL92.
|
There is no <command>CREATE DATABASE</command> statement in SQL92.
|
||||||
</PARA>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
The equivalent command in standard SQL is <command>CREATE SCHEMA</command>.
|
The equivalent command in standard SQL is <command>CREATE SCHEMA</command>.
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
</refentry>
|
||||||
|
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
mode: sgml
|
mode: sgml
|
||||||
sgml-omittag:t
|
sgml-omittag:nil
|
||||||
sgml-shorttag:t
|
sgml-shorttag:t
|
||||||
sgml-minimize-attributes:nil
|
sgml-minimize-attributes:nil
|
||||||
sgml-always-quote-attributes:t
|
sgml-always-quote-attributes:t
|
||||||
|
|
|
@ -32,41 +32,34 @@ CREATE FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceab
|
||||||
Inputs
|
Inputs
|
||||||
</title>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
<variablelist>
|
|
||||||
<varlistentry>
|
<variablelist>
|
||||||
<term>
|
<varlistentry>
|
||||||
<replaceable class="parameter">name</replaceable>
|
<term><replaceable class="parameter">name</replaceable></term>
|
||||||
</term>
|
<listitem>
|
||||||
<listitem>
|
<para>
|
||||||
<para>
|
The name of a function to create.
|
||||||
The name of a function to create.
|
</para>
|
||||||
</para>
|
</listitem>
|
||||||
</listitem>
|
</varlistentry>
|
||||||
</varlistentry>
|
<varlistentry>
|
||||||
<varlistentry>
|
<term><replaceable class="parameter">ftype</replaceable></term>
|
||||||
<term>
|
<listitem>
|
||||||
<replaceable class="parameter">ftype</replaceable>
|
<para>
|
||||||
</term>
|
The data type of function arguments.
|
||||||
<listitem>
|
</para>
|
||||||
<para>
|
</listitem>
|
||||||
The data type of function arguments.
|
</varlistentry>
|
||||||
</para>
|
<varlistentry>
|
||||||
</listitem>
|
<term><replaceable class="parameter">rtype</replaceable></term>
|
||||||
</varlistentry>
|
<listitem>
|
||||||
<varlistentry>
|
<para>
|
||||||
<term>
|
The return data type.
|
||||||
<replaceable class="parameter">rtype</replaceable>
|
</para>
|
||||||
</term>
|
</listitem>
|
||||||
<listitem>
|
</varlistentry>
|
||||||
<para>
|
<varlistentry>
|
||||||
The return data type.
|
<term><replaceable class="parameter">definition</replaceable></term>
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
<replaceable class="parameter">definition</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
A string defining the function; the meaning depends on the language.
|
A string defining the function; the meaning depends on the language.
|
||||||
|
@ -76,9 +69,7 @@ CREATE FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceab
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><replaceable class="parameter">langname</replaceable></term>
|
||||||
<replaceable class="parameter">langname</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
may be '<literal>C</literal>', '<literal>sql</literal>',
|
may be '<literal>C</literal>', '<literal>sql</literal>',
|
||||||
|
@ -93,7 +84,7 @@ CREATE FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceab
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
|
|
||||||
<refsect2 id="R2-SQL-CREATEFUNCTION-2">
|
<refsect2 id="R2-SQL-CREATEFUNCTION-2">
|
||||||
<refsect2info>
|
<refsect2info>
|
||||||
<date>1998-09-09</date>
|
<date>1998-09-09</date>
|
||||||
|
@ -102,12 +93,12 @@ CREATE FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceab
|
||||||
Outputs
|
Outputs
|
||||||
</title>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><computeroutput>
|
||||||
<returnvalue>CREATE</returnvalue>
|
CREATE
|
||||||
</term>
|
</computeroutput></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
This is returned if the command completes successfully.
|
This is returned if the command completes successfully.
|
||||||
|
@ -118,7 +109,7 @@ CREATE FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceab
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
<refsect1 id="R1-SQL-CREATEFUNCTION-1">
|
<refsect1 id="R1-SQL-CREATEFUNCTION-1">
|
||||||
<refsect1info>
|
<refsect1info>
|
||||||
<date>1998-09-09</date>
|
<date>1998-09-09</date>
|
||||||
|
@ -188,20 +179,21 @@ in the <citetitle>PostgreSQL Programmer's Guide</citetitle>
|
||||||
</title>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
To create a simple SQL function:
|
To create a simple SQL function:
|
||||||
</para>
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
CREATE FUNCTION one() RETURNS int4
|
CREATE FUNCTION one() RETURNS int4
|
||||||
AS 'SELECT 1 AS RESULT'
|
AS 'SELECT 1 AS RESULT'
|
||||||
LANGUAGE 'sql';
|
LANGUAGE 'sql';
|
||||||
|
SELECT one() AS answer;
|
||||||
SELECT one() AS answer;
|
|
||||||
|
|
||||||
<computeroutput>
|
<computeroutput>
|
||||||
answer
|
answer
|
||||||
------
|
------
|
||||||
1
|
1
|
||||||
</computeroutput>
|
</computeroutput>
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
To create a C function, calling a routine from a user-created
|
To create a C function, calling a routine from a user-created
|
||||||
shared library. This particular routine calculates a check
|
shared library. This particular routine calculates a check
|
||||||
|
@ -210,16 +202,16 @@ in the <citetitle>PostgreSQL Programmer's Guide</citetitle>
|
||||||
</para>
|
</para>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
<userinput>
|
<userinput>
|
||||||
CREATE FUNCTION ean_checkdigit(bpchar, bpchar) RETURNS bool
|
CREATE FUNCTION ean_checkdigit(bpchar, bpchar) RETURNS bool
|
||||||
AS '/usr1/proj/bray/sql/funcs.so' LANGUAGE 'c';
|
AS '/usr1/proj/bray/sql/funcs.so' LANGUAGE 'c';
|
||||||
|
|
||||||
CREATE TABLE product (
|
CREATE TABLE product (
|
||||||
id char(8) PRIMARY KEY,
|
id char(8) PRIMARY KEY,
|
||||||
eanprefix char(8) CHECK (eanprefix ~ '[0-9]{2}-[0-9]{5}')
|
eanprefix char(8) CHECK (eanprefix ~ '[0-9]{2}-[0-9]{5}')
|
||||||
REFERENCES brandname(ean_prefix),
|
REFERENCES brandname(ean_prefix),
|
||||||
eancode char(6) CHECK (eancode ~ '[0-9]{6}'),
|
eancode char(6) CHECK (eancode ~ '[0-9]{6}'),
|
||||||
CONSTRAINT ean CHECK (ean_checkdigit(eanprefix, eancode))
|
CONSTRAINT ean CHECK (ean_checkdigit(eanprefix, eancode))
|
||||||
);
|
);
|
||||||
</userinput>
|
</userinput>
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
@ -232,16 +224,16 @@ in the <citetitle>PostgreSQL Programmer's Guide</citetitle>
|
||||||
A C function cannot return a set of values.
|
A C function cannot return a set of values.
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1 id="R1-SQL-CREATEFUNCTION-4">
|
<refsect1 id="R1-SQL-CREATEFUNCTION-4">
|
||||||
<title>
|
<title>
|
||||||
Compatibility
|
Compatibility
|
||||||
</title>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
<command>CREATE FUNCTION</command> is
|
<command>CREATE FUNCTION</command> is
|
||||||
a <productname>Postgres</productname> language extension.
|
a <productname>Postgres</productname> language extension.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<refsect2 id="R2-SQL-CREATEFUNCTION-4">
|
<refsect2 id="R2-SQL-CREATEFUNCTION-4">
|
||||||
<refsect2info>
|
<refsect2info>
|
||||||
<date>1998-09-09</date>
|
<date>1998-09-09</date>
|
||||||
|
@ -251,27 +243,26 @@ in the <citetitle>PostgreSQL Programmer's Guide</citetitle>
|
||||||
</title>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
|
|
||||||
<note>
|
<note>
|
||||||
<para>
|
<para>
|
||||||
PSM stands for Persistent Stored Modules. It is a procedural
|
PSM stands for Persistent Stored Modules. It is a procedural
|
||||||
language and it was originally hoped that PSM would be ratified
|
language and it was originally hoped that PSM would be ratified
|
||||||
as an official standard by late 1996. As of mid-1998, this
|
as an official standard by late 1996. As of mid-1998, this
|
||||||
has not yet happened, but it is hoped that PSM will
|
has not yet happened, but it is hoped that PSM will
|
||||||
eventually become a standard.
|
eventually become a standard.
|
||||||
</para>
|
</para>
|
||||||
</note>
|
</note>
|
||||||
|
|
||||||
SQL/PSM <command>CREATE FUNCTION</command> has the following syntax:
|
SQL/PSM <command>CREATE FUNCTION</command> has the following syntax:
|
||||||
<synopsis>
|
<synopsis>
|
||||||
CREATE FUNCTION <replaceable class="parameter">name</replaceable>
|
CREATE FUNCTION <replaceable class="parameter">name</replaceable>
|
||||||
( [ [ IN | OUT | INOUT ] <replaceable class="parameter">eter</replaceable>eable> <replaceable
|
( [ [ IN | OUT | INOUT ] <replaceable class="parameter">eter</replaceable>eable>eable> <replaceable
|
||||||
class="parameter">type</replaceable> [, ...] ] )
|
class="parameter">type</replaceable> [, ...] ] )
|
||||||
RETURNS <replaceable class="parameter">rtype</replaceable>
|
RETURNS <replaceable class="parameter">rtype</replaceable>
|
||||||
LANGUAGE '<replaceable class="parameter">langname</replaceable>'
|
LANGUAGE '<replaceable class="parameter">langname</replaceable>'
|
||||||
ESPECIFIC <replaceable class="parameter">routine</replaceable>
|
ESPECIFIC <replaceable class="parameter">routine</replaceable>
|
||||||
<replaceable class="parameter">SQL-statement</replaceable>
|
<replaceable class="parameter">SQL-statement</replaceable>
|
||||||
</synopsis>
|
</synopsis>
|
||||||
|
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
|
@ -1,133 +1,124 @@
|
||||||
<REFENTRY ID="SQL-CREATEINDEX">
|
<refentry id="SQL-CREATEINDEX">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
CREATE INDEX
|
CREATE INDEX
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
CREATE INDEX
|
CREATE INDEX
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Constructs a secondary index
|
Constructs a secondary index
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-09-09</DATE>
|
<date>1998-09-09</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
CREATE [ UNIQUE ] INDEX <replaceable class="parameter">index_name</replaceable>
|
CREATE [ UNIQUE ] INDEX <replaceable class="parameter">index_name</replaceable>
|
||||||
ON <replaceable class="parameter">table</replaceable> [ USING <replaceable class="parameter">acc_name</replaceable> ]
|
ON <replaceable class="parameter">table</replaceable> [ USING <replaceable class="parameter">acc_name</replaceable> ]
|
||||||
( <replaceable class="parameter">column</replaceable> [ <replaceable class="parameter">ops_name</replaceable>] [, ...] )
|
( <replaceable class="parameter">column</replaceable> [ <replaceable class="parameter">ops_name</replaceable>] [, ...] )
|
||||||
CREATE [ UNIQUE ] INDEX <replaceable class="parameter">index_name</replaceable>
|
CREATE [ UNIQUE ] INDEX <replaceable class="parameter">index_name</replaceable>
|
||||||
ON <replaceable class="parameter">table</replaceable> [ USING <replaceable class="parameter">acc_name</replaceable> ]
|
ON <replaceable class="parameter">table</replaceable> [ USING <replaceable class="parameter">acc_name</replaceable> ]
|
||||||
( <replaceable class="parameter">func_name</replaceable>( <replaceable class="parameter">column</replaceable> [, ... ]) <replaceable class="parameter">ops_name</replaceable> )
|
( <replaceable class="parameter">func_name</replaceable>( <replaceable class="parameter">r">col</replaceable>le> [, ... ]) <replaceable class="parameter">ops_name</replaceable> )
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATEINDEX-1">
|
<refsect2 id="R2-SQL-CREATEINDEX-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-09</DATE>
|
<date>1998-09-09</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
<variablelist>
|
||||||
<TERM>
|
<varlistentry>
|
||||||
UNIQUE
|
<term>UNIQUE</term>
|
||||||
</TERM>
|
<listitem>
|
||||||
<LISTITEM>
|
<para>
|
||||||
<PARA>
|
Causes the system to check for
|
||||||
Causes the system to check for
|
duplicate values in the table when the index is created (if data
|
||||||
duplicate values in the table when the index is created (if data
|
already exist) and each time data is added. Attempts to
|
||||||
already exist) and each time data is added. Attempts to
|
insert or update non-duplicate data will generate an
|
||||||
insert or update non-duplicate data will generate an
|
error.
|
||||||
error.
|
</para>
|
||||||
</PARA>
|
</listitem>
|
||||||
</LISTITEM>
|
</varlistentry>
|
||||||
</VARLISTENTRY>
|
<varlistentry>
|
||||||
<VARLISTENTRY>
|
<term><replaceable class="parameter">index_name</replaceable></term>
|
||||||
<TERM>
|
<listitem>
|
||||||
<replaceable class="parameter">index_name</replaceable>
|
<para>
|
||||||
</TERM>
|
The name of the index to be created.
|
||||||
<LISTITEM>
|
</para>
|
||||||
<PARA>
|
</listitem>
|
||||||
The name of the index to be created.
|
</varlistentry>
|
||||||
</PARA>
|
<varlistentry>
|
||||||
</LISTITEM>
|
<term><replaceable class="parameter">table</replaceable></term>
|
||||||
</VARLISTENTRY>
|
<listitem>
|
||||||
<VARLISTENTRY>
|
<para>
|
||||||
<TERM>
|
The name of the table to be indexed.
|
||||||
<replaceable class="parameter">table</replaceable>
|
</para>
|
||||||
</TERM>
|
</listitem>
|
||||||
<LISTITEM>
|
</varlistentry>
|
||||||
<PARA>
|
<varlistentry>
|
||||||
The name of the table to be indexed.
|
<term><replaceable class="parameter">acc_name</replaceable></term>
|
||||||
</PARA>
|
<listitem>
|
||||||
</LISTITEM>
|
<para>
|
||||||
</VARLISTENTRY>
|
the name of the access method which is to be used for
|
||||||
<VARLISTENTRY>
|
the index. The default access method is BTREE.
|
||||||
<TERM>
|
Postgres provides three access methods for secondary indexes:
|
||||||
<replaceable class="parameter">acc_name</replaceable>
|
<variablelist>
|
||||||
</TERM>
|
<varlistentry>
|
||||||
<LISTITEM>
|
<term>BTREE</term>
|
||||||
<PARA>
|
<listitem>
|
||||||
the name of the access method which is to be used for
|
<para>
|
||||||
the index. The default access method is BTREE.
|
an implementation of the Lehman-Yao
|
||||||
Postgres provides three access methods for secondary indexes:
|
high-concurrency btrees.
|
||||||
<variablelist>
|
</para>
|
||||||
<varlistentry>
|
</listitem>
|
||||||
<term>BTREE</term>
|
</varlistentry>
|
||||||
<listitem>
|
<varlistentry>
|
||||||
<para>
|
<term>RTREE</term>
|
||||||
an implementation of the Lehman-Yao
|
<listitem>
|
||||||
high-concurrency btrees.
|
<para>implements standard rtrees using Guttman's
|
||||||
</para>
|
quadratic split algorithm.
|
||||||
</listitem>
|
</para>
|
||||||
</varlistentry>
|
</listitem>
|
||||||
<varlistentry>
|
</varlistentry>
|
||||||
<term>RTREE</term>
|
<varlistentry>
|
||||||
<listitem>
|
<term>HASH</term>
|
||||||
<para>implements standard rtrees using Guttman's
|
<listitem>
|
||||||
quadratic split algorithm.
|
<para>
|
||||||
</para>
|
an implementation of Litwin's linear hashing.
|
||||||
</listitem>
|
</para>
|
||||||
</varlistentry>
|
</listitem>
|
||||||
<varlistentry>
|
</varlistentry>
|
||||||
<term>HASH</term>
|
</variablelist>
|
||||||
<listitem>
|
|
||||||
<para>
|
</para>
|
||||||
an implementation of Litwin's linear hashing.
|
</listitem>
|
||||||
</para>
|
</varlistentry>
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
<varlistentry>
|
||||||
</variablelist>
|
<term><replaceable class="parameter">column</replaceable></term>
|
||||||
</PARA>
|
<listitem>
|
||||||
</LISTITEM>
|
<para>
|
||||||
</VARLISTENTRY>
|
The name of a column of the table.
|
||||||
<VARLISTENTRY>
|
</para>
|
||||||
<TERM>
|
</listitem>
|
||||||
<replaceable class="parameter">column</replaceable>
|
</varlistentry>
|
||||||
</TERM>
|
<varlistentry>
|
||||||
<LISTITEM>
|
<term><replaceable class="parameter">ops_name</replaceable></term>
|
||||||
<PARA>
|
<listitem>
|
||||||
The name of a column of the table.
|
<para>
|
||||||
</PARA>
|
An associated operator class.
|
||||||
</LISTITEM>
|
The following select list returns all ops_names:
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
<programlisting>
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">ops_name</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
An associated operator class.
|
|
||||||
The following select list returns all ops_names:
|
|
||||||
|
|
||||||
<programlisting>
|
|
||||||
SELECT am.amname AS acc_name,
|
SELECT am.amname AS acc_name,
|
||||||
opc.opcname AS ops_name,
|
opc.opcname AS ops_name,
|
||||||
opr.oprname AS ops_comp
|
opr.oprname AS ops_comp
|
||||||
|
@ -137,75 +128,72 @@ SELECT am.amname AS acc_name,
|
||||||
amop.amopclaid = opc.oid AND
|
amop.amopclaid = opc.oid AND
|
||||||
amop.amopopr = opr.oid
|
amop.amopopr = opr.oid
|
||||||
ORDER BY acc_name, ops_name, ops_comp
|
ORDER BY acc_name, ops_name, ops_comp
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
</para>
|
||||||
</PARA>
|
</listitem>
|
||||||
</LISTITEM>
|
</varlistentry>
|
||||||
</VARLISTENTRY>
|
<varlistentry>
|
||||||
<VARLISTENTRY>
|
<term><replaceable class="parameter">func_name</replaceable></term>
|
||||||
<TERM>
|
<listitem>
|
||||||
<replaceable class="parameter">func_name</replaceable>
|
<para>
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
A user-defined function, which returns a value that can
|
A user-defined function, which returns a value that can
|
||||||
be indexed.
|
be indexed.
|
||||||
</PARA>
|
</para>
|
||||||
</LISTITEM>
|
</listitem>
|
||||||
</VARLISTENTRY>
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATEINDEX-2">
|
<refsect2 id="R2-SQL-CREATEINDEX-2">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-09</DATE>
|
<date>1998-09-09</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Outputs
|
Outputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
|
|
||||||
<VARIABLELIST>
|
<variablelist>
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term><computeroutput>
|
||||||
<ReturnValue>CREATE</ReturnValue>
|
CREATE
|
||||||
</TERM>
|
</computeroutput></term>
|
||||||
<LISTITEM>
|
<listitem>
|
||||||
<PARA>
|
<para>
|
||||||
The message returned if the index is successfully created.
|
The message returned if the index is successfully created.
|
||||||
</PARA>
|
</para>
|
||||||
</LISTITEM>
|
</listitem>
|
||||||
</VARLISTENTRY>
|
</varlistentry>
|
||||||
|
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term><computeroutput>
|
||||||
<ReturnValue>ERROR: Cannot create index: 'index_name' already exists.</ReturnValue>
|
ERROR: Cannot create index: 'index_name' already exists.
|
||||||
</TERM>
|
</computeroutput></term>
|
||||||
<LISTITEM>
|
<listitem>
|
||||||
<PARA>
|
<para>
|
||||||
This error occurs if it is impossible to create the index.
|
This error occurs if it is impossible to create the index.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</REFSYNOPSISDIV>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-CREATEINDEX-1">
|
<refsect1 id="R1-SQL-CREATEINDEX-1">
|
||||||
<REFSECT1INFO>
|
<refsect1info>
|
||||||
<DATE>1998-09-09</DATE>
|
<date>1998-09-09</date>
|
||||||
</REFSECT1INFO>
|
</refsect1info>
|
||||||
<TITLE>
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<command>CREATE INDEX</command> constructs an index
|
<command>CREATE INDEX</command> constructs an index
|
||||||
<replaceable class="parameter">index_name</replaceable>.
|
<replaceable class="parameter">index_name</replaceable>.
|
||||||
on the specified
|
on the specified
|
||||||
<replaceable class="parameter">table</replaceable>.
|
<replaceable class="parameter">table</replaceable>.
|
||||||
|
|
||||||
<tip>
|
<tip>
|
||||||
<para>
|
<para>
|
||||||
Indexes are primarily used to enhance database performance.
|
Indexes are primarily used to enhance database performance.
|
||||||
|
@ -225,45 +213,45 @@ SELECT am.amname AS acc_name,
|
||||||
operator class is the appropriate operator class for that
|
operator class is the appropriate operator class for that
|
||||||
field type.
|
field type.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
In the second syntax, an index is defined
|
In the second syntax, an index is defined
|
||||||
on the result of a user-defined function
|
on the result of a user-defined function
|
||||||
<replaceable class="parameter">func_name</replaceable> applied
|
<replaceable class="parameter">func_name</replaceable> applied
|
||||||
to one or more attributes of a single class. These functional
|
to one or more attributes of a single class. These functional
|
||||||
indexes can be used to obtain fast access to data
|
indexes can be used to obtain fast access to data
|
||||||
based on operators that would normally require some
|
based on operators that would normally require some
|
||||||
transformation to apply them to the base data.
|
transformation to apply them to the base data.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATEINDEX-3">
|
<refsect2 id="R2-SQL-CREATEINDEX-3">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-09</DATE>
|
<date>1998-09-09</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Notes
|
Notes
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
Currently, only the BTREE access method supports multi-column
|
Currently, only the BTREE access method supports multi-column
|
||||||
indexes. Up to 7 keys may be specified.
|
indexes. Up to 7 keys may be specified.
|
||||||
</PARA>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
Use <command>DROP INDEX</command>
|
Use <command>DROP INDEX</command>
|
||||||
to remove an index.
|
to remove an index.
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-CREATEINDEX-2">
|
<refsect1 id="R1-SQL-CREATEINDEX-2">
|
||||||
<TITLE>
|
<title>
|
||||||
Usage
|
Usage
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>To create a btree index on the field <literal>title</literal>
|
<para>To create a btree index on the field <literal>title</literal>
|
||||||
in the table <literal>films</literal>:
|
in the table <literal>films</literal>:
|
||||||
</PARA>
|
</para>
|
||||||
<ProgramListing>
|
<programlisting>
|
||||||
CREATE UNIQUE INDEX title_idx
|
CREATE UNIQUE INDEX title_idx
|
||||||
ON films (title);
|
ON films (title);
|
||||||
</ProgramListing>
|
</programlisting>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
<comment>
|
<comment>
|
||||||
|
@ -282,37 +270,36 @@ SELECT * FROM points
|
||||||
</programlisting>
|
</programlisting>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
</REFSECT1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-CREATEINDEX-3">
|
<refsect1 id="R1-SQL-CREATEINDEX-3">
|
||||||
<TITLE>
|
<title>
|
||||||
Compatibility
|
Compatibility
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATEINDEX-4">
|
<refsect2 id="R2-SQL-CREATEINDEX-4">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-09</DATE>
|
<date>1998-09-09</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
SQL92
|
SQL92
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
CREATE INDEX is a <productname>Postgres</productname> language extension.
|
CREATE INDEX is a <productname>Postgres</productname> language extension.
|
||||||
</PARA>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
There is no <command>CREATE INDEX</command> command in SQL92.
|
There is no <command>CREATE INDEX</command> command in SQL92.
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
</refentry>
|
||||||
|
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
mode: sgml
|
mode: sgml
|
||||||
sgml-omittag:t
|
sgml-omittag:nil
|
||||||
sgml-shorttag:t
|
sgml-shorttag:t
|
||||||
sgml-minimize-attributes:nil
|
sgml-minimize-attributes:nil
|
||||||
sgml-always-quote-attributes:t
|
sgml-always-quote-attributes:t
|
||||||
|
|
|
@ -1,87 +1,80 @@
|
||||||
<REFENTRY ID="SQL-CREATELANGUAGE">
|
<refentry id="SQL-CREATELANGUAGE">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
CREATE LANGUAGE
|
CREATE LANGUAGE
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
CREATE LANGUAGE
|
CREATE LANGUAGE
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Defines a new language for functions
|
Defines a new language for functions
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-09-09</DATE>
|
<date>1998-09-09</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
CREATE [ TRUSTED ] PROCEDURAL LANGUAGE '<replaceable class="parameter">langname</replaceable>'
|
CREATE [ TRUSTED ] PROCEDURAL LANGUAGE '<replaceable class="parameter">langname</replaceable>'
|
||||||
HANDLER <replaceable class="parameter">call_handler</replaceable>
|
HANDLER <replaceable class="parameter">call_handler</replaceable>
|
||||||
LANCOMPILER '<replaceable class="parameter">comment</replaceable>'
|
LANCOMPILER '<replaceable class="parameter">comment</replaceable>'
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATELANGUAGE-1">
|
<refsect2 id="R2-SQL-CREATELANGUAGE-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-09</DATE>
|
<date>1998-09-09</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
<variablelist>
|
||||||
<TERM>
|
<varlistentry>
|
||||||
<function>TRUSTED</function>
|
<term>TRUSTED</term>
|
||||||
</TERM>
|
<listitem>
|
||||||
<LISTITEM>
|
<para>
|
||||||
<PARA>
|
<function> TRUSTED</function> specifies that the call handler for
|
||||||
<function> TRUSTED</function> specifies that the call handler for
|
the language is safe; that is, it offers an unprivileged user
|
||||||
the language is safe; that is, it offers an unprivileged user
|
no functionality to bypass access restrictions. If
|
||||||
no functionality to bypass access restrictions. If
|
this keyword is omitted when registering the language,
|
||||||
this keyword is omitted when registering the language,
|
only users with the <productname>Postgres</productname>
|
||||||
only users with the <productname>Postgres</productname>
|
superuser privilege can use
|
||||||
superuser privilege can use
|
this language to create new functions
|
||||||
this language to create new functions
|
(like the 'C' language).
|
||||||
(like the 'C' language).
|
</para>
|
||||||
</PARA>
|
</listitem>
|
||||||
</LISTITEM>
|
</varlistentry>
|
||||||
</VARLISTENTRY>
|
|
||||||
|
<varlistentry>
|
||||||
<VARLISTENTRY>
|
<term><replaceable class="parameter">langname</replaceable></term>
|
||||||
<TERM>
|
<listitem>
|
||||||
<replaceable class="parameter">langname</replaceable>
|
<para>
|
||||||
</TERM>
|
The name of the new procedural language.
|
||||||
<LISTITEM>
|
The language name is case insensitive. A procedural
|
||||||
<PARA>
|
language cannot override one of the built-in languages of
|
||||||
The name of the new procedural language.
|
<productname>Postgres</productname>.
|
||||||
The language name is case insensitive. A procedural
|
</para>
|
||||||
language cannot override one of the built-in languages of
|
</listitem>
|
||||||
<productname>Postgres</productname>.
|
</varlistentry>
|
||||||
</PARA>
|
<varlistentry>
|
||||||
</LISTITEM>
|
<term>HANDLER <replaceable class="parameter">call_handler</replaceable></term>
|
||||||
</VARLISTENTRY>
|
<listitem>
|
||||||
<VARLISTENTRY>
|
<para>
|
||||||
<TERM>
|
<replaceable class="parameter">call_handler</replaceable> is the name
|
||||||
HANDLER <replaceable class="parameter">call_handler</replaceable>
|
of a previously
|
||||||
</TERM>
|
registered function that will be called to execute the PL
|
||||||
<LISTITEM>
|
procedures.
|
||||||
<PARA>
|
</para>
|
||||||
<replaceable class="parameter">call_handler</replaceable> is the name
|
</listitem>
|
||||||
of a previously
|
</varlistentry>
|
||||||
registered function that will be called to execute the PL
|
<varlistentry>
|
||||||
procedures.
|
<term><replaceable class="parameter">comment</replaceable></term>
|
||||||
</PARA>
|
<listitem>
|
||||||
</LISTITEM>
|
<para>
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">comment</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The <function>LANCOMPILER</function> argument is the
|
The <function>LANCOMPILER</function> argument is the
|
||||||
string that will be
|
string that will be
|
||||||
inserted in the <literal>LANCOMPILER</literal> attribute
|
inserted in the <literal>LANCOMPILER</literal> attribute
|
||||||
|
@ -89,81 +82,82 @@ superuser privilege can use
|
||||||
<filename>pg_language</filename> entry. At present,
|
<filename>pg_language</filename> entry. At present,
|
||||||
<productname>Postgres</productname> does not use
|
<productname>Postgres</productname> does not use
|
||||||
this attribute in any way.
|
this attribute in any way.
|
||||||
</PARA>
|
</para>
|
||||||
</LISTITEM>
|
</listitem>
|
||||||
</VARLISTENTRY>
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATELANGUAGE-2">
|
<refsect2 id="R2-SQL-CREATELANGUAGE-2">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-09</DATE>
|
<date>1998-09-09</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Outputs
|
Outputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
<variablelist>
|
||||||
<TERM>
|
<varlistentry>
|
||||||
<ReturnValue>CREATE</ReturnValue>
|
<term><computeroutput>
|
||||||
</TERM>
|
CREATE
|
||||||
<LISTITEM>
|
</computeroutput></term>
|
||||||
<PARA>
|
<listitem>
|
||||||
This message is returned if the language is successfully
|
<para>
|
||||||
created.
|
This message is returned if the language is successfully
|
||||||
</PARA>
|
created.
|
||||||
</LISTITEM>
|
</para>
|
||||||
</VARLISTENTRY>
|
</listitem>
|
||||||
<VARLISTENTRY>
|
</varlistentry>
|
||||||
<TERM>
|
<varlistentry>
|
||||||
<ReturnValue>ERROR: PL handler function <replaceable class="parameter">funcname</replaceable>() doesn't exist</ReturnValue>
|
<term><computeroutput>
|
||||||
</TERM>
|
ERROR: PL handler function <replaceable class="parameter">funcname</replaceable>() doesn't exist
|
||||||
<LISTITEM>
|
</computeroutput></term>
|
||||||
<PARA>
|
<listitem>
|
||||||
|
<para>
|
||||||
This error is returned if the function
|
This error is returned if the function
|
||||||
<replaceable class="parameter">funcname</replaceable>()
|
<replaceable class="parameter">funcname</replaceable>()
|
||||||
is not found.
|
is not found.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</VARIABLELIST>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</REFSYNOPSISDIV>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-CREATELANGUAGE-1">
|
<refsect1 id="R1-SQL-CREATELANGUAGE-1">
|
||||||
<REFSECT1INFO>
|
<refsect1info>
|
||||||
<DATE>1998-09-09</DATE>
|
<date>1998-09-09</date>
|
||||||
</REFSECT1INFO>
|
</refsect1info>
|
||||||
<TITLE>
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
Using <command>CREATE LANGUAGE</command>, a
|
Using <command>CREATE LANGUAGE</command>, a
|
||||||
<productname>Postgres</productname> user can register
|
<productname>Postgres</productname> user can register
|
||||||
a new language with <productname>Postgres</productname>.
|
a new language with <productname>Postgres</productname>.
|
||||||
Subsequently, functions and
|
Subsequently, functions and
|
||||||
trigger procedures can be defined in this new language.
|
trigger procedures can be defined in this new language.
|
||||||
The user must have the <productname>Postgres</productname>
|
The user must have the <productname>Postgres</productname>
|
||||||
superuser privilege to
|
superuser privilege to
|
||||||
register a new language.
|
register a new language.
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATELANGUAGE-3">
|
<refsect2 id="R2-SQL-CREATELANGUAGE-3">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-09</DATE>
|
<date>1998-09-09</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Writing PL handlers
|
Writing PL handlers
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
The call handler for a procedural language must be written
|
The call handler for a procedural language must be written
|
||||||
in a compiler language such as 'C' and registered with
|
in a compiler language such as 'C' and registered with
|
||||||
<productname>Postgres</productname> as a function taking
|
<productname>Postgres</productname> as a function taking
|
||||||
no arguments and returning the
|
no arguments and returning the
|
||||||
<type>opaque</type> type, a placeholder for unspecified or undefined types..
|
<type>opaque</type> type, a placeholder for unspecified or undefined types..
|
||||||
This prevents the call handler from being
|
This prevents the call handler from being
|
||||||
called directly as a function from queries.
|
called directly as a function from queries.
|
||||||
|
@ -196,7 +190,7 @@ Subsequently, functions and
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
</PARA>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
It's up to the call handler to fetch the
|
It's up to the call handler to fetch the
|
||||||
<filename>pg_proc</filename> entry and
|
<filename>pg_proc</filename> entry and
|
||||||
|
@ -213,14 +207,14 @@ Subsequently, functions and
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATELANGUAGE-4">
|
<refsect2 id="R2-SQL-CREATELANGUAGE-4">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-09</DATE>
|
<date>1998-09-09</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Notes
|
Notes
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
Use <command>CREATE FUNCTION</command>
|
Use <command>CREATE FUNCTION</command>
|
||||||
to create a function.
|
to create a function.
|
||||||
</para>
|
</para>
|
||||||
|
@ -230,8 +224,8 @@ Subsequently, functions and
|
||||||
<para>
|
<para>
|
||||||
Refer to the table <filename>pg_language</filename>
|
Refer to the table <filename>pg_language</filename>
|
||||||
for further information:
|
for further information:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
<computeroutput>
|
<computeroutput>
|
||||||
Table = pg_language
|
Table = pg_language
|
||||||
+--------------------------+--------------------------+-------+
|
+--------------------------+--------------------------+-------+
|
||||||
| Field | Type | Length|
|
| Field | Type | Length|
|
||||||
|
@ -246,130 +240,129 @@ internal|n/a
|
||||||
lisp |/usr/ucb/liszt
|
lisp |/usr/ucb/liszt
|
||||||
C |/bin/cc
|
C |/bin/cc
|
||||||
sql |postgres
|
sql |postgres
|
||||||
</computeroutput>
|
</computeroutput>
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-CREATELANGUAGE-4">
|
<refsect1 id="R1-SQL-CREATELANGUAGE-4">
|
||||||
<TITLE>
|
<title>
|
||||||
Restrictions
|
Restrictions
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
Since the call handler for a procedural language must be
|
Since the call handler for a procedural language must be
|
||||||
registered with <productname>Postgres</productname> in the 'C' language,
|
registered with <productname>Postgres</productname> in the 'C' language,
|
||||||
it inherits
|
it inherits
|
||||||
all the capabilities and restrictions of 'C' functions.
|
all the capabilities and restrictions of 'C' functions.
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
<REFSECT1 ID="R1-SQL-CREATELANGUAGE-5">
|
<refsect1 id="R1-SQL-CREATELANGUAGE-5">
|
||||||
<TITLE>
|
<title>
|
||||||
Bugs
|
Bugs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
At present, the definitions for a procedural language cannot be
|
At present, the definitions for a procedural language cannot be
|
||||||
changed once they have been created.
|
changed once they have been created.
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-CREATELANGUAGE-6">
|
<refsect1 id="R1-SQL-CREATELANGUAGE-6">
|
||||||
<TITLE>
|
<title>
|
||||||
Usage
|
Usage
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
This is a template for a PL handler written in 'C':
|
This is a template for a PL handler written in 'C':
|
||||||
</PARA>
|
<programlisting>
|
||||||
<ProgramListing>
|
#include "executor/spi.h"
|
||||||
#include "executor/spi.h"
|
#include "commands/trigger.h"
|
||||||
#include "commands/trigger.h"
|
#include "utils/elog.h"
|
||||||
#include "utils/elog.h"
|
#include "fmgr.h" /* for FmgrValues struct */
|
||||||
#include "fmgr.h" /* for FmgrValues struct */
|
#include "access/heapam.h"
|
||||||
#include "access/heapam.h"
|
#include "utils/syscache.h"
|
||||||
#include "utils/syscache.h"
|
#include "catalog/pg_proc.h"
|
||||||
#include "catalog/pg_proc.h"
|
#include "catalog/pg_type.h"
|
||||||
#include "catalog/pg_type.h"
|
|
||||||
|
|
||||||
Datum
|
|
||||||
plsample_call_handler(
|
|
||||||
Oid prooid,
|
|
||||||
int pronargs,
|
|
||||||
FmgrValues *proargs,
|
|
||||||
bool *isNull)
|
|
||||||
{
|
|
||||||
Datum retval;
|
|
||||||
TriggerData *trigdata;
|
|
||||||
|
|
||||||
if (CurrentTriggerData == NULL) {
|
Datum
|
||||||
/*
|
plsample_call_handler(
|
||||||
* Called as a function
|
Oid prooid,
|
||||||
*/
|
int pronargs,
|
||||||
|
FmgrValues *proargs,
|
||||||
|
bool *isNull)
|
||||||
|
{
|
||||||
|
Datum retval;
|
||||||
|
TriggerData *trigdata;
|
||||||
|
|
||||||
retval = ...
|
if (CurrentTriggerData == NULL) {
|
||||||
} else {
|
/*
|
||||||
/*
|
* Called as a function
|
||||||
* Called as a trigger procedure
|
*/
|
||||||
*/
|
|
||||||
trigdata = CurrentTriggerData;
|
|
||||||
CurrentTriggerData = NULL;
|
|
||||||
|
|
||||||
retval = ...
|
retval = ...
|
||||||
}
|
} else {
|
||||||
|
/*
|
||||||
|
* Called as a trigger procedure
|
||||||
|
*/
|
||||||
|
trigdata = CurrentTriggerData;
|
||||||
|
CurrentTriggerData = NULL;
|
||||||
|
|
||||||
|
retval = ...
|
||||||
|
}
|
||||||
|
|
||||||
|
*isNull = false;
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
|
||||||
*isNull = false;
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
</ProgramListing>
|
|
||||||
<para>
|
<para>
|
||||||
Only a few thousand lines of code have to be added instead
|
Only a few thousand lines of code have to be added instead
|
||||||
of the dots to complete the PL call handler.
|
of the dots to complete the PL call handler.
|
||||||
See <command>CREATE FUNCTION</command> for information on how to compile
|
See <command>CREATE FUNCTION</command> for information on how to compile
|
||||||
it into a loadable module
|
it into a loadable module.
|
||||||
.</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
The following commands then register the sample procedural
|
The following commands then register the sample procedural
|
||||||
language:
|
language:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
CREATE FUNCTION plsample_call_handler () RETURNS opaque
|
CREATE FUNCTION plsample_call_handler () RETURNS opaque
|
||||||
AS '/usr/local/pgsql/lib/plsample.so'
|
AS '/usr/local/pgsql/lib/plsample.so'
|
||||||
LANGUAGE 'C';
|
LANGUAGE 'C';
|
||||||
|
CREATE PROCEDURAL LANGUAGE 'plsample'
|
||||||
CREATE PROCEDURAL LANGUAGE 'plsample'
|
|
||||||
HANDLER plsample_call_handler
|
HANDLER plsample_call_handler
|
||||||
LANCOMPILER 'PL/Sample';
|
LANCOMPILER 'PL/Sample';
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-CREATELANGUAGE-7">
|
<refsect1 id="R1-SQL-CREATELANGUAGE-7">
|
||||||
<TITLE>
|
<title>
|
||||||
Compatibility
|
Compatibility
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
CREATE LANGUAGE is a <productname>Postgres</productname> extension.
|
CREATE LANGUAGE is a <productname>Postgres</productname> extension.
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATELANGUAGE-5">
|
<refsect2 id="R2-SQL-CREATELANGUAGE-5">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-09</DATE>
|
<date>1998-09-09</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
SQL92
|
SQL92
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
There is no <command>CREATE LANGUAGE</command> statement in
|
There is no <command>CREATE LANGUAGE</command> statement in
|
||||||
<acronym>SQL92</acronym>.
|
<acronym>SQL92</acronym>.
|
||||||
</PARA>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
</refentry>
|
||||||
|
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
mode: sgml
|
mode: sgml
|
||||||
sgml-omittag:t
|
sgml-omittag:nil
|
||||||
sgml-shorttag:t
|
sgml-shorttag:t
|
||||||
sgml-minimize-attributes:nil
|
sgml-minimize-attributes:nil
|
||||||
sgml-always-quote-attributes:t
|
sgml-always-quote-attributes:t
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
<REFENTRY ID="SQL-CREATEOPERATOR">
|
<refentry id="SQL-CREATEOPERATOR">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
CREATE OPERATOR
|
CREATE OPERATOR
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
CREATE OPERATOR
|
CREATE OPERATOR
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Defines a new user operator
|
Defines a new user operator
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1999-04-14</DATE>
|
<date>1999-04-14</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
CREATE OPERATOR <replaceable>name</replaceable> (
|
CREATE OPERATOR <replaceable>name</replaceable> (
|
||||||
PROCEDURE = <replaceable class="parameter">func_name</replaceable>
|
PROCEDURE = <replaceable class="parameter">func_name</replaceable>
|
||||||
[, LEFTARG = <replaceable class="parameter">type1</replaceable> ]
|
[, LEFTARG = <replaceable class="parameter">type1</replaceable> ]
|
||||||
|
@ -30,166 +30,144 @@ CREATE OPERATOR <replaceable>name</replaceable> (
|
||||||
[, SORT1 = <replaceable class="parameter">left_sort_op</replaceable> ]
|
[, SORT1 = <replaceable class="parameter">left_sort_op</replaceable> ]
|
||||||
[, SORT2 = <replaceable class="parameter">right_sort_op</replaceable> ]
|
[, SORT2 = <replaceable class="parameter">right_sort_op</replaceable> ]
|
||||||
)
|
)
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATEOPERATOR-1">
|
<refsect2 id="R2-SQL-CREATEOPERATOR-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1999-04-14</DATE>
|
<date>1999-04-14</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</PARA>
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">name</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The operator to be defined. See below for allowable characters.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">func_name</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The function used to implement this operator.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">type1</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The type for the left-hand side of the operator, if any. This option would be
|
|
||||||
omitted for a right-unary operator.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">type2</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The type for the right-hand side of the operator, if any. This option would be
|
|
||||||
omitted for a left-unary operator.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">com_op</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The commutator for this operator.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">neg_op</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The negator of this operator.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">res_proc</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The restriction selectivity estimator function for this operator.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">join_proc</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The join selectivity estimator function for this operator.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
HASHES
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Indicates this operator can support a hash-join algorithm.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">left_sort_op</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Operator that sorts the left-hand data type of this operator.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">right_sort_op</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Operator that sorts the right-hand data type of this operator.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
</variablelist>
|
|
||||||
|
|
||||||
</REFSECT2>
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
<REFSECT2 ID="R2-SQL-CREATEOPERATOR-2">
|
<term><replaceable class="parameter">name</replaceable></term>
|
||||||
<REFSECT2INFO>
|
<listitem>
|
||||||
<DATE>1999-04-14</DATE>
|
<para>
|
||||||
</REFSECT2INFO>
|
The operator to be defined. See below for allowable characters.
|
||||||
<TITLE>
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">func_name</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The function used to implement this operator.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">type1</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The type for the left-hand side of the operator, if any. This option would be
|
||||||
|
omitted for a right-unary operator.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">type2</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The type for the right-hand side of the operator, if any. This option would be
|
||||||
|
omitted for a left-unary operator.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">com_op</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The commutator for this operator.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">neg_op</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The negator of this operator.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">res_proc</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The restriction selectivity estimator function for this operator.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">join_proc</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The join selectivity estimator function for this operator.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term>HASHES</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Indicates this operator can support a hash-join algorithm.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">left_sort_op</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Operator that sorts the left-hand data type of this operator.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">right_sort_op</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Operator that sorts the right-hand data type of this operator.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
|
||||||
|
<refsect2 id="R2-SQL-CREATEOPERATOR-2">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1999-04-14</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
Outputs
|
Outputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<VARIABLELIST>
|
<variablelist>
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term><computeroutput>
|
||||||
<ReturnValue>CREATE</ReturnValue>
|
CREATE
|
||||||
</TERM>
|
</computeroutput></term>
|
||||||
<LISTITEM>
|
<listitem>
|
||||||
<PARA>
|
<para>
|
||||||
Message returned if the operator is successfully created.
|
Message returned if the operator is successfully created.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</VARIABLELIST>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</REFSYNOPSISDIV>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-CREATEOPERATOR-1">
|
<refsect1 id="R1-SQL-CREATEOPERATOR-1">
|
||||||
<REFSECT1INFO>
|
<refsect1info>
|
||||||
<DATE>1999-04-14</DATE>
|
<date>1999-04-14</date>
|
||||||
</REFSECT1INFO>
|
</refsect1info>
|
||||||
<TITLE>
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<command>CREATE OPERATOR</command> defines a new operator,
|
<command>CREATE OPERATOR</command> defines a new operator,
|
||||||
<replaceable class="parameter">name</replaceable>.
|
<replaceable class="parameter">name</replaceable>.
|
||||||
The user who defines an operator becomes its owner.
|
The user who defines an operator becomes its owner.
|
||||||
|
@ -199,7 +177,7 @@ Operator that sorts the right-hand data type of this operator.
|
||||||
is a sequence of up to thirty two (32) characters in any combination
|
is a sequence of up to thirty two (32) characters in any combination
|
||||||
from the following:
|
from the following:
|
||||||
<literallayout>
|
<literallayout>
|
||||||
+ - * / < > = ~ ! @ # % ^ & | ` ? $ :
|
+ - * / < > = ~ ! @ # % ^ & | ` ? $ :
|
||||||
</literallayout>
|
</literallayout>
|
||||||
<note>
|
<note>
|
||||||
<para>
|
<para>
|
||||||
|
@ -234,12 +212,16 @@ Operator that sorts the right-hand data type of this operator.
|
||||||
would probably have a commutator
|
would probably have a commutator
|
||||||
operator, area-greater-than, >>>.
|
operator, area-greater-than, >>>.
|
||||||
Hence, the query optimizer could freely convert:
|
Hence, the query optimizer could freely convert:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
"0,0,1,1"::box >>> MYBOXES.description
|
"0,0,1,1"::box >>> MYBOXES.description
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
to
|
to
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
MYBOXES.description <<< "0,0,1,1"::box</programlisting>
|
MYBOXES.description <<< "0,0,1,1"::box
|
||||||
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
This allows the execution code to always use the latter
|
This allows the execution code to always use the latter
|
||||||
|
@ -253,11 +235,11 @@ Operator that sorts the right-hand data type of this operator.
|
||||||
equal, !==.
|
equal, !==.
|
||||||
The negator link allows the query optimizer to simplify
|
The negator link allows the query optimizer to simplify
|
||||||
<programlisting>
|
<programlisting>
|
||||||
NOT MYBOXES.description === "0,0,1,1"::box
|
NOT MYBOXES.description === "0,0,1,1"::box
|
||||||
</programlisting>
|
</programlisting>
|
||||||
to
|
to
|
||||||
<programlisting>
|
<programlisting>
|
||||||
MYBOXES.description !== "0,0,1,1"::box
|
MYBOXES.description !== "0,0,1,1"::box
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
|
@ -318,7 +300,7 @@ Operator that sorts the right-hand data type of this operator.
|
||||||
the query optimizer can estimate result sizes. If a
|
the query optimizer can estimate result sizes. If a
|
||||||
clause of the form:
|
clause of the form:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
MYBOXES.description <<< "0,0,1,1"::box
|
MYBOXES.description <<< "0,0,1,1"::box
|
||||||
</programlisting>
|
</programlisting>
|
||||||
is present in the qualification,
|
is present in the qualification,
|
||||||
then <productname>Postgres</productname> may have to
|
then <productname>Postgres</productname> may have to
|
||||||
|
@ -326,7 +308,7 @@ Operator that sorts the right-hand data type of this operator.
|
||||||
satisfy the clause. The function
|
satisfy the clause. The function
|
||||||
<replaceable class="parameter">res_proc</replaceable>
|
<replaceable class="parameter">res_proc</replaceable>
|
||||||
must be a registered function (meaning it is already defined using
|
must be a registered function (meaning it is already defined using
|
||||||
CREATE FUNCTION) which accepts arguments of the correct
|
<command>CREATE FUNCTION</command>) which accepts arguments of the correct
|
||||||
data types and returns a floating point number. The
|
data types and returns a floating point number. The
|
||||||
query optimizer simply calls this function, passing the
|
query optimizer simply calls this function, passing the
|
||||||
parameter "0,0,1,1" and multiplies the result by the relation
|
parameter "0,0,1,1" and multiplies the result by the relation
|
||||||
|
@ -343,11 +325,11 @@ Operator that sorts the right-hand data type of this operator.
|
||||||
<para>
|
<para>
|
||||||
The difference between the function
|
The difference between the function
|
||||||
<programlisting>
|
<programlisting>
|
||||||
my_procedure_1 (MYBOXES.description, "0,0,1,1"::box)
|
my_procedure_1 (MYBOXES.description, "0,0,1,1"::box)
|
||||||
</programlisting>
|
</programlisting>
|
||||||
and the operator
|
and the operator
|
||||||
<programlisting>
|
<programlisting>
|
||||||
MYBOXES.description === "0,0,1,1"::box
|
MYBOXES.description === "0,0,1,1"::box
|
||||||
</programlisting>
|
</programlisting>
|
||||||
is that <productname>Postgres</productname>
|
is that <productname>Postgres</productname>
|
||||||
attempts to optimize operators and can
|
attempts to optimize operators and can
|
||||||
|
@ -356,34 +338,34 @@ Operator that sorts the right-hand data type of this operator.
|
||||||
optimize functions, and they are performed by brute force.
|
optimize functions, and they are performed by brute force.
|
||||||
Moreover, functions can have any number of arguments while
|
Moreover, functions can have any number of arguments while
|
||||||
operators are restricted to one or two.
|
operators are restricted to one or two.
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATEOPERATOR-3">
|
<refsect2 id="R2-SQL-CREATEOPERATOR-3">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1999-04-14</DATE>
|
<date>1999-04-14</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Notes
|
Notes
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
Refer to the chapter on operators in the
|
Refer to the chapter on operators in the
|
||||||
<citetitle>PostgreSQL User's Guide</citetitle>
|
<citetitle>PostgreSQL User's Guide</citetitle>
|
||||||
for further information.
|
for further information.
|
||||||
Refer to <command>DROP OPERATOR</command> to delete
|
Refer to <command>DROP OPERATOR</command> to delete
|
||||||
user-defined operators from a database.
|
user-defined operators from a database.
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-CREATEOPERATOR-2">
|
<refsect1 id="R1-SQL-CREATEOPERATOR-2">
|
||||||
<TITLE>
|
<title>
|
||||||
Usage
|
Usage
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>The following command defines a new operator,
|
<para>The following command defines a new operator,
|
||||||
area-equality, for the BOX data type.
|
area-equality, for the BOX data type.
|
||||||
</PARA>
|
</para>
|
||||||
<ProgramListing>
|
<programlisting>
|
||||||
CREATE OPERATOR === (
|
CREATE OPERATOR === (
|
||||||
LEFTARG = box,
|
LEFTARG = box,
|
||||||
RIGHTARG = box,
|
RIGHTARG = box,
|
||||||
PROCEDURE = area_equal_procedure,
|
PROCEDURE = area_equal_procedure,
|
||||||
|
@ -393,36 +375,37 @@ Operator that sorts the right-hand data type of this operator.
|
||||||
JOIN = area_join_procedure,
|
JOIN = area_join_procedure,
|
||||||
HASHES,
|
HASHES,
|
||||||
SORT1 = <<<,
|
SORT1 = <<<,
|
||||||
SORT2 = <<<)
|
SORT2 = <<<
|
||||||
</ProgramListing>
|
);
|
||||||
</REFSECT1>
|
</programlisting>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-CREATEOPERATOR-3">
|
<refsect1 id="R1-SQL-CREATEOPERATOR-3">
|
||||||
<TITLE>
|
<title>
|
||||||
Compatibility
|
Compatibility
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
CREATE OPERATOR is a <productname>Postgres</productname> extension.
|
CREATE OPERATOR is a <productname>Postgres</productname> extension.
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATEOPERATOR-4">
|
<refsect2 id="R2-SQL-CREATEOPERATOR-4">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1999-04-14</DATE>
|
<date>1999-04-14</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
SQL92
|
SQL92
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
There is no CREATE OPERATOR statement in <acronym>SQL92</acronym>.
|
There is no CREATE OPERATOR statement in <acronym>SQL92</acronym>.
|
||||||
</PARA>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
</refentry>
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
mode: sgml
|
mode: sgml
|
||||||
sgml-omittag:t
|
sgml-omittag:nil
|
||||||
sgml-shorttag:t
|
sgml-shorttag:t
|
||||||
sgml-minimize-attributes:nil
|
sgml-minimize-attributes:nil
|
||||||
sgml-always-quote-attributes:t
|
sgml-always-quote-attributes:t
|
||||||
|
|
|
@ -1,132 +1,123 @@
|
||||||
<REFENTRY ID="SQL-CREATERULE">
|
<refentry id="SQL-CREATERULE">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
CREATE RULE
|
CREATE RULE
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
CREATE RULE
|
CREATE RULE
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Defines a new rule
|
Defines a new rule
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-09-11</DATE>
|
<date>1998-09-11</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
CREATE RULE <replaceable class="parameter">name</replaceable>
|
CREATE RULE <replaceable class="parameter">name</replaceable> AS ON <replaceable class="parameter">event</replaceable>
|
||||||
AS ON <replaceable class="parameter">event</replaceable>
|
|
||||||
TO <replaceable class="parameter">object</replaceable> [ WHERE <replaceable class="parameter">condition</replaceable> ]
|
TO <replaceable class="parameter">object</replaceable> [ WHERE <replaceable class="parameter">condition</replaceable> ]
|
||||||
DO [ INSTEAD ] [ <replaceable class="parameter">action</replaceable> | NOTHING ]
|
DO [ INSTEAD ] [ <replaceable class="parameter">action</replaceable> | NOTHING ]
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATERULE-1">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-09-11</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Inputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
</PARA>
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">name</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The name of a rule to create.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">event</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Event is one of <literal>select</literal>,
|
|
||||||
<literal>update</literal>, <literal>delete</literal>
|
|
||||||
or <literal>insert</literal>.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">object</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Object is either <replaceable class="parameter">table</replaceable>
|
|
||||||
or <replaceable class="parameter">table</replaceable>.<replaceable class="parameter">column</replaceable>.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">condition</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Any SQL WHERE clause. <literal>new</literal> or
|
|
||||||
<literal>current</literal> can appear instead of an instance
|
|
||||||
variable whenever an instance variable is permissible in SQL.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">action</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Any SQL statement. <literal>new</literal> or
|
|
||||||
<literal>current</literal> can appear instead of an instance
|
|
||||||
variable whenever an instance variable is permissible in SQL.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
</VARIABLELIST>
|
|
||||||
|
|
||||||
</REFSECT2>
|
<refsect2 id="R2-SQL-CREATERULE-1">
|
||||||
|
<refsect2info>
|
||||||
<REFSECT2 ID="R2-SQL-CREATERULE-2">
|
<date>1998-09-11</date>
|
||||||
<REFSECT2INFO>
|
</refsect2info>
|
||||||
<DATE>1998-09-11</DATE>
|
<title>
|
||||||
</REFSECT2INFO>
|
Inputs
|
||||||
<TITLE>
|
</title>
|
||||||
Outputs
|
<para>
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
<variablelist>
|
||||||
<VARIABLELIST>
|
<varlistentry>
|
||||||
<VARLISTENTRY>
|
<term><replaceable class="parameter">name</replaceable></term>
|
||||||
<TERM>
|
<listitem>
|
||||||
<ReturnValue>CREATE</ReturnValue>
|
<para>
|
||||||
</TERM>
|
The name of a rule to create.
|
||||||
<LISTITEM>
|
</para>
|
||||||
<PARA>
|
|
||||||
Message returned if the rule is successfully created.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</VARLISTENTRY>
|
</varlistentry>
|
||||||
</VARIABLELIST>
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">event</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Event is one of <literal>select</literal>,
|
||||||
|
<literal>update</literal>, <literal>delete</literal>
|
||||||
|
or <literal>insert</literal>.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">object</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Object is either <replaceable class="parameter">table</replaceable>
|
||||||
|
or <replaceable class="parameter">table</replaceable>.<replaceable
|
||||||
|
class="parameter">column</replaceable>.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">condition</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Any SQL WHERE clause. <literal>new</literal> or
|
||||||
|
<literal>current</literal> can appear instead of an instance
|
||||||
|
variable whenever an instance variable is permissible in SQL.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">action</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Any SQL statement. <literal>new</literal> or
|
||||||
|
<literal>current</literal> can appear instead of an instance
|
||||||
|
variable whenever an instance variable is permissible in SQL.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</REFSYNOPSISDIV>
|
|
||||||
|
<refsect2 id="R2-SQL-CREATERULE-2">
|
||||||
<REFSECT1 ID="R1-SQL-CREATERULE-1">
|
<refsect2info>
|
||||||
<REFSECT1INFO>
|
<date>1998-09-11</date>
|
||||||
<DATE>1998-09-11</DATE>
|
</refsect2info>
|
||||||
</REFSECT1INFO>
|
<title>
|
||||||
<TITLE>
|
Outputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
CREATE
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Message returned if the rule is successfully created.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-CREATERULE-1">
|
||||||
|
<refsect1info>
|
||||||
|
<date>1998-09-11</date>
|
||||||
|
</refsect1info>
|
||||||
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
The semantics of a rule is that at the time an individual instance is
|
The semantics of a rule is that at the time an individual instance is
|
||||||
accessed, updated, inserted or deleted, there is a current instance (for
|
accessed, updated, inserted or deleted, there is a current instance (for
|
||||||
retrieves, updates and deletes) and a new instance (for updates and
|
retrieves, updates and deletes) and a new instance (for updates and
|
||||||
|
@ -146,13 +137,13 @@ CREATE RULE <replaceable class="parameter">name</replaceable>
|
||||||
command that caused activation.
|
command that caused activation.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATERULE-3">
|
<refsect2 id="R2-SQL-CREATERULE-3">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-11</DATE>
|
<date>1998-09-11</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Notes
|
Notes
|
||||||
</TITLE>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
A caution about SQL rules is in order. If the same class name
|
A caution about SQL rules is in order. If the same class name
|
||||||
or instance variable appears in the
|
or instance variable appears in the
|
||||||
|
@ -164,14 +155,17 @@ CREATE RULE <replaceable class="parameter">name</replaceable>
|
||||||
variables that are shared between these clauses. For example, the following
|
variables that are shared between these clauses. For example, the following
|
||||||
two rules have the same semantics:
|
two rules have the same semantics:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
on update to EMP.salary where EMP.name = "Joe"
|
ON UPDATE TO emp.salary WHERE emp.name = "Joe"
|
||||||
do update EMP ( ... ) where ...
|
DO UPDATE emp ( ... ) WHERE ...
|
||||||
|
|
||||||
on update to EMP-1.salary where EMP-2.name = "Joe"
|
|
||||||
do update EMP-3 ( ... ) where ...
|
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
|
<programlisting>
|
||||||
|
ON UPDATE TO emp-1.salary WHERE emp-2.name = "Joe"
|
||||||
|
DO UPDATE emp-3 ( ... ) WHERE ...
|
||||||
|
</programlisting>
|
||||||
|
|
||||||
Each rule can have the optional tag INSTEAD.
|
Each rule can have the optional tag INSTEAD.
|
||||||
Without
|
Without
|
||||||
this tag, <replaceable class="parameter">action</replaceable> will be
|
this tag, <replaceable class="parameter">action</replaceable> will be
|
||||||
performed in addition to the user command when the
|
performed in addition to the user command when the
|
||||||
<replaceable class="parameter">event</replaceable> in the
|
<replaceable class="parameter">event</replaceable> in the
|
||||||
|
@ -180,7 +174,7 @@ Without
|
||||||
<replaceable class="parameter">action</replaceable> part will be done
|
<replaceable class="parameter">action</replaceable> part will be done
|
||||||
instead of the user command. In this later case, the
|
instead of the user command. In this later case, the
|
||||||
<replaceable class="parameter">action</replaceable> can be the keyword
|
<replaceable class="parameter">action</replaceable> can be the keyword
|
||||||
NOTHING.
|
<literal>NOTHING</literal>.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
When choosing between the rewrite and instance rule systems for a
|
When choosing between the rewrite and instance rule systems for a
|
||||||
|
@ -192,25 +186,27 @@ Without
|
||||||
It is very important to note that the rewrite rule system
|
It is very important to note that the rewrite rule system
|
||||||
will neither detect nor process circular rules. For example, though each
|
will neither detect nor process circular rules. For example, though each
|
||||||
of the following two rule definitions are accepted by
|
of the following two rule definitions are accepted by
|
||||||
<productname>Postgres</productname>, the
|
<productname>Postgres</productname>, the
|
||||||
retrieve command will cause <productname>Postgres</productname> to crash:
|
retrieve command will cause <productname>Postgres</productname> to crash:
|
||||||
|
|
||||||
<example>
|
<example>
|
||||||
<title>Example of a circular rewrite rule combination.</title>
|
<title>Example of a circular rewrite rule combination.</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
create rule bad_rule_combination_1 as
|
CREATE RULE bad_rule_combination_1 AS
|
||||||
on select to EMP
|
ON SELECT TO emp
|
||||||
do instead select to TOYEMP
|
DO INSTEAD SELECT TO toyemp;
|
||||||
|
|
||||||
create rule bad_rule_combination_2 as
|
|
||||||
on select to TOYEMP
|
|
||||||
do instead select to EMP
|
|
||||||
</programlisting>
|
</programlisting>
|
||||||
<para>
|
|
||||||
|
<programlisting>
|
||||||
|
CREATE RULE bad_rule_combination_2 AS
|
||||||
|
ON SELECT TO toyemp
|
||||||
|
DO INSTEAD SELECT TO emp;
|
||||||
|
</programlisting>
|
||||||
|
<para>
|
||||||
This attempt to retrieve from EMP will cause
|
This attempt to retrieve from EMP will cause
|
||||||
<productname>Postgres</productname> to crash.
|
<productname>Postgres</productname> to crash.
|
||||||
<programlisting>
|
<programlisting>
|
||||||
select * from EMP
|
SELECT * FROM emp;
|
||||||
</programlisting></para>
|
</programlisting></para>
|
||||||
</example>
|
</example>
|
||||||
|
|
||||||
|
@ -219,25 +215,24 @@ select * from EMP
|
||||||
You must have rule definition access to a class in order
|
You must have rule definition access to a class in order
|
||||||
to define a rule on it. Use <command>GRANT</command>
|
to define a rule on it. Use <command>GRANT</command>
|
||||||
and <command>REVOKE</command> to change permissions.
|
and <command>REVOKE</command> to change permissions.
|
||||||
|
</para>
|
||||||
</PARA>
|
</refsect2>
|
||||||
</REFSECT2>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-CREATERULE-2">
|
<refsect1 id="R1-SQL-CREATERULE-2">
|
||||||
<TITLE>
|
<title>
|
||||||
Usage
|
Usage
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
Make Sam get the same salary adjustment as Joe:
|
Make Sam get the same salary adjustment as Joe:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
create rule example_1 as
|
CREATE RULE example_1 AS
|
||||||
on update EMP.salary where current.name = "Joe"
|
ON UPDATE emp.salary WHERE current.name = "Joe"
|
||||||
do update EMP (salary = new.salary)
|
DO UPDATE emp (salary = new.salary)
|
||||||
where EMP.name = "Sam"
|
WHERE emp.name = "Sam";
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
At the time Joe receives a salary adjustment, the event
|
At the time Joe receives a salary adjustment, the event
|
||||||
will become true and Joe's current instance and proposed
|
will become true and Joe's current instance and proposed
|
||||||
new instance are available to the execution routines.
|
new instance are available to the execution routines.
|
||||||
|
@ -248,12 +243,12 @@ create rule example_1 as
|
||||||
<para>
|
<para>
|
||||||
Make Bill get Joe's salary when it is accessed:
|
Make Bill get Joe's salary when it is accessed:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
create rule example_2 as
|
CREATE RULE example_2 AS
|
||||||
on select to EMP.salary
|
ON SELECT TO EMP.salary
|
||||||
where current.name = "Bill"
|
WHERE current.name = "Bill"
|
||||||
do instead
|
DO INSTEAD
|
||||||
select (EMP.salary) from EMP
|
SELECT (emp.salary) from emp
|
||||||
where EMP.name = "Joe"
|
WHERE emp.name = "Joe";
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
|
@ -261,40 +256,40 @@ create rule example_2 as
|
||||||
department (<function>current_user</function> returns the name of
|
department (<function>current_user</function> returns the name of
|
||||||
the current user):
|
the current user):
|
||||||
<programlisting>
|
<programlisting>
|
||||||
create rule example_3 as
|
CREATE RULE example_3 AS
|
||||||
on select to EMP.salary
|
ON SELECT TO emp.salary
|
||||||
where current.dept = "shoe" and current_user = "Joe"
|
WHERE current.dept = "shoe" AND current_user = "Joe"
|
||||||
do instead nothing
|
DO INSTEAD NOTHING;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
Create a view of the employees working in the toy department.
|
Create a view of the employees working in the toy department.
|
||||||
<programlisting>
|
<programlisting>
|
||||||
create TOYEMP(name = char16, salary = int4)
|
CREATE toyemp(name = char16, salary = int4);
|
||||||
|
|
||||||
create rule example_4 as
|
CREATE RULE example_4 AS
|
||||||
on select to TOYEMP
|
ON SELECT TO toyemp
|
||||||
do instead
|
DO INSTEAD
|
||||||
select (EMP.name, EMP.salary) from EMP
|
SELECT (emp.name, emp.salary) FROM emp
|
||||||
where EMP.dept = "toy"
|
WHERE emp.dept = "toy";
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
All new employees must make 5,000 or less
|
All new employees must make 5,000 or less
|
||||||
<programlisting>
|
<programlisting>
|
||||||
create rule example_5 as
|
CREATE RULE example_5 AS
|
||||||
on insert to EMP where new.salary > 5000
|
ON INERT TO emp WHERE new.salary > 5000
|
||||||
do update newset salary = 5000
|
DO UPDATE NEWSET salary = 5000;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</PARA>
|
</para>
|
||||||
</REFSECT1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-CREATERULE-3">
|
<refsect1 id="R1-SQL-CREATERULE-3">
|
||||||
<TITLE>
|
<title>
|
||||||
Bugs
|
Bugs
|
||||||
</TITLE>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
The object in a SQL rule cannot be an array reference and
|
The object in a <acronym>SQL</acronym> rule cannot be an array reference and
|
||||||
cannot have parameters.
|
cannot have parameters.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
|
@ -308,36 +303,36 @@ create rule example_5 as
|
||||||
text attributes. This implies that creation of rules may
|
text attributes. This implies that creation of rules may
|
||||||
fail if the rule plus its various internal representations
|
fail if the rule plus its various internal representations
|
||||||
exceed some value that is on the order of one page (8KB).
|
exceed some value that is on the order of one page (8KB).
|
||||||
</PARA>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-CREATERULE-4">
|
<refsect1 id="R1-SQL-CREATERULE-4">
|
||||||
<TITLE>
|
<title>
|
||||||
Compatibility
|
Compatibility
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
CREATE RULE statement is a <productname>Postgres</productname>
|
<command>CREATE RULE</command> statement is a <productname>Postgres</productname>
|
||||||
language extension.
|
language extension.
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATERULE-4">
|
<refsect2 id="R2-SQL-CREATERULE-4">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-11</DATE>
|
<date>1998-09-11</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
SQL92
|
SQL92
|
||||||
</TITLE>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
There is no CREATE RULE statement in <acronym>SQL92</acronym>.
|
There is no <command>CREATE RULE</command> statement in <acronym>SQL92</acronym>.
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
</refentry>
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
mode: sgml
|
mode: sgml
|
||||||
sgml-omittag:t
|
sgml-omittag:nil
|
||||||
sgml-shorttag:t
|
sgml-shorttag:t
|
||||||
sgml-minimize-attributes:nil
|
sgml-minimize-attributes:nil
|
||||||
sgml-always-quote-attributes:t
|
sgml-always-quote-attributes:t
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
<REFENTRY ID="SQL-CREATESEQUENCE">
|
<refentry id="SQL-CREATESEQUENCE">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
CREATE SEQUENCE
|
CREATE SEQUENCE
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
CREATE SEQUENCE
|
CREATE SEQUENCE
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Creates a new sequence number generator
|
Creates a new sequence number generator
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
CREATE SEQUENCE <replaceable class="parameter">seqname</replaceable>
|
CREATE SEQUENCE <replaceable class="parameter">seqname</replaceable>
|
||||||
[ INCREMENT <replaceable class="parameter">increment</replaceable> ]
|
[ INCREMENT <replaceable class="parameter">increment</replaceable> ]
|
||||||
[ MINVALUE <replaceable class="parameter">minvalue</replaceable> ]
|
[ MINVALUE <replaceable class="parameter">minvalue</replaceable> ]
|
||||||
|
@ -25,218 +25,207 @@ CREATE SEQUENCE <replaceable class="parameter">seqname</replaceable>
|
||||||
[ START <replaceable class="parameter">start</replaceable> ]
|
[ START <replaceable class="parameter">start</replaceable> ]
|
||||||
[ CACHE <replaceable class="parameter">cache</replaceable> ]
|
[ CACHE <replaceable class="parameter">cache</replaceable> ]
|
||||||
[ CYCLE ]
|
[ CYCLE ]
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATESEQUENCE-1">
|
<refsect2 id="R2-SQL-CREATESEQUENCE-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-11</DATE>
|
<date>1998-09-11</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</PARA>
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">seqname</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The name of a sequence to be created.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">increment</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The <option>INCREMENT <replaceable class="parameter">increment</replaceable></option> clause is optional. A positive value will make an
|
|
||||||
ascending sequence, a negative one a descending sequence.
|
|
||||||
The default value is one (1).
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">minvalue</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The optional clause <option>MINVALUE
|
|
||||||
<replaceable class="parameter">minvalue</replaceable></option>
|
|
||||||
determines the minimum value
|
|
||||||
a sequence can generate. The defaults are 1 and -2147483647 for
|
|
||||||
ascending and descending sequences, respectively.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">maxvalue</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Use the optional clause <option>MAXVALUE
|
|
||||||
<replaceable class="parameter">maxvalue</replaceable></option> to
|
|
||||||
determine the maximum
|
|
||||||
value for the sequence. The defaults are 2147483647 and -1 for
|
|
||||||
ascending and descending sequences, respectively.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">start</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The optional <option>START
|
|
||||||
<replaceable class="parameter">start</replaceable>
|
|
||||||
clause</option> enables the sequence to begin anywhere.
|
|
||||||
The default starting value is
|
|
||||||
<replaceable class="parameter">minvalue</replaceable>
|
|
||||||
for ascending sequences and
|
|
||||||
<replaceable class="parameter">maxvalue</replaceable>
|
|
||||||
for descending ones.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">cache</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The <option>CACHE <replaceable class="parameter">cache</replaceable></option> option
|
|
||||||
enables sequence numbers to be preallocated
|
|
||||||
and stored in memory for faster access. The minimum
|
|
||||||
value is 1 (only one value can be generated at a time, i.e. no cache)
|
|
||||||
and this is also the default.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
CYCLE
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The optional CYCLE keyword may be used to enable the sequence
|
|
||||||
to continue when the
|
|
||||||
<replaceable class="parameter">maxvalue</replaceable> or
|
|
||||||
<replaceable class="parameter">minvalue</replaceable> has been
|
|
||||||
reached by
|
|
||||||
an ascending or descending sequence respectively. If the limit is
|
|
||||||
reached, the next number generated will be whatever the
|
|
||||||
<replaceable class="parameter">minvalue</replaceable> or
|
|
||||||
<replaceable class="parameter">maxvalue</replaceable> is,
|
|
||||||
as appropriate.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
</variablelist>
|
|
||||||
</REFSECT2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATESEQUENCE-2">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-09-11</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Outputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
|
|
||||||
<VARIABLELIST>
|
<variablelist>
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term><replaceable class="parameter">seqname</replaceable></term>
|
||||||
<ReturnValue>CREATE</ReturnValue>
|
<listitem>
|
||||||
</TERM>
|
<para>
|
||||||
<LISTITEM>
|
The name of a sequence to be created.
|
||||||
<PARA>
|
|
||||||
Message returned if the command is successful.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>ERROR: amcreate: '<replaceable class="parameter">seqname</replaceable>' relation already exists</ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
If the sequence specified already exists.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>ERROR: DefineSequence: START value (<replaceable class="parameter">start</replaceable>) can't be > MAXVALUE (<replaceable class="parameter">maxvalue</replaceable>)</ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
If the specified starting value is out of range.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>ERROR: DefineSequence: START value (<replaceable class="parameter">start</replaceable>) can't be < MINVALUE (<replaceable class="parameter">minvalue</replaceable>)</ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
If the specified starting value is out of range.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>ERROR: DefineSequence: MINVALUE (<replaceable class="parameter">minvalue</replaceable>) can't be >= MAXVALUE (<replaceable class="parameter">maxvalue</replaceable>)</ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
If the minimum and maximum values are inconsistant.
|
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</VARIABLELIST>
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">increment</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The
|
||||||
|
<option>INCREMENT <replaceable class="parameter">increment</replaceable></option>
|
||||||
|
clause is optional. A positive value will make an
|
||||||
|
ascending sequence, a negative one a descending sequence.
|
||||||
|
The default value is one (1).
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">minvalue</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The optional clause <option>MINVALUE
|
||||||
|
<replaceable class="parameter">minvalue</replaceable></option>
|
||||||
|
determines the minimum value
|
||||||
|
a sequence can generate. The defaults are 1 and -2147483647 for
|
||||||
|
ascending and descending sequences, respectively.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">maxvalue</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Use the optional clause <option>MAXVALUE
|
||||||
|
<replaceable class="parameter">maxvalue</replaceable></option> to
|
||||||
|
determine the maximum
|
||||||
|
value for the sequence. The defaults are 2147483647 and -1 for
|
||||||
|
ascending and descending sequences, respectively.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">start</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The optional <option>START
|
||||||
|
<replaceable class="parameter">start</replaceable>
|
||||||
|
clause</option> enables the sequence to begin anywhere.
|
||||||
|
The default starting value is
|
||||||
|
<replaceable class="parameter">minvalue</replaceable>
|
||||||
|
for ascending sequences and
|
||||||
|
<replaceable class="parameter">maxvalue</replaceable>
|
||||||
|
for descending ones.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">cache</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The <option>CACHE <replaceable class="parameter">cache</replaceable></option> option
|
||||||
|
enables sequence numbers to be preallocated
|
||||||
|
and stored in memory for faster access. The minimum
|
||||||
|
value is 1 (only one value can be generated at a time, i.e. no cache)
|
||||||
|
and this is also the default.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term>CYCLE</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The optional CYCLE keyword may be used to enable the sequence
|
||||||
|
to continue when the
|
||||||
|
<replaceable class="parameter">maxvalue</replaceable> or
|
||||||
|
<replaceable class="parameter">minvalue</replaceable> has been
|
||||||
|
reached by
|
||||||
|
an ascending or descending sequence respectively. If the limit is
|
||||||
|
reached, the next number generated will be whatever the
|
||||||
|
<replaceable class="parameter">minvalue</replaceable> or
|
||||||
|
<replaceable class="parameter">maxvalue</replaceable> is,
|
||||||
|
as appropriate.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</REFSYNOPSISDIV>
|
|
||||||
|
<refsect2 id="R2-SQL-CREATESEQUENCE-2">
|
||||||
<REFSECT1 ID="R1-SQL-CREATESEQUENCE-1">
|
<refsect2info>
|
||||||
<REFSECT1INFO>
|
<date>1998-09-11</date>
|
||||||
<DATE>1998-09-11</DATE>
|
</refsect2info>
|
||||||
</REFSECT1INFO>
|
<title>
|
||||||
<TITLE>
|
Outputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
CREATE
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Message returned if the command is successful.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
ERROR: Relation '<replaceable class="parameter">seqname</replaceable>' already exists
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
If the sequence specified already exists.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
ERROR: DefineSequence: MINVALUE (<replaceable class="parameter">start</replaceable>) can't be >= MAXVALUE (<replaceable class="parameter">max</replaceable>)
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
If the specified starting value is out of range.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
ERROR: DefineSequence: START value (<replaceable class="parameter">start</replaceable>) can't be < MINVALUE (<replaceable class="parameter">min</replaceable>)
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
If the specified starting value is out of range.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
ERROR: DefineSequence: MINVALUE (<replaceable class="parameter">min</replaceable>) can't be >= MAXVALUE (<replaceable class="parameter">max</replaceable>)
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
If the minimum and maximum values are inconsistant.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-CREATESEQUENCE-1">
|
||||||
|
<refsect1info>
|
||||||
|
<date>1998-09-11</date>
|
||||||
|
</refsect1info>
|
||||||
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
CREATE SEQUENCE will enter a new sequence number generator
|
<command>CREATE SEQUENCE</command> will enter a new sequence number generator
|
||||||
into the current data base. This involves creating and initialising a
|
into the current data base. This involves creating and initialising a
|
||||||
new single-row
|
new single-row
|
||||||
table with the name <replaceable class="parameter">seqname</replaceable>.
|
table with the name <replaceable class="parameter">seqname</replaceable>.
|
||||||
The generator will be "owned" by the user issuing the command.
|
The generator will be "owned" by the user issuing the command.
|
||||||
</PARA>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
After a sequence is created, you may use the function
|
After a sequence is created, you may use the function
|
||||||
<function>nextval(<replaceable class="parameter">seqname</replaceable>)</function>
|
<function>nextval(<replaceable class="parameter">seqname</replaceable>)</function>
|
||||||
to get a new number from the sequence.
|
to get a new number from the sequence.
|
||||||
The function
|
The function
|
||||||
<function>currval('<replaceable class="parameter">seqname</replaceable>')</function>
|
<function>currval('<replaceable class="parameter">seqname</replaceable>')</function>
|
||||||
may be used to determine the number returned by the last call to
|
may be used to determine the number returned by the last call to
|
||||||
<function>nextval(<replaceable class="parameter">seqname</replaceable>)</function>
|
<function>nextval(<replaceable class="parameter">seqname</replaceable>)</function>
|
||||||
for the specified sequence in the current session.
|
for the specified sequence in the current session.
|
||||||
The function
|
The function
|
||||||
<function>setval('<replaceable class="parameter">seqname</replaceable>',
|
<function>setval('<replaceable class="parameter">seqname</replaceable>',
|
||||||
<replaceable class="parameter">newvalue</replaceable>)</function>
|
<replaceable class="parameter">newvalue</replaceable>)</function>
|
||||||
may be used to set the current value of the specified sequence.
|
may be used to set the current value of the specified sequence.
|
||||||
The next call to
|
The next call to
|
||||||
<function>nextval(<replaceable class="parameter">seqname</replaceable>)</function>
|
<function>nextval(<replaceable class="parameter">seqname</replaceable>)</function>
|
||||||
will return the given value plus the sequence increment.
|
will return the given value plus the sequence increment.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Use a query like
|
Use a query like
|
||||||
<programlisting>
|
<programlisting>
|
||||||
|
@ -256,7 +245,7 @@ SELECT last_value FROM sequence_name;
|
||||||
calls to a generator.
|
calls to a generator.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<caution>
|
<caution>
|
||||||
<para>
|
<para>
|
||||||
Unexpected results may be obtained if a cache setting greater than one
|
Unexpected results may be obtained if a cache setting greater than one
|
||||||
is used for a sequence object that will be used concurrently by multiple
|
is used for a sequence object that will be used concurrently by multiple
|
||||||
|
@ -279,35 +268,35 @@ SELECT last_value FROM sequence_name;
|
||||||
whether or not it has yet been returned by nextval.
|
whether or not it has yet been returned by nextval.
|
||||||
</para>
|
</para>
|
||||||
</caution>
|
</caution>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATESEQUENCE-3">
|
<refsect2 id="R2-SQL-CREATESEQUENCE-3">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-11</DATE>
|
<date>1998-09-11</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Notes
|
Notes
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
Refer to the DROP SEQUENCE statement to remove a sequence.
|
Refer to the <command>DROP SEQUENCE</command> statement to remove a sequence.
|
||||||
</PARA>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
Each backend uses its own cache to store allocated numbers.
|
Each backend uses its own cache to store allocated numbers.
|
||||||
Numbers that are cached but not used in the current session will be
|
Numbers that are cached but not used in the current session will be
|
||||||
lost, resulting in "holes" in the sequence.
|
lost, resulting in "holes" in the sequence.
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-CREATESEQUENCE-2">
|
<refsect1 id="R1-SQL-CREATESEQUENCE-2">
|
||||||
<TITLE>
|
<title>
|
||||||
Usage
|
Usage
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
Create an ascending sequence called <literal>serial</literal>, starting at 101:
|
Create an ascending sequence called <literal>serial</literal>, starting at 101:
|
||||||
</PARA>
|
</para>
|
||||||
<ProgramListing>
|
<programlisting>
|
||||||
CREATE SEQUENCE serial START 101;
|
CREATE SEQUENCE serial START 101;
|
||||||
</ProgramListing>
|
</programlisting>
|
||||||
<para>
|
<para>
|
||||||
Select the next number from this sequence
|
Select the next number from this sequence
|
||||||
<programlisting>
|
<programlisting>
|
||||||
|
@ -328,47 +317,45 @@ INSERT INTO distributors VALUES (NEXTVAL('serial'),'nothing');
|
||||||
<para>
|
<para>
|
||||||
Set the sequence value after a COPY FROM:
|
Set the sequence value after a COPY FROM:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
CREATE FUNCTION distributors_id_max() RETURNS INT4
|
CREATE FUNCTION distributors_id_max() RETURNS INT4
|
||||||
AS 'SELECT max(id) FROM distributors'
|
AS 'SELECT max(id) FROM distributors'
|
||||||
LANGUAGE 'sql';
|
LANGUAGE 'sql';
|
||||||
BEGIN;
|
BEGIN;
|
||||||
COPY distributors FROM 'input_file';
|
COPY distributors FROM 'input_file';
|
||||||
SELECT setval('serial', distributors_id_max());
|
SELECT setval('serial', distributors_id_max());
|
||||||
END;
|
END;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
|
</refsect1>
|
||||||
</REFSECT1>
|
|
||||||
|
<refsect1 id="R1-SQL-CREATESEQUENCE-3">
|
||||||
<REFSECT1 ID="R1-SQL-CREATESEQUENCE-3">
|
<title>
|
||||||
<TITLE>
|
|
||||||
Compatibility
|
Compatibility
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<command>CREATE SEQUENCE</command> is a <productname>Postgres</productname>
|
<command>CREATE SEQUENCE</command> is a <productname>Postgres</productname>
|
||||||
language extension.
|
language extension.
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATESEQUENCE-4">
|
<refsect2 id="R2-SQL-CREATESEQUENCE-4">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-11</DATE>
|
<date>1998-09-11</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
SQL92
|
SQL92
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
There is no <command>CREATE SEQUENCE</command> statement
|
There is no <command>CREATE SEQUENCE</command> statement
|
||||||
in <acronym>SQL92</acronym>.
|
in <acronym>SQL92</acronym>.
|
||||||
</PARA>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
</refentry>
|
||||||
|
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
mode: sgml
|
mode: sgml
|
||||||
sgml-omittag:t
|
sgml-omittag:nil
|
||||||
sgml-shorttag:t
|
sgml-shorttag:t
|
||||||
sgml-minimize-attributes:nil
|
sgml-minimize-attributes:nil
|
||||||
sgml-always-quote-attributes:t
|
sgml-always-quote-attributes:t
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -33,9 +33,7 @@ CREATE TABLE <replaceable>table</replaceable> [ (<replaceable>column</replaceabl
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><replaceable>table</replaceable></term>
|
||||||
<replaceable>table</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The name of a new table to be created.
|
The name of a new table to be created.
|
||||||
|
@ -44,25 +42,21 @@ CREATE TABLE <replaceable>table</replaceable> [ (<replaceable>column</replaceabl
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><replaceable>column</replaceable></term>
|
||||||
<replaceable>column</replaceable>
|
<listitem>
|
||||||
</term>
|
<para>
|
||||||
<listitem>
|
The name of a column. Multiple column names can be specified using
|
||||||
<para>
|
a comma-delimited list of column names.
|
||||||
The name of a column. Multiple column names can be specified using
|
</para>
|
||||||
a comma-delimited list of column names.
|
</listitem>
|
||||||
</para>
|
</varlistentry>
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
<varlistentry>
|
||||||
|
<term><replaceable>select_clause</replaceable></term>
|
||||||
<varlistentry>
|
<listitem>
|
||||||
<term>
|
<para>
|
||||||
<replaceable>select_clause</replaceable>
|
A valid query statement. Refer to SELECT for a description of the
|
||||||
</term>
|
allowed syntax.
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
A valid query statement. Refer to SELECT for a description of the
|
|
||||||
allowed syntax.
|
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -78,7 +72,8 @@ allowed syntax.
|
||||||
Outputs
|
Outputs
|
||||||
</title>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
Refer to CREATE TABLE and SELECT for a summary of possible output
|
Refer to <command>CREATE TABLE</command>
|
||||||
|
and <command>SELECT</command> for a summary of possible output
|
||||||
messages.
|
messages.
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
|
@ -91,10 +86,10 @@ allowed syntax.
|
||||||
<title>
|
<title>
|
||||||
Description
|
Description
|
||||||
</title>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
CREATE TABLE AS enables a table to be created from the contents of
|
<command>CREATE TABLE AS</command> enables a table to be created from the contents of
|
||||||
an existing table. It has functionality equivalent to SELECT TABLE INTO,
|
an existing table. It has functionality equivalent to <command>SELECT TABLE INTO</command>,
|
||||||
but with perhaps a more obvious syntax.
|
but with perhaps a more direct syntax.
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
|
|
@ -1,120 +1,113 @@
|
||||||
<REFENTRY ID="SQL-CREATETRIGGER">
|
<refentry id="SQL-CREATETRIGGER">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
CREATE TRIGGER
|
CREATE TRIGGER
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
CREATE TRIGGER
|
CREATE TRIGGER
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Creates a new trigger
|
Creates a new trigger
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-09-21</DATE>
|
<date>1998-09-21</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
CREATE TRIGGER <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE> { BEFORE | AFTER }
|
CREATE TRIGGER <replaceable class="PARAMETER">name</replaceable> { BEFORE | AFTER } { <replaceable class="PARAMETER">event</replaceable> [OR ...] }
|
||||||
{ <REPLACEABLE CLASS="PARAMETER">event</REPLACEABLE> [OR ...] }
|
ON <replaceable class="PARAMETER">table</replaceable> FOR EACH { ROW | STATEMENT }
|
||||||
ON <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> FOR EACH { ROW | STATEMENT }
|
EXECUTE PROCEDURE <replaceable class="PARAMETER">ER">func</replaceable>BLE> ( <replaceable class="PARAMETER">arguments</replaceable> )
|
||||||
EXECUTE PROCEDURE <REPLACEABLE CLASS="PARAMETER">funcname</REPLACEABLE> ( <REPLACEABLE CLASS="PARAMETER">arguments</REPLACEABLE> )
|
</synopsis>
|
||||||
</SYNOPSIS>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATETRIGGER-1">
|
<refsect2 id="R2-SQL-CREATETRIGGER-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-21</DATE>
|
<date>1998-09-21</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</PARA>
|
|
||||||
<VARIABLELIST>
|
<variablelist>
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term><replaceable class="parameter">name</replaceable></term>
|
||||||
<ReturnValue><replaceable class="parameter">name</replaceable></ReturnValue>
|
<listitem>
|
||||||
</TERM>
|
<para>
|
||||||
<LISTITEM>
|
The name of an existing trigger.
|
||||||
<PARA>
|
|
||||||
The name of an existing trigger.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue><replaceable class="parameter">table</replaceable></ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The name of a table.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue><replaceable class="parameter">event</replaceable></ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
One of INSERT, DELETE or UPDATE.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue><replaceable class="parameter">funcname</replaceable></ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
A user-supplied function.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
</variablelist>
|
|
||||||
</REFSECT2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATETRIGGER-2">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-09-21</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Outputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>CREATE</ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
This message is returned if the trigger is successfully created.
|
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</VARIABLELIST>
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">table</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The name of a table.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">event</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
One of INSERT, DELETE or UPDATE.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">funcname</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
A user-supplied function.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</REFSYNOPSISDIV>
|
|
||||||
|
<refsect2 id="R2-SQL-CREATETRIGGER-2">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-09-21</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
Outputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
CREATE
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
This message is returned if the trigger is successfully created.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-CREATETRIGGER-1">
|
<refsect1 id="R1-SQL-CREATETRIGGER-1">
|
||||||
<REFSECT1INFO>
|
<refsect1info>
|
||||||
<DATE>1998-09-21</DATE>
|
<date>1998-09-21</date>
|
||||||
</REFSECT1INFO>
|
</refsect1info>
|
||||||
<TITLE>
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<command>CREATE TRIGGER</command> will enter a new trigger into the current
|
<command>CREATE TRIGGER</command> will enter a new trigger into the current
|
||||||
data base. The trigger will be associated with the relation
|
data base. The trigger will be associated with the relation
|
||||||
<replaceable class="parameter">relname</replaceable> and will execute
|
<replaceable class="parameter">relname</replaceable> and will execute
|
||||||
the specified function <replaceable class="parameter">funcname</replaceable>.
|
the specified function <replaceable class="parameter">funcname</replaceable>.
|
||||||
</PARA>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
The trigger can be specified to fire either before the
|
The trigger can be specified to fire either before the
|
||||||
operation is attempted on a tuple (before constraints
|
operation is attempted on a tuple (before constraints
|
||||||
are checked and the INSERT, UPDATE or DELETE is attempted) or
|
are checked and the INSERT, UPDATE or DELETE is attempted) or
|
||||||
|
@ -125,102 +118,106 @@ CREATE TRIGGER <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE> { BEFORE | AFTE
|
||||||
being inserted (for INSERT and UPDATE operations only). If
|
being inserted (for INSERT and UPDATE operations only). If
|
||||||
the trigger fires after the event, all changes, including the
|
the trigger fires after the event, all changes, including the
|
||||||
last insertion, update, or deletion, are "visible" to the trigger.
|
last insertion, update, or deletion, are "visible" to the trigger.
|
||||||
</PARA>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
Refer to the chapters on SPI and Triggers in the
|
Refer to the chapters on SPI and Triggers in the
|
||||||
<citetitle>PostgreSQL Programmer's Guide</citetitle> for more
|
<citetitle>PostgreSQL Programmer's Guide</citetitle> for more
|
||||||
information.
|
information.
|
||||||
</PARA>
|
</para>
|
||||||
<REFSECT2 ID="R2-SQL-CREATETRIGGER-3">
|
<refsect2 id="R2-SQL-CREATETRIGGER-3">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-21</DATE>
|
<date>1998-09-21</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Notes
|
Notes
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<command>CREATE TRIGGER</command> is a <productname>Postgres</productname>
|
<command>CREATE TRIGGER</command> is a <productname>Postgres</productname>
|
||||||
language extension.
|
language extension.
|
||||||
</PARA>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
Only the relation owner may create a trigger on this relation.
|
Only the relation owner may create a trigger on this relation.
|
||||||
</PARA>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
As of the current release (v6.4), STATEMENT triggers are not implemented.
|
As of the current release (v6.4), STATEMENT triggers are not implemented.
|
||||||
</PARA>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
Refer to <command>DROP TRIGGER</command> for information on how to
|
Refer to <command>DROP TRIGGER</command> for information on how to
|
||||||
remove triggers.
|
remove triggers.
|
||||||
</PARA>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-CREATETRIGGER-2">
|
<refsect1 id="R1-SQL-CREATETRIGGER-2">
|
||||||
<TITLE>
|
<title>
|
||||||
Usage
|
Usage
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
Check if the specified distributor code exists in the distributors
|
Check if the specified distributor code exists in the distributors
|
||||||
table before appending or updating a row in the table films:
|
table before appending or updating a row in the table films:
|
||||||
</PARA>
|
|
||||||
<ProgramListing>
|
<programlisting>
|
||||||
CREATE TRIGGER if_dist_exists
|
CREATE TRIGGER if_dist_exists
|
||||||
BEFORE INSERT OR UPDATE ON films FOR EACH ROW
|
BEFORE INSERT OR UPDATE ON films FOR EACH ROW
|
||||||
EXECUTE PROCEDURE check_primary_key ('did', 'distributors', 'did');
|
EXECUTE PROCEDURE check_primary_key ('did', 'distributors', 'did');
|
||||||
</ProgramListing>
|
</programlisting>
|
||||||
<PARA>
|
</para>
|
||||||
|
<para>
|
||||||
Before cancelling a distributor or updating its code, remove every
|
Before cancelling a distributor or updating its code, remove every
|
||||||
reference to the table films:
|
reference to the table films:
|
||||||
</PARA>
|
<programlisting>
|
||||||
<ProgramListing>
|
CREATE TRIGGER if_film_exists
|
||||||
CREATE TRIGGER if_film_exists
|
BEFORE DELETE OR UPDATE ON distributors FOR EACH ROW
|
||||||
BEFORE DELETE OR UPDATE ON distributors FOR EACH ROW
|
EXECUTE PROCEDURE check_foreign_key (1, 'CASCADE', 'did', 'films', 'did');
|
||||||
EXECUTE PROCEDURE check_foreign_key (1, 'CASCADE', 'did', 'films', 'did');
|
</programlisting>
|
||||||
</ProgramListing>
|
</para>
|
||||||
</REFSECT1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-CREATETRIGGER-3">
|
<refsect1 id="R1-SQL-CREATETRIGGER-3">
|
||||||
<TITLE>
|
<title>
|
||||||
Compatibility
|
Compatibility
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATETRIGGER-4">
|
<refsect2 id="R2-SQL-CREATETRIGGER-4">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-21</DATE>
|
<date>1998-09-21</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
SQL92
|
SQL92
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
There is no <command>CREATE TRIGGER</command> in <acronym>SQL92</acronym>.
|
There is no <command>CREATE TRIGGER</command> in <acronym>SQL92</acronym>.
|
||||||
</PARA>
|
</para>
|
||||||
<PARA>
|
|
||||||
|
<para>
|
||||||
The second example above may also be done by using a FOREIGN KEY
|
The second example above may also be done by using a FOREIGN KEY
|
||||||
constraint as in:
|
constraint as in:
|
||||||
</PARA>
|
|
||||||
<ProgramListing>
|
<programlisting>
|
||||||
CREATE TABLE distributors (
|
CREATE TABLE distributors (
|
||||||
did DECIMAL(3),
|
did DECIMAL(3),
|
||||||
name VARCHAR(40),
|
name VARCHAR(40),
|
||||||
CONSTRAINT if_film_exists
|
CONSTRAINT if_film_exists
|
||||||
FOREIGN KEY(did) REFERENCES films
|
FOREIGN KEY(did) REFERENCES films
|
||||||
ON UPDATE CASCADE ON DELETE CASCADE
|
ON UPDATE CASCADE ON DELETE CASCADE
|
||||||
);
|
);
|
||||||
</ProgramListing>
|
</programlisting>
|
||||||
<PARA>
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
However, foreign keys are not yet implemented (as of version 6.4) in
|
However, foreign keys are not yet implemented (as of version 6.4) in
|
||||||
<productname>Postgres</productname>.
|
<productname>Postgres</productname>.
|
||||||
</PARA>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
</refentry>
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
mode: sgml
|
mode: sgml
|
||||||
sgml-omittag:t
|
sgml-omittag:nil
|
||||||
sgml-shorttag:t
|
sgml-shorttag:t
|
||||||
sgml-minimize-attributes:nil
|
sgml-minimize-attributes:nil
|
||||||
sgml-always-quote-attributes:t
|
sgml-always-quote-attributes:t
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
<REFENTRY ID="SQL-CREATETYPE">
|
<refentry id="SQL-CREATETYPE">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
CREATE TYPE
|
CREATE TYPE
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
CREATE TYPE
|
CREATE TYPE
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Defines a new base data type
|
Defines a new base data type
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-09-21</DATE>
|
<date>1998-09-21</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
CREATE TYPE <replaceable class="parameter">typename</replaceable> (
|
CREATE TYPE <replaceable class="parameter">typename</replaceable> (
|
||||||
INPUT = <replaceable class="parameter">input_function</replaceable>
|
INPUT = <replaceable class="parameter">input_function</replaceable>
|
||||||
, OUTPUT = <replaceable class="parameter">output_function</replaceable>
|
, OUTPUT = <replaceable class="parameter">output_function</replaceable>
|
||||||
|
@ -30,177 +30,158 @@ CREATE TYPE <replaceable class="parameter">typename</replaceable> (
|
||||||
[ , RECEIVE = <replaceable class="parameter">receive_function</replaceable> ]
|
[ , RECEIVE = <replaceable class="parameter">receive_function</replaceable> ]
|
||||||
[ , PASSEDBYVALUE ]
|
[ , PASSEDBYVALUE ]
|
||||||
)
|
)
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATETYPE-1">
|
<refsect2 id="R2-SQL-CREATETYPE-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-21</DATE>
|
<date>1998-09-21</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</PARA>
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">typename</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The name of a type to be created.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
INTERNALLENGTH <replaceable class="parameter">internallength</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
A literal value, which specifies the internal length of
|
|
||||||
the new type.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
EXTERNALLENGTH <replaceable class="parameter">externallength</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
A literal value, which specifies the external length of
|
|
||||||
the new type.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
INPUT <replaceable class="parameter">input_function</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The name of a function, created by CREATE FUNCTION, which
|
|
||||||
converts data from its external form to the type's
|
|
||||||
internal form.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
OUTPUT <replaceable class="parameter">output_function</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The name of a function, created by CREATE FUNCTION, which
|
|
||||||
converts data from its internal form to a form suitable
|
|
||||||
for display.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">element</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The type being created is an array; this specifies
|
|
||||||
the type of the array elements.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">delimiter</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The delimiter character for the array.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">default</replaceable
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The default text to be displayed to indicate "data
|
|
||||||
not present"
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">send_function</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The name of a function, created by CREATE FUNCTION, which
|
|
||||||
converts data of this type into a form suitable for
|
|
||||||
transmission to another machine.
|
|
||||||
<comment>Is this right?</comment>
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">receive_function</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The name of a function, created by CREATE FUNCTION, which
|
|
||||||
converts data of this type from a form suitable for
|
|
||||||
transmission from another machine to internal form.
|
|
||||||
<comment>Is this right?</comment>
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
</variablelist>
|
|
||||||
</REFSECT2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATETYPE-2">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-09-21</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Outputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
|
|
||||||
<VARIABLELIST>
|
<variablelist>
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term><replaceable class="parameter">typename</replaceable></term>
|
||||||
<ReturnValue>CREATE</ReturnValue>
|
<listitem>
|
||||||
</TERM>
|
<para>
|
||||||
<LISTITEM>
|
The name of a type to be created.
|
||||||
<PARA>
|
|
||||||
Message returned if the type is successfully created.
|
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</VARIABLELIST>
|
<varlistentry>
|
||||||
|
<term>INTERNALLENGTH <replaceable class="parameter">internallength</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
A literal value, which specifies the internal length of
|
||||||
|
the new type.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term>EXTERNALLENGTH <replaceable class="parameter">externallength</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
A literal value, which specifies the external length of
|
||||||
|
the new type.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term>INPUT <replaceable class="parameter">input_function</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The name of a function, created by CREATE FUNCTION, which
|
||||||
|
converts data from its external form to the type's
|
||||||
|
internal form.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term>OUTPUT <replaceable class="parameter">output_function</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The name of a function, created by CREATE FUNCTION, which
|
||||||
|
converts data from its internal form to a form suitable
|
||||||
|
for display.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">element</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The type being created is an array; this specifies
|
||||||
|
the type of the array elements.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">delimiter</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The delimiter character for the array.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">default</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The default text to be displayed to indicate "data
|
||||||
|
not present"
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">send_function</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The name of a function, created by CREATE FUNCTION, which
|
||||||
|
converts data of this type into a form suitable for
|
||||||
|
transmission to another machine.
|
||||||
|
<comment>Is this right?</comment>
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">receive_function</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The name of a function, created by CREATE FUNCTION, which
|
||||||
|
converts data of this type from a form suitable for
|
||||||
|
transmission from another machine to internal form.
|
||||||
|
<comment>Is this right?</comment>
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</REFSYNOPSISDIV>
|
|
||||||
|
<refsect2 id="R2-SQL-CREATETYPE-2">
|
||||||
<REFSECT1 ID="R1-SQL-CREATETYPE-1">
|
<refsect2info>
|
||||||
<REFSECT1INFO>
|
<date>1998-09-21</date>
|
||||||
<DATE>1998-09-21</DATE>
|
</refsect2info>
|
||||||
</REFSECT1INFO>
|
<title>
|
||||||
<TITLE>
|
Outputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
CREATE
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Message returned if the type is successfully created.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-CREATETYPE-1">
|
||||||
|
<refsect1info>
|
||||||
|
<date>1998-09-21</date>
|
||||||
|
</refsect1info>
|
||||||
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
CREATE TYPE allows the user to register a new user data
|
<command>CREATE TYPE</command> allows the user to register a new user data
|
||||||
type with Postgres for use in the current data base. The
|
type with Postgres for use in the current data base. The
|
||||||
user who defines a type becomes its owner.
|
user who defines a type becomes its owner.
|
||||||
<replaceable class="parameter">Typename</replaceable> is
|
<replaceable class="parameter">typename</replaceable> is
|
||||||
the name of the new type and must be unique within the
|
the name of the new type and must be unique within the
|
||||||
types defined for this database.
|
types defined for this database.
|
||||||
</para>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
CREATE TYPE requires the registration of two functions
|
<command>CREATE TYPE</command> requires the registration of two functions
|
||||||
(using create function) before defining the type. The
|
(using create function) before defining the type. The
|
||||||
representation of a new base type is determined by
|
representation of a new base type is determined by
|
||||||
<replaceable class="parameter">input_function</replaceable>, which
|
<replaceable class="parameter">input_function</replaceable>, which
|
||||||
|
@ -212,7 +193,7 @@ EXTERNALLENGTH <replaceable class="parameter">externallength</replaceable>
|
||||||
the input and output functions must be declared to take
|
the input and output functions must be declared to take
|
||||||
one or two arguments of type "<literal>opaque</literal>".
|
one or two arguments of type "<literal>opaque</literal>".
|
||||||
</para>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
New base data types can be fixed length, in which case
|
New base data types can be fixed length, in which case
|
||||||
<replaceable class="parameter">internallength</replaceable> is a
|
<replaceable class="parameter">internallength</replaceable> is a
|
||||||
positive integer, or variable length,
|
positive integer, or variable length,
|
||||||
|
@ -221,33 +202,33 @@ EXTERNALLENGTH <replaceable class="parameter">externallength</replaceable>
|
||||||
as the Postgres-supplied data type, "<literal>text</literal>".
|
as the Postgres-supplied data type, "<literal>text</literal>".
|
||||||
To indicate that a type is variable-length, set
|
To indicate that a type is variable-length, set
|
||||||
<replaceable class="parameter">internallength</replaceable>
|
<replaceable class="parameter">internallength</replaceable>
|
||||||
to VARIABLE.
|
to <option>VARIABLE</option>.
|
||||||
The external representation is similarly specified using the
|
The external representation is similarly specified using the
|
||||||
<replaceable class="parameter">externallength</replaceable>
|
<replaceable class="parameter">externallength</replaceable>
|
||||||
keyword.
|
keyword.
|
||||||
</para>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
To indicate that a type is an array and to indicate that a
|
To indicate that a type is an array and to indicate that a
|
||||||
type has array elements, indicate the type of the array
|
type has array elements, indicate the type of the array
|
||||||
element using the element keyword. For example, to define
|
element using the element keyword. For example, to define
|
||||||
an array of 4 byte integers ("int4"), specify
|
an array of 4 byte integers ("int4"), specify
|
||||||
<programlisting>ELEMENT = int4</programlisting>
|
<programlisting>ELEMENT = int4</programlisting>
|
||||||
</para>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
To indicate the delimiter to be used on arrays of this
|
To indicate the delimiter to be used on arrays of this
|
||||||
type, <replaceable class="parameter">delimiter</replaceable>
|
type, <replaceable class="parameter">delimiter</replaceable>
|
||||||
can be
|
can be
|
||||||
set to a specific character. The default delimiter is the comma
|
set to a specific character. The default delimiter is the comma
|
||||||
("<literal>,</literal>").
|
("<literal>,</literal>").
|
||||||
</para>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
A default value is optionally available in case a user
|
A default value is optionally available in case a user
|
||||||
wants some specific bit pattern to mean "data not present."
|
wants some specific bit pattern to mean "data not present."
|
||||||
Specify the default with the DEFAULT keyword.
|
Specify the default with the <literal>DEFAULT</literal> keyword.
|
||||||
<comment>How does the user specify that bit pattern and associate
|
<comment>How does the user specify that bit pattern and associate
|
||||||
it with the fact that the data is not present></comment>
|
it with the fact that the data is not present></comment>
|
||||||
</para>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
The optional functions
|
The optional functions
|
||||||
<replaceable class="parameter">send_function</replaceable> and
|
<replaceable class="parameter">send_function</replaceable> and
|
||||||
<replaceable class="parameter">receive_function</replaceable>
|
<replaceable class="parameter">receive_function</replaceable>
|
||||||
|
@ -265,25 +246,27 @@ it with the fact that the data is not present></comment>
|
||||||
characters do not have to be converted if passed from
|
characters do not have to be converted if passed from
|
||||||
a Sun-4 to a DECstation, but many other types do.
|
a Sun-4 to a DECstation, but many other types do.
|
||||||
</para>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
The optional flag, PASSEDBYVALUE, indicates that operators
|
The optional flag, <option>PASSEDBYVALUE</option>, indicates that operators
|
||||||
and functions which use this data type should be passed an
|
and functions which use this data type should be passed an
|
||||||
argument by value rather than by reference. Note that you
|
argument by value rather than by reference. Note that you
|
||||||
may not pass by value types whose internal representation is
|
may not pass by value types whose internal representation is
|
||||||
more than four bytes.
|
more than four bytes.
|
||||||
</para>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
For new base types, a user can define operators, functions
|
For new base types, a user can define operators, functions
|
||||||
and aggregates using the appropriate facilities described
|
and aggregates using the appropriate facilities described
|
||||||
in this section.
|
in this section.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<refsect2>
|
<refsect2>
|
||||||
<title>Array Types</title>
|
<title>Array Types</title>
|
||||||
<para>
|
<para>
|
||||||
Two generalized built-in functions, array_in and
|
Two generalized built-in functions, array_in and
|
||||||
array_out, exist for quick creation of variable-length
|
array_out, exist for quick creation of variable-length
|
||||||
array types. These functions operate on arrays of any
|
array types. These functions operate on arrays of any
|
||||||
existing Postgres type.</para>
|
existing Postgres type.
|
||||||
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
|
|
||||||
<refsect2>
|
<refsect2>
|
||||||
|
@ -306,33 +289,31 @@ it with the fact that the data is not present></comment>
|
||||||
type in a class definition:
|
type in a class definition:
|
||||||
</para>
|
</para>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
CREATE TYPE box (INTERNALLENGTH = 8,
|
CREATE TYPE box (INTERNALLENGTH = 8,
|
||||||
INPUT = my_procedure_1, OUTPUT = my_procedure_2)
|
INPUT = my_procedure_1, OUTPUT = my_procedure_2);
|
||||||
|
CREATE TABLE myboxes (id INT4, description box);
|
||||||
CREATE TABLE myboxes (id INT4, description box)
|
|
||||||
</programlisting>
|
</programlisting>
|
||||||
<para>
|
<para>
|
||||||
This command creates a variable length array type with
|
This command creates a variable length array type with
|
||||||
integer elements.
|
integer elements.
|
||||||
</para>
|
|
||||||
<programlisting>
|
|
||||||
CREATE TYPE int4array
|
|
||||||
(INPUT = array_in, OUTPUT = array_out,
|
|
||||||
INTERNALLENGTH = VARIABLE, ELEMENT = int4)
|
|
||||||
|
|
||||||
CREATE TABLE myarrays (id int4, numbers int4array)
|
<programlisting>
|
||||||
</programlisting>
|
CREATE TYPE int4array (INPUT = array_in, OUTPUT = array_out,
|
||||||
|
INTERNALLENGTH = VARIABLE, ELEMENT = int4);
|
||||||
|
CREATE TABLE myarrays (id int4, numbers int4array);
|
||||||
|
</programlisting>
|
||||||
|
</para>
|
||||||
<para>
|
<para>
|
||||||
This command creates a large object type and uses it in
|
This command creates a large object type and uses it in
|
||||||
a class definition.
|
a class definition:
|
||||||
</para>
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
CREATE TYPE bigobj
|
CREATE TYPE bigobj (INPUT = lo_filein, OUTPUT = lo_fileout,
|
||||||
(INPUT = lo_filein, OUTPUT = lo_fileout,
|
INTERNALLENGTH = VARIABLE);
|
||||||
INTERNALLENGTH = VARIABLE)
|
CREATE TABLE big_objs (id int4, obj bigobj);
|
||||||
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
|
||||||
CREATE TABLE big_objs (id int4, obj bigobj)
|
|
||||||
</programlisting>
|
|
||||||
<refsect2>
|
<refsect2>
|
||||||
<title>Restrictions</title>
|
<title>Restrictions</title>
|
||||||
<para>
|
<para>
|
||||||
|
@ -344,44 +325,43 @@ it with the fact that the data is not present></comment>
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATETYPE-3">
|
<refsect2 id="R2-SQL-CREATETYPE-3">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-21</DATE>
|
<date>1998-09-21</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Notes
|
Notes
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
Refer to <command>DROP TYPE</command> to remove an existing type.
|
Refer to <command>DROP TYPE</command> to remove an existing type.
|
||||||
</PARA>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
See also <command>CREATE FUNCTION</command>,
|
See also <command>CREATE FUNCTION</command>,
|
||||||
<command>CREATE OPERATOR</command> and the chapter on Large Objects
|
<command>CREATE OPERATOR</command> and the chapter on Large Objects
|
||||||
in the <citetitle>PostgreSQL Programmer's Guide</citetitle>.
|
in the <citetitle>PostgreSQL Programmer's Guide</citetitle>.
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-CREATETYPE-3">
|
<refsect1 id="R1-SQL-CREATETYPE-3">
|
||||||
<TITLE>
|
<title>
|
||||||
Compatibility
|
Compatibility
|
||||||
</TITLE>
|
</title>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATETYPE-4">
|
<refsect2 id="R2-SQL-CREATETYPE-4">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-21</DATE>
|
<date>1998-09-21</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
SQL3
|
SQL3
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<command>CREATE TYPE</command> is an <acronym>SQL3</acronym> statement.
|
<command>CREATE TYPE</command> is an <acronym>SQL3</acronym> statement.
|
||||||
</PARA>
|
</para>
|
||||||
|
</refsect2>
|
||||||
</REFSECT2>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
</refentry>
|
||||||
|
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
|
|
|
@ -36,9 +36,7 @@ CREATE USER<replaceable class="PARAMETER"> username</replaceable>
|
||||||
<para>
|
<para>
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><replaceable class="parameter">username</replaceable></term>
|
||||||
<returnvalue><replaceable class="parameter">username</replaceable></returnvalue>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The name of the user.
|
The name of the user.
|
||||||
|
@ -47,9 +45,7 @@ CREATE USER<replaceable class="PARAMETER"> username</replaceable>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><replaceable class="parameter">password</replaceable></term>
|
||||||
<returnvalue><replaceable class="parameter">password</replaceable></returnvalue>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The WITH PASSWORD clause sets the user's password within
|
The WITH PASSWORD clause sets the user's password within
|
||||||
|
@ -81,9 +77,8 @@ CREATE USER<replaceable class="PARAMETER"> username</replaceable>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>CREATEDB</term>
|
||||||
<returnvalue> CREATEDB/NOCREATEDB</returnvalue>
|
<term>NOCREATEDB</term>
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
These clauses define a user's ability to create databases.
|
These clauses define a user's ability to create databases.
|
||||||
|
@ -96,9 +91,8 @@ CREATE USER<replaceable class="PARAMETER"> username</replaceable>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>CREATEUSER</term>
|
||||||
<returnvalue>CREATEUSER/NOCREATEUSER</returnvalue>
|
<term>NOCREATEUSER</term>
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
These clauses determine whether a user will be permitted to
|
These clauses determine whether a user will be permitted to
|
||||||
|
@ -111,9 +105,7 @@ CREATE USER<replaceable class="PARAMETER"> username</replaceable>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><replaceable class="parameter">groupname</replaceable></term>
|
||||||
<returnvalue><replaceable class="parameter">groupname</replaceable></returnvalue>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
A name of a group into which to insert the user as a new member.
|
A name of a group into which to insert the user as a new member.
|
||||||
|
@ -122,9 +114,7 @@ CREATE USER<replaceable class="PARAMETER"> username</replaceable>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><replaceable class="parameter">abstime</replaceable></term>
|
||||||
<returnvalue><replaceable class="parameter">abstime</replaceable></returnvalue>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The VALID UNTIL clause sets an absolute time after which the
|
The VALID UNTIL clause sets an absolute time after which the
|
||||||
|
@ -155,34 +145,20 @@ CREATE USER<replaceable class="PARAMETER"> username</replaceable>
|
||||||
<para>
|
<para>
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><computeroutput>
|
||||||
<returnvalue>CREATE USER</returnvalue>
|
CREATE USER
|
||||||
</term>
|
</computeroutput></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Message returned if the command completes successfully.
|
Message returned if the command completes successfully.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
<returnvalue>ERROR: removeUser: user "<replaceable
|
|
||||||
class="parameter">username</replaceable>" does not exist</returnvalue>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
if "<replaceable class="parameter">username</replaceable>" not found.
|
|
||||||
</para>
|
|
||||||
<comment>I don't understand this and I don't know how to get
|
|
||||||
this error message.</comment>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
<refsect1 id="R1-SQL-CREATEUSER-1">
|
<refsect1 id="R1-SQL-CREATEUSER-1">
|
||||||
<refsect1info>
|
<refsect1info>
|
||||||
<date>1998-09-21</date>
|
<date>1998-09-21</date>
|
||||||
|
@ -192,23 +168,27 @@ CREATE USER<replaceable class="PARAMETER"> username</replaceable>
|
||||||
</title>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
CREATE USER will add a new user to an instance of
|
CREATE USER will add a new user to an instance of
|
||||||
<productname>Postgres</productname>.
|
<productname>Postgres</productname>.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
The new user will be given a <filename>usesysid</filename> of:
|
The new user will be given a <filename>usesysid</filename> of:
|
||||||
'<command>SELECT MAX(usesysid) + 1 FROM pg_shadow</command>'.
|
|
||||||
|
<programlisting>
|
||||||
|
SELECT MAX(usesysid) + 1 FROM pg_shadow;
|
||||||
|
</programlisting>
|
||||||
|
|
||||||
This means that
|
This means that
|
||||||
<productname>Postgres</productname> users' <filename>usesysid</filename>s will not
|
<productname>Postgres</productname> users' <filename>usesysid</filename>s will not
|
||||||
correspond to their operating
|
correspond to their operating
|
||||||
system(OS) user ids. The exception to this rule is
|
system(OS) user ids. The exception to this rule is
|
||||||
the '<literal>postgres</literal>' user, whose OS user id
|
the <literal>postgres</literal> superuser, whose OS user id
|
||||||
is used as the
|
is used as the
|
||||||
<filename>usesysid</filename> during the initdb process.
|
<filename>usesysid</filename> during the initdb process.
|
||||||
If you still want the
|
If you still want the
|
||||||
OS user id and the <filename>usesysid</filename> to match
|
OS user id and the <filename>usesysid</filename> to match
|
||||||
for any given user,
|
for any given user,
|
||||||
use the "createuser" script provided with the <productname>Postgres</productname>
|
use the <application>createuser</application> script provided with
|
||||||
distribution.
|
the <productname>Postgres</productname> distribution.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<refsect2 id="R2-SQL-CREATEUSER-3">
|
<refsect2 id="R2-SQL-CREATEUSER-3">
|
||||||
|
@ -219,11 +199,13 @@ CREATE USER<replaceable class="PARAMETER"> username</replaceable>
|
||||||
Notes
|
Notes
|
||||||
</title>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
CREATE USER statement is a <productname>Postgres</productname> language extension.
|
<command>CREATE USER</command> statement is a
|
||||||
|
<productname>Postgres</productname> language extension.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
Use DROP USER or ALTER USER statements to remove or modify a user
|
Use <command>DROP USER</command> or <command>ALTER USER</command>
|
||||||
account.</para>
|
statements to remove or modify a user account.
|
||||||
|
</para>
|
||||||
<para>
|
<para>
|
||||||
Refer to the <filename>pg_shadow</filename> table for further information.
|
Refer to the <filename>pg_shadow</filename> table for further information.
|
||||||
</para>
|
</para>
|
||||||
|
@ -251,31 +233,37 @@ CREATE USER<replaceable class="PARAMETER"> username</replaceable>
|
||||||
</title>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
Create a user with no password:
|
Create a user with no password:
|
||||||
|
|
||||||
|
<programlisting>
|
||||||
|
CREATE USER jonathan
|
||||||
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
<programlisting>
|
|
||||||
CREATE USER jonathan
|
|
||||||
</programlisting>
|
|
||||||
<para>
|
<para>
|
||||||
Create a user with a password:
|
Create a user with a password:
|
||||||
|
|
||||||
|
<programlisting>
|
||||||
|
CREATE USER davide WITH PASSWORD jw8s0F4
|
||||||
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
<programlisting>
|
|
||||||
CREATE USER davide WITH PASSWORD jw8s0F4
|
|
||||||
</programlisting>
|
|
||||||
<para>
|
<para>
|
||||||
Create a user with a password, whose account is valid until the end of 2001.
|
Create a user with a password, whose account is valid until the end of 2001.
|
||||||
Note that after one second has ticked in 2002, the account is not
|
Note that after one second has ticked in 2002, the account is not
|
||||||
valid:
|
valid:
|
||||||
|
|
||||||
|
<programlisting>
|
||||||
|
CREATE USER miriam WITH PASSWORD jw8s0F4 VALID UNTIL 'Jan 1 2002'
|
||||||
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
<programlisting>
|
|
||||||
CREATE USER miriam WITH PASSWORD jw8s0F4 VALID UNTIL 'Jan 1 2002'
|
|
||||||
</programlisting>
|
|
||||||
<para>
|
<para>
|
||||||
Create an account where the user can create databases:
|
Create an account where the user can create databases:
|
||||||
|
|
||||||
|
<programlisting>
|
||||||
|
CREATE USER manuel WITH PASSWORD jw8s0F4 CREATEDB
|
||||||
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
<programlisting>
|
|
||||||
CREATE USER manuel WITH PASSWORD jw8s0F4 CREATEDB
|
|
||||||
</programlisting>
|
|
||||||
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1 id="R1-SQL-CREATEUSER-3">
|
<refsect1 id="R1-SQL-CREATEUSER-3">
|
||||||
|
@ -293,7 +281,7 @@ CREATE USER<replaceable class="PARAMETER"> username</replaceable>
|
||||||
SQL92
|
SQL92
|
||||||
</title>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
There is no CREATE USER statement in SQL92.
|
There is no <command>CREATE USER</command> statement in SQL92.
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
|
@ -1,166 +1,160 @@
|
||||||
<REFENTRY ID="SQL-CREATEVIEW">
|
<refentry id="SQL-CREATEVIEW">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
CREATE VIEW
|
CREATE VIEW
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
CREATE VIEW
|
CREATE VIEW
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Constructs a virtual table
|
Constructs a virtual table
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-09-21</DATE>
|
<date>1998-09-21</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
CREATE VIEW <REPLACEABLE CLASS="PARAMETER">view</REPLACEABLE>
|
CREATE VIEW <replaceable class="PARAMETER">view</replaceable>
|
||||||
AS SELECT <REPLACEABLE CLASS="PARAMETER">query</REPLACEABLE>
|
AS SELECT <replaceable class="PARAMETER">query</replaceable>
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATEVIEW-1">
|
<refsect2 id="R2-SQL-CREATEVIEW-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-21</DATE>
|
<date>1998-09-21</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<VARIABLELIST>
|
<variablelist>
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term><replaceable class="parameter">view</replaceable></term>
|
||||||
<ReturnValue><replaceable class="parameter">view</replaceable></ReturnValue>
|
<listitem>
|
||||||
</TERM>
|
<para>
|
||||||
<LISTITEM>
|
The name of a view to be created.
|
||||||
<PARA>
|
|
||||||
The name of a view to be created.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue><replaceable class="parameter">query</replaceable></ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
An SQL query which will provide the columns and rows of the view.
|
|
||||||
</PARA>
|
|
||||||
<PARA>
|
|
||||||
Refer to the SELECT statement for more information
|
|
||||||
about valid arguments.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
</variablelist>
|
|
||||||
</para>
|
|
||||||
</REFSECT2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATEVIEW-2">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-09-21</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Outputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>CREATE</ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The message returned if the view is successfully created.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>
|
|
||||||
WARN amcreate: "<replaceable class="parameter">view</replaceable>" relation already exists
|
|
||||||
</ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
This error occurs if the view specified already exists in the database.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>NOTICE create: attribute named "<replaceable class="parameter">column</replaceable>" has an unknown type</ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The view will be created having a column with an unknown type
|
|
||||||
if you do not specify it. For example, the following command gives
|
|
||||||
an error:
|
|
||||||
<programlisting>
|
|
||||||
CREATE VIEW vista AS SELECT 'Hello World'
|
|
||||||
</programlisting>
|
|
||||||
whereas this command does not:
|
|
||||||
<programlisting>
|
|
||||||
CREATE VIEW vista AS SELECT 'Hello World'::text
|
|
||||||
</programlisting>
|
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</VARIABLELIST>
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">query</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
An SQL query which will provide the columns and rows of the view.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Refer to the SELECT statement for more information
|
||||||
|
about valid arguments.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</REFSYNOPSISDIV>
|
|
||||||
|
<refsect2 id="R2-SQL-CREATEVIEW-2">
|
||||||
<REFSECT1 ID="R1-SQL-CREATEVIEW-1">
|
<refsect2info>
|
||||||
<REFSECT1INFO>
|
<date>1998-09-21</date>
|
||||||
<DATE>1998-09-21</DATE>
|
</refsect2info>
|
||||||
</REFSECT1INFO>
|
<title>
|
||||||
<TITLE>
|
Outputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
CREATE
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The message returned if the view is successfully created.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
ERROR: Relation '<replaceable class="parameter">view</replaceable>' already exists
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
This error occurs if the view specified already exists in the database.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
NOTICE create: attribute named "<replaceable class="parameter">column</replaceable>" has an unknown type
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The view will be created having a column with an unknown type
|
||||||
|
if you do not specify it. For example, the following command gives
|
||||||
|
an error:
|
||||||
|
<programlisting>
|
||||||
|
CREATE VIEW vista AS SELECT 'Hello World'
|
||||||
|
</programlisting>
|
||||||
|
whereas this command does not:
|
||||||
|
<programlisting>
|
||||||
|
CREATE VIEW vista AS SELECT 'Hello World'::text
|
||||||
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-CREATEVIEW-1">
|
||||||
|
<refsect1info>
|
||||||
|
<date>1998-09-21</date>
|
||||||
|
</refsect1info>
|
||||||
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
CREATE VIEW will define a view of a table. This view is
|
<command>CREATE VIEW</command> will define a view of a table. This view is
|
||||||
not physically materialized. Specifically, a query
|
not physically materialized. Specifically, a query
|
||||||
rewrite retrieve rule is automatically generated
|
rewrite retrieve rule is automatically generated
|
||||||
to support retrieve operations on views.
|
to support retrieve operations on views.
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATEVIEW-3">
|
<refsect2 id="R2-SQL-CREATEVIEW-3">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-21</DATE>
|
<date>1998-09-21</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Notes
|
Notes
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
|
||||||
Use the DROP VIEW statement to drop views.
|
|
||||||
</PARA>
|
|
||||||
</refsect2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATEVIEW-4">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-09-21</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Bugs
|
|
||||||
</TITLE>
|
|
||||||
<para>
|
<para>
|
||||||
Currently, views are read only.
|
Use the <command>DROP VIEW</command> statement to drop views.
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
|
|
||||||
|
<refsect2 id="R2-SQL-CREATEVIEW-4">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-09-21</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
Bugs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
Currently, views are read only.
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-CREATEVIEW-2">
|
<refsect1 id="R1-SQL-CREATEVIEW-2">
|
||||||
<TITLE>
|
<title>
|
||||||
Usage
|
Usage
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
Create a view consisting of all Comedy films:
|
Create a view consisting of all Comedy films:
|
||||||
</PARA>
|
|
||||||
<ProgramListing>
|
<programlisting>
|
||||||
CREATE VIEW kinds AS
|
CREATE VIEW kinds AS
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM films
|
FROM films
|
||||||
|
@ -172,89 +166,77 @@ code |title |did| date_prod|kind |len
|
||||||
-----+-------------------------+---+----------+----------+------
|
-----+-------------------------+---+----------+----------+------
|
||||||
UA502|Bananas |105|1971-07-13|Comedy | 01:22
|
UA502|Bananas |105|1971-07-13|Comedy | 01:22
|
||||||
C_701|There's a Girl in my Soup|107|1970-06-11|Comedy | 01:36
|
C_701|There's a Girl in my Soup|107|1970-06-11|Comedy | 01:36
|
||||||
</ProgramListing>
|
</programlisting>
|
||||||
|
</para>
|
||||||
</REFSECT1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-CREATEVIEW-3">
|
<refsect1 id="R1-SQL-CREATEVIEW-3">
|
||||||
<TITLE>
|
<title>
|
||||||
Compatibility
|
Compatibility
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-CREATEVIEW-5">
|
<refsect2 id="R2-SQL-CREATEVIEW-5">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-21</DATE>
|
<date>1998-09-21</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
SQL92
|
SQL92
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
SQL92 specifies some additional capabilities for the CREATE VIEW statement:
|
SQL92 specifies some additional capabilities for the
|
||||||
</PARA>
|
<command>CREATE VIEW</command> statement:
|
||||||
|
</para>
|
||||||
<synopsis>
|
<synopsis>
|
||||||
CREATE VIEW <replaceable class="parameter">view</replaceable> [ <replaceable class="parameter">column</replaceable> [, ...] ]
|
CREATE VIEW <replaceable class="parameter">view</replaceable> [ <replaceable class="parameter">column</replaceable> [, ...] ]
|
||||||
AS SELECT <replaceable class="parameter">expression</replaceable> [AS <replaceable class="parameter">colname</replaceable>] [, ...]
|
AS SELECT <replaceable class="parameter">expression</replaceable> [ AS <replaceable class="parameter">colname</replaceable> ] [, ...]
|
||||||
FROM <replaceable class="parameter">table</replaceable>
|
FROM <replaceable class="parameter">table</replaceable> [ WHERE <replaceable class="parameter">condition</replaceable> ]
|
||||||
[ WHERE <replaceable class="parameter">condition</replaceable> ]
|
|
||||||
[ WITH [ CASCADE | LOCAL ] CHECK OPTION ]
|
[ WITH [ CASCADE | LOCAL ] CHECK OPTION ]
|
||||||
</synopsis>
|
</synopsis>
|
||||||
|
|
||||||
<VARIABLELIST>
|
<para>
|
||||||
<VARLISTENTRY>
|
The optional clauses for the full SQL92 command are:
|
||||||
<TERM>
|
|
||||||
</TERM>
|
<variablelist>
|
||||||
<LISTITEM>
|
<varlistentry>
|
||||||
<PARA>
|
<term>CHECK OPTION</term>
|
||||||
<VARIABLELIST>
|
<listitem>
|
||||||
<VARLISTENTRY>
|
<para>
|
||||||
<TERM>
|
This option is to do with updatable views.
|
||||||
CHECK OPTION
|
All INSERTs and UPDATEs on the view will be
|
||||||
</TERM>
|
checked to ensure data satisfy the view-defining
|
||||||
<LISTITEM>
|
condition. If they do not, the update will be rejected.
|
||||||
<PARA> This option is to do with updatable views.
|
</para>
|
||||||
All INSERTs and UPDATEs on the view will be
|
</listitem>
|
||||||
checked to ensure data satisfy the view-defining
|
</varlistentry>
|
||||||
condition. If they do not, the update will be rejected.
|
<varlistentry>
|
||||||
</PARA>
|
<term>LOCAL</term>
|
||||||
</LISTITEM>
|
<listitem>
|
||||||
</VARLISTENTRY>
|
<para>
|
||||||
<VARLISTENTRY>
|
Check for integrity on this view.
|
||||||
<TERM>
|
</para>
|
||||||
LOCAL
|
</listitem>
|
||||||
</TERM>
|
</varlistentry>
|
||||||
<LISTITEM>
|
<varlistentry>
|
||||||
<PARA>
|
<term>CASCADE</term>
|
||||||
Check for integrity on this view.
|
<listitem>
|
||||||
</PARA>
|
<para>
|
||||||
</LISTITEM>
|
Check for integrity on this view and on any dependent
|
||||||
</VARLISTENTRY>
|
view. CASCADE is assumed if neither CASCADE nor LOCAL is specified.
|
||||||
<VARLISTENTRY>
|
</para>
|
||||||
<TERM>
|
</listitem>
|
||||||
CASCADE
|
</varlistentry>
|
||||||
</TERM>
|
</variablelist>
|
||||||
<LISTITEM>
|
</para>
|
||||||
<PARA>
|
|
||||||
Check for integrity on this view and on any dependent
|
|
||||||
view. CASCADE is assumed if neither CASCADE nor LOCAL is specified.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
</variablelist>
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
</variablelist>
|
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
</refentry>
|
||||||
|
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
mode: sgml
|
mode: sgml
|
||||||
sgml-omittag:t
|
sgml-omittag:nil
|
||||||
sgml-shorttag:t
|
sgml-shorttag:t
|
||||||
sgml-minimize-attributes:nil
|
sgml-minimize-attributes:nil
|
||||||
sgml-always-quote-attributes:t
|
sgml-always-quote-attributes:t
|
||||||
|
|
|
@ -1,266 +1,274 @@
|
||||||
<REFENTRY ID="APP-CREATEDB">
|
<refentry id="APP-CREATEDB">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
<application>createdb</application>
|
<application>createdb</application>
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>Application</REFMISCINFO>
|
<refmiscinfo>Application</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
<application>createdb</application>
|
<application>createdb</application>
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Create a new <productname>Postgres</productname> database
|
Create a new <productname>Postgres</productname> database
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-10-02</DATE>
|
<date>1998-10-02</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
createdb [ <replaceable class="parameter">dbname</replaceable> ]
|
createdb [ <replaceable class="parameter">dbname</replaceable> ]
|
||||||
createdb [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
|
createdb [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
|
||||||
[ -D <replaceable class="parameter">datadir</replaceable> ]
|
[ -D <replaceable class="parameter">datadir</replaceable> ] [ -u ] [ <replaceable class="parameter">dbname</replaceable> ]
|
||||||
[ -u ] [ <replaceable class="parameter">dbname</replaceable> ]
|
</synopsis>
|
||||||
</SYNOPSIS>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-APP-CREATEDB-1">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-10-02</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Inputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
|
|
||||||
<variablelist>
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-h <replaceable class="parameter">host</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Specifies the hostname of the machine on which the
|
|
||||||
<application>postmaster</application>
|
|
||||||
is running. Defaults to using a local Unix domain socket
|
|
||||||
rather than an IP connection..
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-p <replaceable class="parameter">port</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Specifies the Internet TCP/IP port or local Unix domain socket file
|
|
||||||
extension on which the <application>postmaster</application>
|
|
||||||
is listening for connections. The port number defaults to 5432,
|
|
||||||
or the value of the <envar>PGPORT</envar>
|
|
||||||
environment variable (if set).
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-u
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Use password authentication.
|
|
||||||
Prompts for
|
|
||||||
<replaceable class="parameter">username</replaceable>
|
|
||||||
and <replaceable class="parameter">password</replaceable>.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-D <replaceable class="parameter">datadir</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Specifies the alternate database location for this database installation.
|
|
||||||
This is the location of the installation system tables, not the location
|
|
||||||
of this specific database, which may be different.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
<replaceable class="parameter">dbname</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Specifies the name of the database to be created. The name must be
|
|
||||||
unique among all <productname>Postgres</productname> databases in this installation.
|
|
||||||
<replaceable class="parameter">dbname</replaceable>
|
|
||||||
defaults to the value of the
|
|
||||||
<envar>USER</envar>
|
|
||||||
environment variable.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
</variablelist>
|
|
||||||
</para>
|
|
||||||
</refsect2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-APP-CREATEDB-2">
|
<refsect2 id="R2-APP-CREATEDB-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-10-02</DATE>
|
<date>1998-10-02</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Outputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<application>createdb</application> will create files in the
|
|
||||||
<filename><envar>PGDATA</envar>/<replaceable class="parameter">dbname</replaceable>/</filename>
|
<variablelist>
|
||||||
data area for the new database.
|
<varlistentry>
|
||||||
|
<term>-h <replaceable class="parameter">host</replaceable></term>
|
||||||
<variablelist>
|
<listitem>
|
||||||
<varlistentry>
|
<para>
|
||||||
<term>
|
Specifies the hostname of the machine on which the
|
||||||
Connection to database 'template1' failed.
|
<application>postmaster</application>
|
||||||
connectDB() failed: Is the postmaster running and accepting connections
|
is running. Defaults to using a local Unix domain socket
|
||||||
at 'UNIX Socket' on port '<replaceable class="parameter">port</replaceable>'?
|
rather than an IP connection.
|
||||||
createdb: database creation failed on <replaceable class="parameter">dbname</replaceable>.
|
</para>
|
||||||
</term>
|
</listitem>
|
||||||
<listitem>
|
</varlistentry>
|
||||||
<para>
|
<varlistentry>
|
||||||
<application>createdb</application> could not attach to the
|
<term>-p <replaceable class="parameter">port</replaceable></term>
|
||||||
<application>postmaster</application>
|
<listitem>
|
||||||
process on the specified host and port. If you see this message,
|
<para>
|
||||||
ensure that the <application>postmaster</application>
|
Specifies the Internet TCP/IP port or local Unix domain socket file
|
||||||
is running on the proper host and that you have specified the proper
|
extension on which the <application>postmaster</application>
|
||||||
port. If your site uses an authentication system, ensure that you
|
is listening for connections. The port number defaults to 5432,
|
||||||
have obtained the required authentication credentials.
|
or the value of the <envar>PGPORT</envar>
|
||||||
</para>
|
environment variable (if set).
|
||||||
</listitem>
|
</para>
|
||||||
</varlistentry>
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
<varlistentry>
|
|
||||||
<term>
|
<varlistentry>
|
||||||
Connection to database 'template1' failed.
|
<term>-u</term>
|
||||||
FATAL 1: SetUserId: user '<replaceable class="parameter">username</replaceable>' is not in 'pg_shadow'
|
<listitem>
|
||||||
createdb: database creation failed on <replaceable class="parameter">dbname</replaceable>.
|
<para>
|
||||||
</term>
|
Use password authentication.
|
||||||
<listitem>
|
Prompts for
|
||||||
<para>
|
<replaceable class="parameter">username</replaceable>
|
||||||
You do not have a valid entry in the relation <literal>pg_shadow</literal>
|
and <replaceable class="parameter">password</replaceable>.
|
||||||
and and will not be allowed to access <productname>Postgres</productname>.
|
</para>
|
||||||
Contact your <productname>Postgres</productname> administrator.
|
</listitem>
|
||||||
</para>
|
</varlistentry>
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
<varlistentry>
|
||||||
|
<term>-D <replaceable class="parameter">datadir</replaceable></term>
|
||||||
<varlistentry>
|
<listitem>
|
||||||
<term>
|
<para>
|
||||||
ERROR: user '<replaceable class="parameter">username</replaceable>' is not allowed to create/destroy databases
|
Specifies the alternate database location for this database installation.
|
||||||
createdb: database creation failed on <replaceable class="parameter">dbname</replaceable>.
|
This is the location of the installation system tables, not the location
|
||||||
</term>
|
of this specific database, which may be different.
|
||||||
<listitem>
|
</para>
|
||||||
<para>
|
</listitem>
|
||||||
You do not have permission to create new databases.
|
</varlistentry>
|
||||||
Contact your <productname>Postgres</productname> site administrator.
|
|
||||||
</para>
|
<varlistentry>
|
||||||
</listitem>
|
<term><replaceable class="parameter">dbname</replaceable></term>
|
||||||
</varlistentry>
|
<listitem>
|
||||||
|
<para>
|
||||||
<varlistentry>
|
Specifies the name of the database to be created. The name must be
|
||||||
<term>
|
unique among all <productname>Postgres</productname> databases in this installation.
|
||||||
ERROR: createdb: database '<replaceable class="parameter">dbname</replaceable>' already exists.
|
<replaceable class="parameter">dbname</replaceable>
|
||||||
createdb: database creation failed on <replaceable class="parameter">dbname</replaceable>.
|
defaults to the value of the
|
||||||
</term>
|
<envar>USER</envar>
|
||||||
<listitem>
|
environment variable.
|
||||||
<para>
|
</para>
|
||||||
The database already exists.
|
</listitem>
|
||||||
</para>
|
</varlistentry>
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
</variablelist>
|
||||||
|
</para>
|
||||||
<varlistentry>
|
</refsect2>
|
||||||
<term>
|
|
||||||
createdb: database creation failed on <replaceable class="parameter">dbname</replaceable>.
|
<refsect2 id="R2-APP-CREATEDB-2">
|
||||||
</term>
|
<refsect2info>
|
||||||
<listitem>
|
<date>1998-10-02</date>
|
||||||
<para>
|
</refsect2info>
|
||||||
An internal error occurred in <application>psql</application>
|
<title>
|
||||||
or in the backend server. Ensure that your site administrator has
|
Outputs
|
||||||
properly installed <productname>Postgres</productname>and initialized the site with
|
</title>
|
||||||
<application>initdb</application>.
|
<para>
|
||||||
</para>
|
<application>createdb</application> will create files in the
|
||||||
</listitem>
|
<filename><envar>PGDATA</envar>/<replaceable class="parameter">dbname</replaceable>/</filename>
|
||||||
</varlistentry>
|
data area for the new database.
|
||||||
|
|
||||||
</variablelist>
|
<variablelist>
|
||||||
</para>
|
<varlistentry>
|
||||||
<note>
|
<term><computeroutput>
|
||||||
<para>
|
Connection to database 'template1' failed.
|
||||||
<application>createdb</application> internally runs
|
connectDB() failed: Is the postmaster running and accepting connections at 'UNIX Socket' on port '<replaceable class="parameter">port</replaceable>'?
|
||||||
CREATE DATABASE from <application>psql</application>
|
createdb: database creation failed on <replaceable class="parameter">dbname</replaceable>.
|
||||||
while connected to the <literal>template1</literal> database.
|
</computeroutput></term>
|
||||||
</para>
|
<listitem>
|
||||||
</note>
|
<para>
|
||||||
</refsect2>
|
<application>createdb</application> could not attach to the
|
||||||
</refsynopsisdiv>
|
<application>postmaster</application>
|
||||||
|
process on the specified host and port. If you see this message,
|
||||||
<REFSECT1 ID="R1-APP-CREATEDB-1">
|
ensure that the <application>postmaster</application>
|
||||||
<REFSECT1INFO>
|
is running on the proper host and that you have specified the proper
|
||||||
<DATE>1998-10-02</DATE>
|
port. If your site uses an authentication system, ensure that you
|
||||||
</REFSECT1INFO>
|
have obtained the required authentication credentials.
|
||||||
<TITLE>
|
</para>
|
||||||
Description
|
</listitem>
|
||||||
</TITLE>
|
</varlistentry>
|
||||||
<PARA>
|
|
||||||
<application>createdb</application> creates a new
|
<varlistentry>
|
||||||
<productname>Postgres</productname> database.
|
<term><computeroutput>
|
||||||
The person who executes this command becomes
|
Connection to database 'template1' failed.
|
||||||
the database administrator, or <acronym>DBA</acronym>,
|
FATAL 1: SetUserId: user '<replaceable class="parameter">username</replaceable>' is not in 'pg_shadow'
|
||||||
for this database and is the only
|
createdb: database creation failed on <replaceable class="parameter">dbname</replaceable>.
|
||||||
person, other than the <productname>Postgres</productname> super-user,
|
</computeroutput></term>
|
||||||
who can destroy it.
|
<listitem>
|
||||||
</para>
|
<para>
|
||||||
|
You do not have a valid entry in the relation <literal>pg_shadow</literal>
|
||||||
|
and and will not be allowed to access <productname>Postgres</productname>.
|
||||||
|
Contact your <productname>Postgres</productname> administrator.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
ERROR: user '<replaceable class="parameter">username</replaceable>' is not allowed to create/destroy databases
|
||||||
|
createdb: database creation failed on <replaceable class="parameter">dbname</replaceable>.
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
You do not have permission to create new databases.
|
||||||
|
Contact your <productname>Postgres</productname> site administrator.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
ERROR: createdb: database '<replaceable class="parameter">dbname</replaceable>' already exists.
|
||||||
|
createdb: database creation failed on <replaceable class="parameter">dbname</replaceable>.
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The database already exists.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
createdb: database creation failed on <replaceable class="parameter">dbname</replaceable>.
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
An internal error occurred in <application>psql</application>
|
||||||
|
or in the backend server. Ensure that your site administrator has
|
||||||
|
properly installed <productname>Postgres</productname>and initialized the site with
|
||||||
|
<application>initdb</application>.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
<note>
|
||||||
<para>
|
<para>
|
||||||
<application>createdb</application> is a shell script that invokes
|
<application>createdb</application> internally runs
|
||||||
<application>psql</application>.
|
<command>CREATE DATABASE</command> from <application>psql</application>
|
||||||
Hence, a <application>postmaster</application>
|
while connected to the <literal>template1</literal> database.
|
||||||
process must be running on the database server host before
|
|
||||||
<application>createdb</application>
|
|
||||||
is executed. The
|
|
||||||
<envar>PGOPTION</envar>
|
|
||||||
and
|
|
||||||
<envar>PGREALM</envar>
|
|
||||||
environment variables will be passed on to
|
|
||||||
<application>psql</application>
|
|
||||||
and processed as described in <xref linkend="app-psql" endterm="psql-ref">.
|
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</note>
|
||||||
|
</refsect2>
|
||||||
<REFSECT1 ID="R1-APP-CREATEDB-2">
|
</refsynopsisdiv>
|
||||||
<REFSECT1INFO>
|
|
||||||
<DATE>1998-10-02</DATE>
|
<refsect1 id="R1-APP-CREATEDB-1">
|
||||||
</REFSECT1INFO>
|
<refsect1info>
|
||||||
<TITLE>
|
<date>1998-10-02</date>
|
||||||
Usage
|
</refsect1info>
|
||||||
</TITLE>
|
<title>
|
||||||
<PARA>
|
Description
|
||||||
To create the database <literal>demo</literal>
|
</title>
|
||||||
using the postmaster on the local host, port 5432:
|
<para>
|
||||||
|
<application>createdb</application> creates a new
|
||||||
<programlisting>
|
<productname>Postgres</productname> database.
|
||||||
createdb demo
|
The person who executes this command becomes
|
||||||
</programlisting>
|
the database administrator, or <acronym>DBA</acronym>,
|
||||||
|
for this database and is the only
|
||||||
To create the database <literal>demo</literal>
|
person, other than the <productname>Postgres</productname> super-user,
|
||||||
using the postmaster on host eden, port 5000:
|
who can destroy it.
|
||||||
|
</para>
|
||||||
<programlisting>
|
<para>
|
||||||
createdb -p 5000 -h eden demo
|
<application>createdb</application> is a shell script that invokes
|
||||||
</programlisting>
|
<application>psql</application>.
|
||||||
</para>
|
Hence, a <application>postmaster</application>
|
||||||
</refsect1>
|
process must be running on the database server host before
|
||||||
</REFENTRY>
|
<application>createdb</application>
|
||||||
|
is executed. The
|
||||||
|
<envar>PGOPTION</envar>
|
||||||
|
and
|
||||||
|
<envar>PGREALM</envar>
|
||||||
|
environment variables will be passed on to
|
||||||
|
<application>psql</application>
|
||||||
|
and processed as described in <xref endterm="psql-ref"
|
||||||
|
linkend="app-psql">.
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1 id="R1-APP-CREATEDB-2">
|
||||||
|
<refsect1info>
|
||||||
|
<date>1998-10-02</date>
|
||||||
|
</refsect1info>
|
||||||
|
<title>
|
||||||
|
Usage
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
To create the database <literal>demo</literal>
|
||||||
|
using the postmaster on the local host, port 5432:
|
||||||
|
|
||||||
|
<programlisting>
|
||||||
|
$ createdb demo
|
||||||
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
To create the database <literal>demo</literal>
|
||||||
|
using the postmaster on host eden, port 5000:
|
||||||
|
|
||||||
|
<programlisting>
|
||||||
|
$ createdb -p 5000 -h eden demo
|
||||||
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
|
||||||
|
<!-- Keep this comment at the end of the file
|
||||||
|
Local variables:
|
||||||
|
mode: sgml
|
||||||
|
sgml-omittag:nil
|
||||||
|
sgml-shorttag:t
|
||||||
|
sgml-minimize-attributes:nil
|
||||||
|
sgml-always-quote-attributes:t
|
||||||
|
sgml-indent-step:1
|
||||||
|
sgml-indent-data:t
|
||||||
|
sgml-parent-document:nil
|
||||||
|
sgml-default-dtd-file:"../reference.ced"
|
||||||
|
sgml-exposed-tags:nil
|
||||||
|
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
||||||
|
sgml-local-ecat-files:nil
|
||||||
|
End:
|
||||||
|
-->
|
||||||
|
|
|
@ -1,290 +1,292 @@
|
||||||
<REFENTRY ID="APP-CREATEUSER">
|
<refentry id="APP-CREATEUSER">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
<application>createuser</application>
|
<application>createuser</application>
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>Application</REFMISCINFO>
|
<refmiscinfo>Application</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
<application>createuser</application>
|
<application>createuser</application>
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Create a new <productname>Postgres</productname> user
|
Create a new <productname>Postgres</productname> user
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-10-02</DATE>
|
<date>1998-10-02</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
createuser [ <replaceable class="parameter">username</replaceable> ]
|
createuser [ <replaceable class="parameter">username</replaceable> ]
|
||||||
createuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
|
createuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
|
||||||
[ -i <replaceable class="parameter">userid</replaceable> ]
|
[ -i <replaceable class="parameter">userid</replaceable> ] [ -d | -D ] [ -u | -U ]
|
||||||
[ -d | -D ] [ -u | -U ] [ <replaceable class="parameter">username</replaceable> ]
|
[ <replaceable class="parameter">username</replaceable> ]
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-APP-CREATEUSER-1">
|
<refsect2 id="R2-APP-CREATEUSER-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-10-02</DATE>
|
<date>1998-10-02</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
|
|
||||||
<variablelist>
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-h <replaceable class="parameter">host</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Specifies the hostname of the machine on which the
|
|
||||||
<application>postmaster</application>
|
|
||||||
is running. Defaults to using a local Unix domain socket
|
|
||||||
rather than an IP connection..
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-p <replaceable class="parameter">port</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Specifies the Internet TCP/IP port or local Unix domain socket file
|
|
||||||
extension on which the <application>postmaster</application>
|
|
||||||
is listening for connections. The port number defaults to 5432,
|
|
||||||
or the value of the <envar>PGPORT</envar>
|
|
||||||
environment variable (if set).
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-d
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Allows the user to create databases.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-D
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Forbids the user to create databases.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-i <replaceable class="parameter">userid</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Specifies the numeric identifier to be associated with this user.
|
|
||||||
This identifier must be unique among all <productname>Postgres</productname> users, and is not required
|
|
||||||
to match the operating system UID.
|
|
||||||
You will be prompted for an identifier if none is specified on the command line,
|
|
||||||
and it will suggest an identifier matching the UID.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-u
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Allows the user to create other users.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-U
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Forbids the user to create other users.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
<replaceable class="parameter">username</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Specifies the name of the <productname>Postgres</productname> user to be created.
|
|
||||||
This name must be unique among all <productname>Postgres</productname> users.
|
|
||||||
You will be prompted for a name if none is specified on the command line.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
</variablelist>
|
|
||||||
</para>
|
|
||||||
</refsect2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-APP-CREATEUSER-2">
|
<variablelist>
|
||||||
<REFSECT2INFO>
|
<varlistentry>
|
||||||
<DATE>1998-10-02</DATE>
|
<term>-h <replaceable class="parameter">host</replaceable></term>
|
||||||
</REFSECT2INFO>
|
<listitem>
|
||||||
<TITLE>
|
<para>
|
||||||
Outputs
|
Specifies the hostname of the machine on which the
|
||||||
</TITLE>
|
<application>postmaster</application>
|
||||||
<PARA>
|
is running. Defaults to using a local Unix domain socket
|
||||||
<application>createuser</application> will add an entry in the
|
rather than an IP connection.
|
||||||
<literal>pg_user</literal> or <literal>pg_shadow</literal> system table.
|
</para>
|
||||||
|
</listitem>
|
||||||
<variablelist>
|
</varlistentry>
|
||||||
<varlistentry>
|
|
||||||
<term>
|
<varlistentry>
|
||||||
Connection to database 'template1' failed.
|
<term>-p <replaceable class="parameter">port</replaceable></term>
|
||||||
connectDB() failed: Is the postmaster running and accepting connections
|
<listitem>
|
||||||
at 'UNIX Socket' on port '<replaceable class="parameter">port</replaceable>'?
|
<para>
|
||||||
createuser: database access failed.
|
Specifies the Internet TCP/IP port or local Unix domain socket file
|
||||||
</term>
|
extension on which the <application>postmaster</application>
|
||||||
<listitem>
|
is listening for connections. The port number defaults to 5432,
|
||||||
<para>
|
or the value of the <envar>PGPORT</envar>
|
||||||
<application>createuser</application> could not attach to the
|
environment variable (if set).
|
||||||
<application>postmaster</application>
|
</para>
|
||||||
process on the specified host and port. If you see this message,
|
</listitem>
|
||||||
ensure that the <application>postmaster</application>
|
</varlistentry>
|
||||||
is running on the proper host and that you have specified the proper
|
|
||||||
port. If your site uses an authentication system, ensure that you
|
<varlistentry>
|
||||||
have obtained the required authentication credentials.
|
<term>-d</term>
|
||||||
</para>
|
<listitem>
|
||||||
</listitem>
|
<para>
|
||||||
</varlistentry>
|
Allows the user to create databases.
|
||||||
|
</para>
|
||||||
<varlistentry>
|
</listitem>
|
||||||
<term>
|
</varlistentry>
|
||||||
Connection to database 'template1' failed.
|
|
||||||
FATAL 1: SetUserId: user '<replaceable class="parameter">username</replaceable>' is not in 'pg_shadow'
|
<varlistentry>
|
||||||
createuser: database access failed.
|
<term>-D</term>
|
||||||
</term>
|
<listitem>
|
||||||
<listitem>
|
<para>
|
||||||
<para>
|
Forbids the user to create databases.
|
||||||
You do not have a valid entry in the relation <literal>pg_shadow</literal>
|
</para>
|
||||||
and and will not be allowed to access <productname>Postgres</productname>. Contact your
|
</listitem>
|
||||||
<productname>Postgres</productname> administrator.
|
</varlistentry>
|
||||||
</para>
|
|
||||||
</listitem>
|
<varlistentry>
|
||||||
</varlistentry>
|
<term>-i <replaceable class="parameter">userid</replaceable></term>
|
||||||
|
<listitem>
|
||||||
<varlistentry>
|
<para>
|
||||||
<term>
|
Specifies the numeric identifier to be associated with this user.
|
||||||
createuser: <replaceable class="parameter">username</replaceable> cannot create users.
|
This identifier must be unique among all
|
||||||
</term>
|
<productname>Postgres</productname> users, and is not required
|
||||||
<listitem>
|
to match the operating system UID.
|
||||||
<para>
|
You will be prompted for an identifier if none is specified on the command line,
|
||||||
You do not have permission to create new users; contact your
|
and it will suggest an identifier matching the UID.
|
||||||
<productname>Postgres</productname> site administrator.
|
</para>
|
||||||
</para>
|
</listitem>
|
||||||
</listitem>
|
</varlistentry>
|
||||||
</varlistentry>
|
|
||||||
|
<varlistentry>
|
||||||
<varlistentry>
|
<term>-u</term>
|
||||||
<term>
|
<listitem>
|
||||||
createuser: user "<replaceable class="parameter">username</replaceable>" already exists
|
<para>
|
||||||
</term>
|
Allows the user to create other users.
|
||||||
<listitem>
|
</para>
|
||||||
<para>
|
</listitem>
|
||||||
The user to be added already has an entry in the <literal>pg_shadow</literal>
|
</varlistentry>
|
||||||
class.
|
|
||||||
</para>
|
<varlistentry>
|
||||||
</listitem>
|
<term>-U</term>
|
||||||
</varlistentry>
|
<listitem>
|
||||||
|
<para>
|
||||||
<varlistentry>
|
Forbids the user to create other users.
|
||||||
<term>
|
</para>
|
||||||
database access failed
|
</listitem>
|
||||||
</term>
|
</varlistentry>
|
||||||
<listitem>
|
|
||||||
<para>
|
<varlistentry>
|
||||||
An internal error occurred in <application>psql</application>
|
<term><replaceable class="parameter">username</replaceable></term>
|
||||||
or in the backend server. Ensure that your site administrator has
|
<listitem>
|
||||||
properly installed <productname>Postgres</productname>and initialized the site with
|
<para>
|
||||||
<application>initdb</application>.
|
Specifies the name of the <productname>Postgres</productname> user to be created.
|
||||||
</para>
|
This name must be unique among all <productname>Postgres</productname> users.
|
||||||
</listitem>
|
You will be prompted for a name if none is specified on the command line.
|
||||||
</varlistentry>
|
</para>
|
||||||
|
</listitem>
|
||||||
</variablelist>
|
</varlistentry>
|
||||||
</para>
|
</variablelist>
|
||||||
|
</para>
|
||||||
<note>
|
</refsect2>
|
||||||
<para>
|
|
||||||
<application>createuser</application> internally runs
|
<refsect2 id="R2-APP-CREATEUSER-2">
|
||||||
CREATE USER from <application>psql</application>
|
<refsect2info>
|
||||||
while connected to the <literal>template1</literal> database.
|
<date>1998-10-02</date>
|
||||||
</para>
|
</refsect2info>
|
||||||
</note>
|
<title>
|
||||||
</refsect2>
|
Outputs
|
||||||
</refsynopsisdiv>
|
</title>
|
||||||
|
<para>
|
||||||
|
<application>createuser</application> will add an entry in the
|
||||||
|
<literal>pg_user</literal> or <literal>pg_shadow</literal> system table.
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
Connection to database 'template1' failed.
|
||||||
|
connectDB() failed: Is the postmaster running and accepting connections at 'UNIX Socket' on port '<replaceable class="parameter">port</replaceable>'?
|
||||||
|
createuser: database access failed.
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
<application>createuser</application> could not attach to the
|
||||||
|
<application>postmaster</application>
|
||||||
|
process on the specified host and port. If you see this message,
|
||||||
|
ensure that the <application>postmaster</application>
|
||||||
|
is running on the proper host and that you have specified the proper
|
||||||
|
port. If your site uses an authentication system, ensure that you
|
||||||
|
have obtained the required authentication credentials.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
Connection to database 'template1' failed.
|
||||||
|
FATAL 1: SetUserId: user '<replaceable class="parameter">username</replaceable>' is not in 'pg_shadow'
|
||||||
|
createuser: database access failed.
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
You do not have a valid entry in the relation <literal>pg_shadow</literal>
|
||||||
|
and and will not be allowed to access <productname>Postgres</productname>. Contact your
|
||||||
|
<productname>Postgres</productname> administrator.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
createuser: <replaceable class="parameter">username</replaceable> cannot create users.
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
You do not have permission to create new users; contact your
|
||||||
|
<productname>Postgres</productname> site administrator.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
createuser: user "<replaceable class="parameter">username</replaceable>" already exists
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The user to be added already has an entry in the
|
||||||
|
<literal>pg_shadow</literal> class.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
database access failed
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
An internal error occurred in <application>psql</application>
|
||||||
|
or in the backend server. Ensure that your site administrator has
|
||||||
|
properly installed <productname>Postgres</productname>and initialized the site with
|
||||||
|
<application>initdb</application>.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<note>
|
||||||
|
<para>
|
||||||
|
<application>createuser</application> internally runs
|
||||||
|
<command>CREATE USER</command> from <application>psql</application>
|
||||||
|
while connected to the <literal>template1</literal> database.
|
||||||
|
</para>
|
||||||
|
</note>
|
||||||
|
</refsect2>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-APP-CREATEUSER-1">
|
<refsect1 id="R1-APP-CREATEUSER-1">
|
||||||
<REFSECT1INFO>
|
<refsect1info>
|
||||||
<DATE>1998-10-02</DATE>
|
<date>1998-10-02</date>
|
||||||
</REFSECT1INFO>
|
</refsect1info>
|
||||||
<TITLE>
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<application>createuser</application> creates a
|
<application>createuser</application> creates a
|
||||||
new <productname>Postgres</productname> user.
|
new <productname>Postgres</productname> user.
|
||||||
Only users with <literal>usesuper</literal> set in
|
Only users with <literal>usesuper</literal> set in
|
||||||
the <literal>pg_shadow</literal> class can create
|
the <literal>pg_shadow</literal> class can create
|
||||||
new <productname>Postgres</productname> users. As shipped,
|
new <productname>Postgres</productname> users. As shipped,
|
||||||
the user <literal>postgres</literal> can create users.
|
the user <literal>postgres</literal> can create users.
|
||||||
</para>
|
</para>
|
||||||
|
<para>
|
||||||
|
<application>createuser</application> is a shell script that invokes
|
||||||
|
<application>psql</application>.
|
||||||
|
Hence, a <application>postmaster</application>
|
||||||
|
process must be running on the database server host before
|
||||||
|
<application>createuser</application> is executed.
|
||||||
|
The
|
||||||
|
<envar>PGOPTION</envar>
|
||||||
|
and
|
||||||
|
<envar>PGREALM</envar>
|
||||||
|
environment variables will be passed on to
|
||||||
|
<application>psql</application>
|
||||||
|
and processed as described in <xref endterm="psql-ref" linkend="app-psql">.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Once invoked, <application>createuser</application>
|
||||||
|
will ask a series of questions to obtain parameters not specified on
|
||||||
|
the command line. The new user's database login name and a numeric
|
||||||
|
user identifier must be specified.
|
||||||
|
|
||||||
|
<note>
|
||||||
<para>
|
<para>
|
||||||
<application>createuser</application> is a shell script that invokes
|
The <productname>Postgres</productname> user identifier
|
||||||
<application>psql</application>.
|
does not need to be the same as the user's Unix UID. However, typically
|
||||||
Hence, a <application>postmaster</application>
|
they are assigned to be the same.
|
||||||
process must be running on the database server host before
|
|
||||||
<application>createuser</application> is executed.
|
|
||||||
The
|
|
||||||
<envar>PGOPTION</envar>
|
|
||||||
and
|
|
||||||
<envar>PGREALM</envar>
|
|
||||||
environment variables will be passed on to
|
|
||||||
<application>psql</application>
|
|
||||||
and processed as described in <xref linkend="app-psql" endterm="psql-ref">.
|
|
||||||
|
|
||||||
Once invoked, <application>createuser</application>
|
|
||||||
will ask a series of questions to obtain parameters not specified on
|
|
||||||
the command line. The new user's database login name and a numeric
|
|
||||||
user identifier must be specified.
|
|
||||||
</para>
|
</para>
|
||||||
<note>
|
</note>
|
||||||
<para>
|
</para>
|
||||||
The <productname>Postgres</productname> user identifier
|
|
||||||
does not need to be the same as the user's Unix UID. However, typically
|
<para>
|
||||||
they are assigned to be the same.
|
You must also describe the privileges of the new user for security purposes.
|
||||||
</para>
|
Specifically, you will be asked whether the new user should be able to
|
||||||
</note>
|
act as <productname>Postgres</productname> super-user,
|
||||||
|
whether the new user may create new databases and whether the new user
|
||||||
<para>
|
is allowed to create other new users.
|
||||||
You must also describe the privileges of the new user for security purposes.
|
</para>
|
||||||
Specifically, you will be asked whether the new user should be able to
|
</refsect1>
|
||||||
act as <productname>Postgres</productname> super-user,
|
</refentry>
|
||||||
whether the new user may create new databases and whether the new user
|
|
||||||
is allowed to create other new users.
|
<!-- Keep this comment at the end of the file
|
||||||
</para>
|
Local variables:
|
||||||
</refsect1>
|
mode: sgml
|
||||||
</REFENTRY>
|
sgml-omittag:nil
|
||||||
|
sgml-shorttag:t
|
||||||
|
sgml-minimize-attributes:nil
|
||||||
|
sgml-always-quote-attributes:t
|
||||||
|
sgml-indent-step:1
|
||||||
|
sgml-indent-data:t
|
||||||
|
sgml-parent-document:nil
|
||||||
|
sgml-default-dtd-file:"../reference.ced"
|
||||||
|
sgml-exposed-tags:nil
|
||||||
|
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
||||||
|
sgml-local-ecat-files:nil
|
||||||
|
End:
|
||||||
|
-->
|
||||||
|
|
|
@ -1,227 +1,215 @@
|
||||||
<REFENTRY ID="SQL-DECLARE">
|
<refentry id="SQL-DECLARE">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
DECLARE
|
DECLARE
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
DECLARE
|
DECLARE
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Defines a cursor for table access
|
Defines a cursor for table access
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-09-04</DATE>
|
<date>1998-09-04</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
DECLARE <replaceable class="parameter">cursor</replaceable> [ BINARY ] [ INSENSITIVE ] [ SCROLL ]
|
DECLARE <replaceable class="parameter">cursor</replaceable> [ BINARY ] [ INSENSITIVE ] [ SCROLL ]
|
||||||
CURSOR FOR <replaceable class="parameter">query</replaceable>
|
CURSOR FOR <replaceable class="parameter">query</replaceable>
|
||||||
[ FOR { READ ONLY | UPDATE [ OF <replaceable class="parameter">column</replaceable> [, ...] ] ]
|
[ FOR { READ ONLY | UPDATE [ OF <replaceable class="parameter">column</replaceable> [, ...] ] ]
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
<REFSECT2 ID="R2-SQL-DECLARE-1">
|
<refsect2 id="R2-SQL-DECLARE-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</PARA>
|
<variablelist>
|
||||||
<VARIABLELIST>
|
<varlistentry>
|
||||||
<VARLISTENTRY>
|
<term><replaceable class="parameter">cursor</replaceable></term>
|
||||||
<TERM>
|
<listitem>
|
||||||
<replaceable class="parameter">cursor</replaceable>
|
<para>
|
||||||
</TERM>
|
The name of the cursor to be used in subsequent FETCH operations..
|
||||||
<LISTITEM>
|
</para>
|
||||||
<PARA>
|
</listitem>
|
||||||
The name of the cursor to be used in subsequent FETCH operations..
|
</varlistentry>
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term>BINARY</term>
|
||||||
BINARY
|
<listitem>
|
||||||
</TERM>
|
<para>
|
||||||
<LISTITEM>
|
Causes the cursor to fetch data in binary
|
||||||
<PARA>
|
rather than in text format.
|
||||||
Causes the cursor to fetch data in binary
|
</para>
|
||||||
rather than in text format.
|
</listitem>
|
||||||
</PARA>
|
</varlistentry>
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term>INSENSITIVE</term>
|
||||||
INSENSITIVE
|
<listitem>
|
||||||
</TERM>
|
<para>
|
||||||
<LISTITEM>
|
<acronym>SQL92</acronym> keyword indicating that data retrieved
|
||||||
<PARA>
|
from the cursor should be unaffected by updates from other processes or cursors.
|
||||||
<acronym>SQL92</acronym> keyword indicating that data retrieved
|
Since cursor operations occur within transactions
|
||||||
from the cursor should be unaffected by updates from other processes or cursors.
|
in <productname>Postgres</productname> this is always the case.
|
||||||
Since cursor operations occur within transactions
|
This keyword has no effect.
|
||||||
in <productname>Postgres</productname> this is always the case.
|
</para>
|
||||||
This keyword has no effect.
|
</listitem>
|
||||||
</PARA>
|
</varlistentry>
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term>SCROLL</term>
|
||||||
SCROLL
|
<listitem>
|
||||||
</TERM>
|
<para>
|
||||||
<LISTITEM>
|
<acronym>SQL92</acronym> keyword indicating that data may be retrieved
|
||||||
<PARA>
|
in multiple rows per FETCH operation. Since this is allowed at all times
|
||||||
<acronym>SQL92</acronym> keyword indicating that data may be retrieved
|
by <productname>Postgres</productname> this keyword has no effect.
|
||||||
in multiple rows per FETCH operation. Since this is allowed at all times
|
</para>
|
||||||
by <productname>Postgres</productname> this keyword has no effect.
|
</listitem>
|
||||||
</PARA>
|
</varlistentry>
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term><replaceable class="parameter">query</replaceable></term>
|
||||||
<replaceable class="parameter">query</replaceable>
|
<listitem>
|
||||||
</TERM>
|
<para>
|
||||||
<LISTITEM>
|
An SQL query which will provide the rows to be governed by the
|
||||||
<PARA>
|
cursor.
|
||||||
An SQL query which will provide the rows to be governed by the
|
Refer to the SELECT statement for further information about
|
||||||
cursor.
|
valid arguments.
|
||||||
Refer to the SELECT statement for further information about
|
</para>
|
||||||
valid arguments.
|
</listitem>
|
||||||
</PARA>
|
</varlistentry>
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term>READ ONLY</term>
|
||||||
READ ONLY
|
<listitem>
|
||||||
</TERM>
|
<para>
|
||||||
<LISTITEM>
|
<acronym>SQL92</acronym> keyword indicating that the cursor will be used
|
||||||
<PARA>
|
in a readonly mode. Since this is the only cursor access mode
|
||||||
<acronym>SQL92</acronym> keyword indicating that the cursor will be used
|
available in <productname>Postgres</productname> this keyword has no effect.
|
||||||
in a readonly mode. Since this is the only cursor access mode
|
</para>
|
||||||
available in <productname>Postgres</productname> this keyword has no effect.
|
</listitem>
|
||||||
</PARA>
|
</varlistentry>
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term>UPDATE</term>
|
||||||
UPDATE
|
<listitem>
|
||||||
</TERM>
|
<para>
|
||||||
<LISTITEM>
|
<acronym>SQL92</acronym> keyword indicating that the cursor will be used
|
||||||
<PARA>
|
to update tables. Since cursor updates are not currently
|
||||||
<acronym>SQL92</acronym> keyword indicating that the cursor will be used
|
supported in <productname>Postgres</productname> this keyword
|
||||||
to update tables. Since cursor updates are not currently
|
provokes an informational error message.
|
||||||
supported in <productname>Postgres</productname> this keyword
|
</para>
|
||||||
provokes an informational error message.
|
</listitem>
|
||||||
</PARA>
|
</varlistentry>
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term><replaceable class="parameter">column</replaceable></term>
|
||||||
<replaceable class="parameter">column</replaceable>
|
<listitem>
|
||||||
</TERM>
|
<para>
|
||||||
<LISTITEM>
|
Column(s) to be updated.
|
||||||
<PARA>
|
Since cursor updates are not currently
|
||||||
Column(s) to be updated.
|
supported in <productname>Postgres</productname> the UPDATE clause
|
||||||
Since cursor updates are not currently
|
provokes an informational error message.
|
||||||
supported in <productname>Postgres</productname> the UPDATE clause
|
</para>
|
||||||
provokes an informational error message.
|
</listitem>
|
||||||
</PARA>
|
</varlistentry>
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
|
|
||||||
</VARIABLELIST>
|
</variablelist>
|
||||||
</REFSECT2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DECLARE-2">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-04-15</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Outputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
SELECT
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The message returned if the SELECT is run successfully.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
NOTICE
|
|
||||||
BlankPortalAssignName: portal "<replaceable class="parameter">cursor</replaceable>" already exists
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
This error occurs if cursor "<replaceable class="parameter">cursor</replaceable>" is already declared.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
ERROR: Named portals may only be used in begin/end transaction blocks
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
This error occurs if the cursor is not declared within a transaction block.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
</VARIABLELIST>
|
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</REFSYNOPSISDIV>
|
|
||||||
|
<refsect2 id="R2-SQL-DECLARE-2">
|
||||||
<REFSECT1 ID="R1-SQL-DECLARE-1">
|
<refsect2info>
|
||||||
<REFSECT1INFO>
|
<date>1998-04-15</date>
|
||||||
<DATE>1998-09-04</DATE>
|
</refsect2info>
|
||||||
</REFSECT1INFO>
|
<title>
|
||||||
<TITLE>
|
Outputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
SELECT
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The message returned if the SELECT is run successfully.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
NOTICE
|
||||||
|
BlankPortalAssignName: portal "<replaceable class="parameter">cursor</replaceable>" already exists
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
This error occurs if <replaceable class="parameter">cursor</replaceable> is already declared.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
ERROR: Named portals may only be used in begin/end transaction blocks
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
This error occurs if the cursor is not declared within a transaction block.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-DECLARE-1">
|
||||||
|
<refsect1info>
|
||||||
|
<date>1998-09-04</date>
|
||||||
|
</refsect1info>
|
||||||
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
DECLARE allows a user to create cursors, which can be used to retrieve
|
<command>DECLARE</command> allows a user to create cursors, which can be used to retrieve
|
||||||
a small number of rows at a time out of a larger query. Cursors can return
|
a small number of rows at a time out of a larger query. Cursors can return
|
||||||
data either in text or in binary foramt.
|
data either in text or in binary foramt.
|
||||||
</PARA>
|
</para>
|
||||||
<PARA>
|
|
||||||
|
<para>
|
||||||
Normal cursors return data in text format, either ASCII or another
|
Normal cursors return data in text format, either ASCII or another
|
||||||
encoding scheme depending on how the <productname>Postgres</productname>
|
encoding scheme depending on how the <productname>Postgres</productname>
|
||||||
backend was built. Since
|
backend was built. Since
|
||||||
data is stored natively in binary format, the system must
|
data is stored natively in binary format, the system must
|
||||||
do a conversion to produce the text format. In addition,
|
do a conversion to produce the text format. In addition,
|
||||||
text formats are often larger in size than the corresponding binary format.
|
text formats are often larger in size than the corresponding binary format.
|
||||||
Once the information comes back in text form, the client
|
Once the information comes back in text form, the client
|
||||||
application may have to convert it to a binary format to
|
application may have to convert it to a binary format to
|
||||||
manipulate it anyway.
|
manipulate it anyway.
|
||||||
</PARA>
|
</para>
|
||||||
<PARA>
|
|
||||||
|
<para>
|
||||||
BINARY cursors give you back the data in the native binary
|
BINARY cursors give you back the data in the native binary
|
||||||
representation. So binary cursors will tend to be a
|
representation. So binary cursors will tend to be a
|
||||||
little faster since they suffer less conversion overhead.
|
little faster since they suffer less conversion overhead.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
As an example, if a query returns a value of one from an integer column,
|
As an example, if a query returns a value of one from an integer column,
|
||||||
you would get a string of '1' with a default cursor
|
you would get a string of '1' with a default cursor
|
||||||
whereas with a binary cursor you would get
|
whereas with a binary cursor you would get
|
||||||
a 4-byte value equal to control-A ('^A').
|
a 4-byte value equal to control-A ('^A').
|
||||||
|
|
||||||
<caution>
|
<caution>
|
||||||
<para>
|
<para>
|
||||||
BINARY cursors should be used carefully. User applications such
|
BINARY cursors should be used carefully. User applications such
|
||||||
|
@ -230,14 +218,15 @@ whereas with a binary cursor you would get
|
||||||
</para>
|
</para>
|
||||||
</caution>
|
</caution>
|
||||||
</para>
|
</para>
|
||||||
<PARA>
|
|
||||||
|
<para>
|
||||||
However, string representation is architecture-neutral whereas binary
|
However, string representation is architecture-neutral whereas binary
|
||||||
representation can differ between different machine architectures.
|
representation can differ between different machine architectures.
|
||||||
Therefore, if your client machine and server machine use different
|
Therefore, if your client machine and server machine use different
|
||||||
representations (e.g. "big-endian" versus "little-endian"),
|
representations (e.g. "big-endian" versus "little-endian"),
|
||||||
you will probably not want your data returned in
|
you will probably not want your data returned in
|
||||||
binary format.
|
binary format.
|
||||||
|
|
||||||
<tip>
|
<tip>
|
||||||
<para>
|
<para>
|
||||||
If you intend to display the data in
|
If you intend to display the data in
|
||||||
|
@ -245,23 +234,23 @@ whereas with a binary cursor you would get
|
||||||
effort on the client side.
|
effort on the client side.
|
||||||
</para>
|
</para>
|
||||||
</tip>
|
</tip>
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DECLARE-3">
|
<refsect2 id="R2-SQL-DECLARE-3">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-04</DATE>
|
<date>1998-09-04</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Notes
|
Notes
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
Cursors are only available in transactions.
|
Cursors are only available in transactions.
|
||||||
</PARA>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
<productname>Postgres</productname>
|
<productname>Postgres</productname>
|
||||||
does not have an explicit <command>OPEN cursor</command>
|
does not have an explicit <command>OPEN cursor</command>
|
||||||
statement; a cursor is considered to be open when it is declared.
|
statement; a cursor is considered to be open when it is declared.
|
||||||
|
|
||||||
<note>
|
<note>
|
||||||
<para>
|
<para>
|
||||||
In <acronym>SQL92</acronym> cursors are only available in
|
In <acronym>SQL92</acronym> cursors are only available in
|
||||||
|
@ -271,39 +260,39 @@ whereas with a binary cursor you would get
|
||||||
involving DECLARE and OPEN statements.
|
involving DECLARE and OPEN statements.
|
||||||
</para>
|
</para>
|
||||||
</note>
|
</note>
|
||||||
|
</para>
|
||||||
</PARA>
|
</refsect2>
|
||||||
</REFSECT2>
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DECLARESTATEMENT-2">
|
<refsect1 id="R1-SQL-DECLARESTATEMENT-2">
|
||||||
<TITLE>
|
<title>
|
||||||
Usage
|
Usage
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
To declare a cursor:
|
To declare a cursor:
|
||||||
</PARA>
|
|
||||||
<ProgramListing>
|
<programlisting>
|
||||||
DECLARE liahona CURSOR
|
DECLARE liahona CURSOR
|
||||||
FOR SELECT * FROM films;
|
FOR SELECT * FROM films;
|
||||||
</ProgramListing>
|
</programlisting>
|
||||||
</REFSECT1>
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DECLARESTATEMENT-3">
|
<refsect1 id="R1-SQL-DECLARESTATEMENT-3">
|
||||||
<TITLE>
|
<title>
|
||||||
Compatibility
|
Compatibility
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DECLARESTATEMENT-4">
|
<refsect2 id="R2-SQL-DECLARESTATEMENT-4">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
SQL92
|
SQL92
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<acronym>SQL92</acronym> allows cursors only in embedded <acronym>SQL</acronym>
|
<acronym>SQL92</acronym> allows cursors only in embedded <acronym>SQL</acronym>
|
||||||
and in modules. <productname>Postgres</productname> permits cursors to be used
|
and in modules. <productname>Postgres</productname> permits cursors to be used
|
||||||
interactively.
|
interactively.
|
||||||
|
@ -314,12 +303,12 @@ DECLARE liahona CURSOR
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
</refentry>
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
mode: sgml
|
mode: sgml
|
||||||
sgml-omittag:t
|
sgml-omittag:nil
|
||||||
sgml-shorttag:t
|
sgml-shorttag:t
|
||||||
sgml-minimize-attributes:nil
|
sgml-minimize-attributes:nil
|
||||||
sgml-always-quote-attributes:t
|
sgml-always-quote-attributes:t
|
||||||
|
|
|
@ -1,128 +1,122 @@
|
||||||
<REFENTRY ID="SQL-DELETE">
|
<refentry id="SQL-DELETE">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
DELETE
|
DELETE
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
DELETE
|
DELETE
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Deletes rows from a table
|
Deletes rows from a table
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
|
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
DELETE FROM <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> [ WHERE <REPLACEABLE CLASS="PARAMETER">condition</REPLACEABLE> ]
|
DELETE FROM <replaceable class="PARAMETER">table</replaceable> [ WHERE <replaceable class="PARAMETER">condition</replaceable> ]
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DELETE-1">
|
<refsect2 id="R2-SQL-DELETE-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</PARA>
|
<variablelist>
|
||||||
<VARIABLELIST>
|
<varlistentry>
|
||||||
<VARLISTENTRY>
|
<term><replaceable class="parameter">table</replaceable></term>
|
||||||
<TERM>
|
<listitem>
|
||||||
<replaceable class="parameter">table</replaceable>
|
<para>
|
||||||
</TERM>
|
The name of an existing table.
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The name of an existing table.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">condition</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
This is an SQL selection query which returns the rows which
|
|
||||||
are to be deleted.
|
|
||||||
</PARA>
|
|
||||||
<PARA>
|
|
||||||
Refer to the SELECT statement for further description
|
|
||||||
of the WHERE clause.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
</variablelist>
|
|
||||||
</REFSECT2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DELETE-2">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-04-15</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Outputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue> DELETE <replaceable class="parameter">count</replaceable></ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Message returned if items are successfully deleted. The
|
|
||||||
<replaceable class="parameter">count</replaceable> is the number
|
|
||||||
of rows deleted.
|
|
||||||
</PARA>
|
|
||||||
<PARA>
|
|
||||||
If <replaceable class="parameter">count</replaceable> is 0,
|
|
||||||
no rows were deleted.
|
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</VARIABLELIST>
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">condition</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
This is an SQL selection query which returns the rows which
|
||||||
|
are to be deleted.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Refer to the SELECT statement for further description
|
||||||
|
of the WHERE clause.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</REFSYNOPSISDIV>
|
|
||||||
|
<refsect2 id="R2-SQL-DELETE-2">
|
||||||
<REFSECT1 ID="R1-SQL-DELETE-1">
|
<refsect2info>
|
||||||
<REFSECT1INFO>
|
<date>1998-04-15</date>
|
||||||
<DATE>1998-04-15</DATE>
|
</refsect2info>
|
||||||
</REFSECT1INFO>
|
<title>
|
||||||
<TITLE>
|
Outputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
DELETE <replaceable class="parameter">count</replaceable>
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Message returned if items are successfully deleted. The
|
||||||
|
<replaceable class="parameter">count</replaceable> is the number
|
||||||
|
of rows deleted.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
If <replaceable class="parameter">count</replaceable> is 0,
|
||||||
|
no rows were deleted.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-DELETE-1">
|
||||||
|
<refsect1info>
|
||||||
|
<date>1998-04-15</date>
|
||||||
|
</refsect1info>
|
||||||
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
DELETE removes rows which satisfy the WHERE <replaceable class="parameter">condition</replaceable>,
|
<command>DELETE</command> removes rows which satisfy the WHERE
|
||||||
from the specified table.
|
clause from the specified table.
|
||||||
</PARA>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
If the <replaceable class="parameter">condition</replaceable> is absent,
|
If the <firstterm>condition</firstterm> (WHERE clause) is absent,
|
||||||
the effect is to delete all rows in the table.
|
the effect is to delete all rows in the table.
|
||||||
The result is a valid, but empty table.
|
The result is a valid, but empty table.
|
||||||
</PARA>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
You must have write access to the table in order to modify
|
You must have write access to the table in order to modify
|
||||||
it, as well as read access to any table whose values are
|
it, as well as read access to any table whose values are
|
||||||
read in the <replaceable class="parameter">condition</replaceable>.
|
read in the <replaceable class="parameter">condition</replaceable>.
|
||||||
</PARA>
|
</para>
|
||||||
</REFSECT1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DELETE-2">
|
|
||||||
<TITLE>
|
|
||||||
Usage
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
Remove all films but musicals:
|
|
||||||
</PARA>
|
|
||||||
<ProgramListing>
|
|
||||||
DETETE FROM films WHERE kind <> 'Musical';
|
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-DELETE-2">
|
||||||
|
<title>
|
||||||
|
Usage
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
Remove all films but musicals:
|
||||||
|
<programlisting>
|
||||||
|
DELETE FROM films WHERE kind <> 'Musical';
|
||||||
SELECT * FROM films;
|
SELECT * FROM films;
|
||||||
|
|
||||||
code |title |did| date_prod|kind |len
|
code |title |did| date_prod|kind |len
|
||||||
|
@ -131,52 +125,56 @@ UA501|West Side Story |105|1961-01-03|Musical | 02:32
|
||||||
TC901|The King and I |109|1956-08-11|Musical | 02:13
|
TC901|The King and I |109|1956-08-11|Musical | 02:13
|
||||||
WD101|Bed Knobs and Broomsticks|111| |Musical | 01:57
|
WD101|Bed Knobs and Broomsticks|111| |Musical | 01:57
|
||||||
(3 rows)
|
(3 rows)
|
||||||
</ProgramListing>
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Clear the table <literal>films</literal>:
|
Clear the table <literal>films</literal>:
|
||||||
</para>
|
<programlisting>
|
||||||
<programlisting>
|
|
||||||
DELETE FROM films;
|
DELETE FROM films;
|
||||||
|
|
||||||
SELECT * FROM films;
|
SELECT * FROM films;
|
||||||
|
|
||||||
code|title|did|date_prod|kind|len
|
code|title|did|date_prod|kind|len
|
||||||
----+-----+---+---------+----+---
|
----+-----+---+---------+----+---
|
||||||
(0 rows)
|
(0 rows)
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</REFSECT1>
|
</para>
|
||||||
|
</refsect1>
|
||||||
<REFSECT1 ID="R1-SQL-DELETE-3">
|
|
||||||
<TITLE>
|
<refsect1 id="R1-SQL-DELETE-3">
|
||||||
|
<title>
|
||||||
Compatibility
|
Compatibility
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DELETE-4">
|
<refsect2 id="R2-SQL-DELETE-4">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
SQL92
|
SQL92
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
|
||||||
<acronym>SQL92</acronym> allows a positioned DELETE statement:
|
|
||||||
</PARA>
|
|
||||||
|
|
||||||
<synopsis>
|
|
||||||
DELETE FROM <replaceable class="parameter">table</replaceable> WHERE CURRENT OF <replaceable class="parameter">cursor</replaceable>
|
|
||||||
</synopsis>
|
|
||||||
<para>
|
<para>
|
||||||
where <replaceable class="parameter">cursor</replaceable> identifies an open cursor. Interactive cursors in <productname>Postgres</productname> are read-only.
|
<acronym>SQL92</acronym> allows a positioned DELETE statement:
|
||||||
|
|
||||||
|
<synopsis>
|
||||||
|
DELETE FROM <replaceable class="parameter">table</replaceable> WHERE
|
||||||
|
CURRENT OF <replaceable class="parameter">cursor</replaceable>
|
||||||
|
</synopsis>
|
||||||
|
|
||||||
|
where <replaceable class="parameter">cursor</replaceable>
|
||||||
|
identifies an open cursor.
|
||||||
|
Interactive cursors in <productname>Postgres</productname> are read-only.
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
</refentry>
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
mode: sgml
|
mode: sgml
|
||||||
sgml-omittag:t
|
sgml-omittag:nil
|
||||||
sgml-shorttag:t
|
sgml-shorttag:t
|
||||||
sgml-minimize-attributes:nil
|
sgml-minimize-attributes:nil
|
||||||
sgml-always-quote-attributes:t
|
sgml-always-quote-attributes:t
|
||||||
|
|
|
@ -1,269 +1,277 @@
|
||||||
<REFENTRY ID="APP-DESTROYDB">
|
<refentry id="APP-DESTROYDB">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
<application>destroydb</application>
|
<application>destroydb</application>
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>Application</REFMISCINFO>
|
<refmiscinfo>Application</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
<application>destroydb</application>
|
<application>destroydb</application>
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Remove an existing <productname>Postgres</productname> database
|
Remove an existing <productname>Postgres</productname> database
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-10-02</DATE>
|
<date>1998-10-02</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
destroydb [ <replaceable class="parameter">dbname</replaceable> ]
|
destroydb [ <replaceable class="parameter">dbname</replaceable> ]
|
||||||
destroydb [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
|
destroydb [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
|
||||||
[ -i ] [ <replaceable class="parameter">dbname</replaceable> ]
|
[ -i ] [ <replaceable class="parameter">dbname</replaceable> ]
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-APP-DESTROYDB-1">
|
<refsect2 id="R2-APP-DESTROYDB-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-10-02</DATE>
|
<date>1998-10-02</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
|
|
||||||
<variablelist>
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-h <replaceable class="parameter">host</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Specifies the hostname of the machine on which the
|
|
||||||
<application>postmaster</application>
|
|
||||||
is running. Defaults to using a local Unix domain socket
|
|
||||||
rather than an IP connection..
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-p <replaceable class="parameter">port</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Specifies the Internet TCP/IP port or local Unix domain socket file
|
|
||||||
extension on which the <application>postmaster</application>
|
|
||||||
is listening for connections. The port number defaults to 5432,
|
|
||||||
or the value of the <envar>PGPORT</envar>
|
|
||||||
environment variable (if set).
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-i
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Run in interactive mode.
|
|
||||||
Prompts for confirmation before destroying a database.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
<replaceable class="parameter">dbname</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Specifies the name of the database to be destroyed. The database
|
|
||||||
must be one of the existing <productname>Postgres</productname> databases
|
|
||||||
in this installation.
|
|
||||||
<replaceable class="parameter">dbname</replaceable>
|
|
||||||
defaults to the value of the
|
|
||||||
<envar>USER</envar>
|
|
||||||
environment variable.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
</variablelist>
|
|
||||||
</para>
|
|
||||||
</refsect2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-APP-DESTROYDB-2">
|
<variablelist>
|
||||||
<REFSECT2INFO>
|
<varlistentry>
|
||||||
<DATE>1998-10-02</DATE>
|
<term>-h <replaceable class="parameter">host</replaceable></term>
|
||||||
</REFSECT2INFO>
|
<listitem>
|
||||||
<TITLE>
|
<para>
|
||||||
Outputs
|
Specifies the hostname of the machine on which the
|
||||||
</TITLE>
|
<application>postmaster</application>
|
||||||
<PARA>
|
is running. Defaults to using a local Unix domain socket
|
||||||
<application>destroydb</application> will remove files from the
|
rather than an IP connection.
|
||||||
<filename><envar>PGDATA</envar>/<replaceable class="parameter">dbname</replaceable>/</filename>
|
</para>
|
||||||
data area for the existing database.
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
<variablelist>
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
Connection to database 'template1' failed.
|
|
||||||
connectDB() failed: Is the postmaster running and accepting connections
|
|
||||||
at 'UNIX Socket' on port '<replaceable class="parameter">port</replaceable>'?
|
|
||||||
destroydb: database destroy failed on <replaceable class="parameter">dbname</replaceable>.
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
<application>destroydb</application> could not attach to the
|
|
||||||
<application>postmaster</application>
|
|
||||||
process on the specified host and port. If you see this message,
|
|
||||||
ensure that the <application>postmaster</application>
|
|
||||||
is running on the proper host and that you have specified the proper
|
|
||||||
port. If your site uses an authentication system, ensure that you
|
|
||||||
have obtained the required authentication credentials.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-p <replaceable class="parameter">port</replaceable></term>
|
||||||
Connection to database 'template1' failed.
|
<listitem>
|
||||||
FATAL 1: SetUserId: user '<replaceable class="parameter">username</replaceable>' is not in 'pg_shadow'
|
<para>
|
||||||
destroydb: database destroy failed on <replaceable class="parameter">dbname</replaceable>.
|
Specifies the Internet TCP/IP port or local Unix domain socket file
|
||||||
</term>
|
extension on which the <application>postmaster</application>
|
||||||
<listitem>
|
is listening for connections. The port number defaults to 5432,
|
||||||
<para>
|
or the value of the <envar>PGPORT</envar>
|
||||||
You do not have a valid entry in the relation <literal>pg_shadow</literal>
|
environment variable (if set).
|
||||||
and and will not be allowed to access <productname>Postgres</productname>.
|
</para>
|
||||||
Contact your <productname>Postgres</productname> administrator.
|
</listitem>
|
||||||
</para>
|
</varlistentry>
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-i</term>
|
||||||
ERROR: user '<replaceable class="parameter">username</replaceable>' is not allowed to create/destroy databases
|
<listitem>
|
||||||
destroydb: database destroy failed on <replaceable class="parameter">dbname</replaceable>.
|
<para>
|
||||||
</term>
|
Run in interactive mode.
|
||||||
<listitem>
|
Prompts for confirmation before destroying a database.
|
||||||
<para>
|
</para>
|
||||||
You do not have permission to destroy (or create) databases.
|
</listitem>
|
||||||
Contact your <productname>Postgres</productname> site administrator.
|
</varlistentry>
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
ERROR: destroydb: database '<replaceable class="parameter">dbname</replaceable>' does not exist.
|
|
||||||
destroydb: database destroy failed on <replaceable class="parameter">dbname</replaceable>.
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
The database to be removed does not have an entry in the
|
|
||||||
<literal>pg_database</literal> class.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
ERROR: destroydb: database '<replaceable class="parameter">dbname</replaceable>' is not owned by you.
|
|
||||||
destroydb: database destroy failed on <replaceable class="parameter">dbname</replaceable>.
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
You are not the Database Administrator (DBA) for the specified database.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
destroydb: database destroy failed on <replaceable class="parameter">dbname</replaceable>.
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
An internal error occurred in <application>psql</application>
|
|
||||||
or in the backend server. Ensure that your site administrator has
|
|
||||||
properly installed <productname>Postgres</productname>and initialized the site with
|
|
||||||
<application>initdb</application>.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
</variablelist>
|
|
||||||
</para>
|
|
||||||
<note>
|
|
||||||
<para>
|
|
||||||
<application>destroydb</application> internally runs
|
|
||||||
<command>DESTROY DATABASE</command> from <application>psql</application>
|
|
||||||
while connected to the <literal>template1</literal> database.
|
|
||||||
</para>
|
|
||||||
</note>
|
|
||||||
</refsect2>
|
|
||||||
</refsynopsisdiv>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-APP-DESTROYDB-1">
|
<varlistentry>
|
||||||
<REFSECT1INFO>
|
<term><replaceable class="parameter">dbname</replaceable></term>
|
||||||
<DATE>1998-10-02</DATE>
|
<listitem>
|
||||||
</REFSECT1INFO>
|
<para>
|
||||||
<TITLE>
|
Specifies the name of the database to be destroyed. The database
|
||||||
Description
|
must be one of the existing <productname>Postgres</productname> databases
|
||||||
</TITLE>
|
in this installation.
|
||||||
<PARA>
|
<replaceable class="parameter">dbname</replaceable>
|
||||||
<application>destroydb</application> destroys an existing
|
defaults to the value of the
|
||||||
<productname>Postgres</productname> database.
|
<envar>USER</envar>
|
||||||
The person who executes this command must be
|
environment variable.
|
||||||
the database administrator, or <acronym>DBA</acronym>,
|
</para>
|
||||||
or must be the <productname>Postgres</productname> super-user.
|
</listitem>
|
||||||
The program runs silently; no confirmation message will be displayed.
|
</varlistentry>
|
||||||
After the database is destroyed, a Unix shell prompt will reappear.
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
|
||||||
|
<refsect2 id="R2-APP-DESTROYDB-2">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-10-02</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
Outputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
<application>destroydb</application> will remove files from the
|
||||||
|
<filename><envar>PGDATA</envar>/<replaceable class="parameter">dbname</replaceable>/</filename>
|
||||||
|
data area for the existing database.
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
Connection to database 'template1' failed.
|
||||||
|
connectDB() failed: Is the postmaster running and accepting connections
|
||||||
|
at 'UNIX Socket' on port '<replaceable class="parameter">port</replaceable>'?
|
||||||
|
destroydb: database destroy failed on <replaceable class="parameter">dbname</replaceable>.
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
<application>destroydb</application> could not attach to the
|
||||||
|
<application>postmaster</application>
|
||||||
|
process on the specified host and port. If you see this message,
|
||||||
|
ensure that the <application>postmaster</application>
|
||||||
|
is running on the proper host and that you have specified the proper
|
||||||
|
port. If your site uses an authentication system, ensure that you
|
||||||
|
have obtained the required authentication credentials.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
Connection to database 'template1' failed.
|
||||||
|
FATAL 1: SetUserId: user '<replaceable class="parameter">username</replaceable>' is not in 'pg_shadow'
|
||||||
|
destroydb: database destroy failed on <replaceable class="parameter">dbname</replaceable>.
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
You do not have a valid entry in the relation <literal>pg_shadow</literal>
|
||||||
|
and and will not be allowed to access <productname>Postgres</productname>.
|
||||||
|
Contact your <productname>Postgres</productname> administrator.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
ERROR: user '<replaceable class="parameter">username</replaceable>' is not allowed to create/destroy databases
|
||||||
|
destroydb: database destroy failed on <replaceable class="parameter">dbname</replaceable>.
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
You do not have permission to destroy (or create) databases.
|
||||||
|
Contact your <productname>Postgres</productname> site administrator.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
ERROR: destroydb: database '<replaceable class="parameter">dbname</replaceable>' does not exist.
|
||||||
|
destroydb: database destroy failed on <replaceable class="parameter">dbname</replaceable>.
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The database to be removed does not have an entry in the
|
||||||
|
<literal>pg_database</literal> class.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
ERROR: destroydb: database '<replaceable class="parameter">dbname</replaceable>' is not owned by you.
|
||||||
|
destroydb: database destroy failed on <replaceable class="parameter">dbname</replaceable>.
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
You are not the Database Administrator (DBA) for the specified database.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
destroydb: database destroy failed on <replaceable class="parameter">dbname</replaceable>.
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
An internal error occurred in <application>psql</application>
|
||||||
|
or in the backend server. Ensure that your site administrator has
|
||||||
|
properly installed <productname>Postgres</productname>and initialized the site with
|
||||||
|
<application>initdb</application>.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
<note>
|
||||||
<para>
|
<para>
|
||||||
All references to
|
<application>destroydb</application> internally runs
|
||||||
the database are removed, including the directory containing this
|
<command>DESTROY DATABASE</command> from <application>psql</application>
|
||||||
database and its associated files.
|
while connected to the <literal>template1</literal> database.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
</note>
|
||||||
<application>destroydb</application> is a shell script that invokes
|
</refsect2>
|
||||||
<application>psql</application>.
|
</refsynopsisdiv>
|
||||||
Hence, a <application>postmaster</application>
|
|
||||||
process must be running on the database server host before
|
|
||||||
<application>destroydb</application>
|
|
||||||
is executed. The
|
|
||||||
<envar>PGOPTION</envar>
|
|
||||||
and
|
|
||||||
<envar>PGREALM</envar>
|
|
||||||
environment variables will be passed on to
|
|
||||||
<application>psql</application>
|
|
||||||
and processed as described in <xref linkend="app-psql" endterm="psql-ref">.
|
|
||||||
</para>
|
|
||||||
</refsect1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-APP-DESTROYDB-2">
|
<refsect1 id="R1-APP-DESTROYDB-1">
|
||||||
<REFSECT1INFO>
|
<refsect1info>
|
||||||
<DATE>1998-10-02</DATE>
|
<date>1998-10-02</date>
|
||||||
</REFSECT1INFO>
|
</refsect1info>
|
||||||
<TITLE>
|
<title>
|
||||||
Usage
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
To destroy the database <literal>demo</literal>
|
<application>destroydb</application> destroys an existing
|
||||||
using the postmaster on the local host, port 5432:
|
<productname>Postgres</productname> database.
|
||||||
<programlisting>
|
The person who executes this command must be
|
||||||
destroydb demo
|
the database administrator, or <acronym>DBA</acronym>,
|
||||||
</programlisting>
|
or must be the <productname>Postgres</productname> super-user.
|
||||||
</para>
|
The program runs silently; no confirmation message will be displayed.
|
||||||
<para>
|
After the database is destroyed, a Unix shell prompt will reappear.
|
||||||
To destroy the database <literal>demo</literal>
|
</para>
|
||||||
using the postmaster on host eden, port 5000:
|
<para>
|
||||||
<programlisting>
|
All references to
|
||||||
destroydb -p 5000 -h eden demo
|
the database are removed, including the directory containing this
|
||||||
</programlisting>
|
database and its associated files.
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
<para>
|
||||||
</REFENTRY>
|
<application>destroydb</application> is a shell script that invokes
|
||||||
|
<application>psql</application>.
|
||||||
|
Hence, a <application>postmaster</application>
|
||||||
|
process must be running on the database server host before
|
||||||
|
<application>destroydb</application>
|
||||||
|
is executed. The
|
||||||
|
<envar>PGOPTION</envar>
|
||||||
|
and
|
||||||
|
<envar>PGREALM</envar>
|
||||||
|
environment variables will be passed on to
|
||||||
|
<application>psql</application>
|
||||||
|
and processed as described in <xref endterm="psql-ref"
|
||||||
|
linkend="app-psql">.
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1 id="R1-APP-DESTROYDB-2">
|
||||||
|
<refsect1info>
|
||||||
|
<date>1998-10-02</date>
|
||||||
|
</refsect1info>
|
||||||
|
<title>
|
||||||
|
Usage
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
To destroy the database <literal>demo</literal>
|
||||||
|
using the postmaster on the local host, port 5432:
|
||||||
|
<programlisting>
|
||||||
|
destroydb demo
|
||||||
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
To destroy the database <literal>demo</literal>
|
||||||
|
using the postmaster on host eden, port 5000:
|
||||||
|
<programlisting>
|
||||||
|
destroydb -p 5000 -h eden demo
|
||||||
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
|
||||||
|
<!-- Keep this comment at the end of the file
|
||||||
|
Local variables:
|
||||||
|
mode: sgml
|
||||||
|
sgml-omittag:nil
|
||||||
|
sgml-shorttag:t
|
||||||
|
sgml-minimize-attributes:nil
|
||||||
|
sgml-always-quote-attributes:t
|
||||||
|
sgml-indent-step:1
|
||||||
|
sgml-indent-data:t
|
||||||
|
sgml-parent-document:nil
|
||||||
|
sgml-default-dtd-file:"../reference.ced"
|
||||||
|
sgml-exposed-tags:nil
|
||||||
|
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
||||||
|
sgml-local-ecat-files:nil
|
||||||
|
End:
|
||||||
|
-->
|
||||||
|
|
|
@ -1,244 +1,254 @@
|
||||||
<REFENTRY ID="APP-DESTROYUSER">
|
<refentry id="APP-DESTROYUSER">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
<application>destroyuser</application>
|
<application>destroyuser</application>
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>Application</REFMISCINFO>
|
<refmiscinfo>Application</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
<application>destroyuser</application>
|
<application>destroyuser</application>
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Destroy a <productname>Postgres</productname> user and associated databases
|
Destroy a <productname>Postgres</productname> user and associated databases
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-10-02</DATE>
|
<date>1998-10-02</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
destroyuser [ <replaceable class="parameter">username</replaceable> ]
|
destroyuser [ <replaceable class="parameter">username</replaceable> ]
|
||||||
destroyuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
|
destroyuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
|
||||||
[ <replaceable class="parameter">username</replaceable> ]
|
[ <replaceable class="parameter">username</replaceable> ]
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-APP-DESTROYUSER-1">
|
<refsect2 id="R2-APP-DESTROYUSER-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-10-02</DATE>
|
<date>1998-10-02</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
|
|
||||||
<variablelist>
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-h <replaceable class="parameter">host</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Specifies the hostname of the machine on which the
|
|
||||||
<application>postmaster</application>
|
|
||||||
is running. Defaults to using a local Unix domain socket
|
|
||||||
rather than an IP connection..
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-p <replaceable class="parameter">port</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Specifies the Internet TCP/IP port or local Unix domain socket file
|
|
||||||
extension on which the <application>postmaster</application>
|
|
||||||
is listening for connections. The port number defaults to 5432,
|
|
||||||
or the value of the <envar>PGPORT</envar>
|
|
||||||
environment variable (if set).
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
<replaceable class="parameter">username</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Specifies the name of the <productname>Postgres</productname> user to be removed.
|
|
||||||
This name must exist in the <productname>Postgres</productname> installation.
|
|
||||||
You will be prompted for a name if none is specified on the command line.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
</variablelist>
|
|
||||||
</para>
|
|
||||||
</refsect2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-APP-DESTROYUSER-2">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-10-02</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Outputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
<application>destroyuser</application> will remove an entry in the
|
|
||||||
<literal>pg_user</literal> or <literal>pg_shadow</literal> system table,
|
|
||||||
and will remove all databases for which that user is the administrator
|
|
||||||
(<acronym>DBA</acronym>).
|
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-h <replaceable class="parameter">host</replaceable></term>
|
||||||
Connection to database 'template1' failed.
|
<listitem>
|
||||||
connectDB() failed: Is the postmaster running and accepting connections
|
<para>
|
||||||
at 'UNIX Socket' on port '<replaceable class="parameter">port</replaceable>'?
|
Specifies the hostname of the machine on which the
|
||||||
destroyuser: database access failed.
|
<application>postmaster</application>
|
||||||
</term>
|
is running. Defaults to using a local Unix domain socket
|
||||||
<listitem>
|
rather than an IP connection.
|
||||||
<para>
|
</para>
|
||||||
<application>destroyuser</application> could not attach to the
|
</listitem>
|
||||||
<application>postmaster</application>
|
</varlistentry>
|
||||||
process on the specified host and port. If you see this message,
|
|
||||||
ensure that the <application>postmaster</application>
|
|
||||||
is running on the proper host and that you have specified the proper
|
|
||||||
port. If your site uses an authentication system, ensure that you
|
|
||||||
have obtained the required authentication credentials.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
Connection to database 'template1' failed.
|
|
||||||
FATAL 1: SetUserId: user '<replaceable class="parameter">username</replaceable>' is not in 'pg_shadow'
|
|
||||||
destroyuser: database access failed.
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
You do not have a valid entry in the relation <literal>pg_shadow</literal>
|
|
||||||
and and will not be allowed to access <productname>Postgres</productname>. Contact your
|
|
||||||
<productname>Postgres</productname> administrator.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
destroyuser: <replaceable class="parameter">username</replaceable> cannot delete users.
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
You do not have permission to delete users; contact your
|
|
||||||
<productname>Postgres</productname> site administrator.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-p <replaceable class="parameter">port</replaceable></term>
|
||||||
destroyuser: user "<replaceable class="parameter">username</replaceable>" already exists
|
<listitem>
|
||||||
</term>
|
<para>
|
||||||
<listitem>
|
Specifies the Internet TCP/IP port or local Unix domain socket file
|
||||||
<para>
|
extension on which the <application>postmaster</application>
|
||||||
The user to be added already has an entry in the <literal>pg_shadow</literal>
|
is listening for connections. The port number defaults to 5432,
|
||||||
class.
|
or the value of the <envar>PGPORT</envar>
|
||||||
</para>
|
environment variable (if set).
|
||||||
</listitem>
|
</para>
|
||||||
</varlistentry>
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
database access failed
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
An internal error occurred in <application>psql</application>
|
|
||||||
or in the backend server. Ensure that your site administrator has
|
|
||||||
properly installed <productname>Postgres</productname>and initialized the site with
|
|
||||||
<application>initdb</application>.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><replaceable class="parameter">username</replaceable></term>
|
||||||
destroydb on <replaceable class="parameter">dbname</replaceable> failed - exiting
|
<listitem>
|
||||||
</term>
|
<para>
|
||||||
<listitem>
|
Specifies the name of the <productname>Postgres</productname> user to be removed.
|
||||||
<para>
|
This name must exist in the <productname>Postgres</productname> installation.
|
||||||
An internal error occurred in <application>psql</application>
|
You will be prompted for a name if none is specified on the command line.
|
||||||
or in the backend server. There was possibly a Unix permissions problem with the
|
</para>
|
||||||
specified database.
|
</listitem>
|
||||||
</para>
|
</varlistentry>
|
||||||
</listitem>
|
</variablelist>
|
||||||
</varlistentry>
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
|
||||||
<varlistentry>
|
<refsect2 id="R2-APP-DESTROYUSER-2">
|
||||||
<term>
|
<refsect2info>
|
||||||
delete of user <replaceable class="parameter">username</replaceable> was UNSUCCESSFUL
|
<date>1998-10-02</date>
|
||||||
</term>
|
</refsect2info>
|
||||||
<listitem>
|
<title>
|
||||||
<para>
|
Outputs
|
||||||
An internal error occurred in <application>psql</application>
|
</title>
|
||||||
or in the backend server.
|
<para>
|
||||||
</para>
|
<application>destroyuser</application> will remove an entry in the
|
||||||
</listitem>
|
<literal>pg_user</literal> or <literal>pg_shadow</literal> system table,
|
||||||
</varlistentry>
|
and will remove all databases for which that user is the administrator
|
||||||
|
(<acronym>DBA</acronym>).
|
||||||
|
|
||||||
</variablelist>
|
<variablelist>
|
||||||
</para>
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
Connection to database 'template1' failed.
|
||||||
|
connectDB() failed: Is the postmaster running and accepting connections
|
||||||
|
at 'UNIX Socket' on port '<replaceable class="parameter">port</replaceable>'?
|
||||||
|
destroyuser: database access failed.
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
<application>destroyuser</application> could not attach to the
|
||||||
|
<application>postmaster</application>
|
||||||
|
process on the specified host and port. If you see this message,
|
||||||
|
ensure that the <application>postmaster</application>
|
||||||
|
is running on the proper host and that you have specified the proper
|
||||||
|
port. If your site uses an authentication system, ensure that you
|
||||||
|
have obtained the required authentication credentials.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<note>
|
<varlistentry>
|
||||||
<para>
|
<term><computeroutput>
|
||||||
<application>destroyuser</application> internally runs
|
Connection to database 'template1' failed.
|
||||||
DROP USER from <application>psql</application>
|
FATAL 1: SetUserId: user '<replaceable class="parameter">username</replaceable>' is not in 'pg_shadow'
|
||||||
while connected to the <literal>template1</literal> database.
|
destroyuser: database access failed.
|
||||||
</para>
|
</computeroutput></term>
|
||||||
</note>
|
<listitem>
|
||||||
</refsect2>
|
<para>
|
||||||
</refsynopsisdiv>
|
You do not have a valid entry in the relation <literal>pg_shadow</literal>
|
||||||
|
and and will not be allowed to access <productname>Postgres</productname>. Contact your
|
||||||
<REFSECT1 ID="R1-APP-DESTROYUSER-1">
|
<productname>Postgres</productname> administrator.
|
||||||
<REFSECT1INFO>
|
</para>
|
||||||
<DATE>1998-10-02</DATE>
|
</listitem>
|
||||||
</REFSECT1INFO>
|
</varlistentry>
|
||||||
<TITLE>
|
|
||||||
Description
|
<varlistentry>
|
||||||
</TITLE>
|
<term><computeroutput>
|
||||||
<PARA>
|
destroyuser: <replaceable class="parameter">username</replaceable> cannot delete users.
|
||||||
<application>destroyuser</application> removes an existing
|
</computeroutput></term>
|
||||||
<productname>Postgres</productname> user
|
<listitem>
|
||||||
and the databases for which that user
|
<para>
|
||||||
is database administrator.
|
You do not have permission to delete users; contact your
|
||||||
Only users with <literal>usesuper</literal> set in
|
<productname>Postgres</productname> site administrator.
|
||||||
the <literal>pg_shadow</literal> class can destroy
|
</para>
|
||||||
<productname>Postgres</productname> users. As shipped,
|
</listitem>
|
||||||
the user <literal>postgres</literal> can remove users.
|
</varlistentry>
|
||||||
</para>
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
destroyuser: user "<replaceable class="parameter">username</replaceable>" already exists
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The user to be added already has an entry in the
|
||||||
|
<literal>pg_shadow</literal> class.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
database access failed
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
An internal error occurred in <application>psql</application>
|
||||||
|
or in the backend server. Ensure that your site administrator has
|
||||||
|
properly installed <productname>Postgres</productname>and initialized the site with
|
||||||
|
<application>initdb</application>.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
destroydb on <replaceable class="parameter">dbname</replaceable> failed - exiting
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
An internal error occurred in <application>psql</application>
|
||||||
|
or in the backend server. There was possibly a Unix permissions problem with the
|
||||||
|
specified database.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
delete of user <replaceable class="parameter">username</replaceable> was UNSUCCESSFUL
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
An internal error occurred in <application>psql</application>
|
||||||
|
or in the backend server.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<note>
|
||||||
<para>
|
<para>
|
||||||
<application>destroyuser</application> is a shell script that invokes
|
<application>destroyuser</application> internally runs
|
||||||
<application>psql</application>.
|
<command>DROP USER</command> from <application>psql</application>
|
||||||
Hence, a <application>postmaster</application>
|
while connected to the <literal>template1</literal> database.
|
||||||
process must be running on the database server host before
|
|
||||||
<application>destroyuser</application> is executed.
|
|
||||||
The
|
|
||||||
<envar>PGOPTION</envar>
|
|
||||||
and
|
|
||||||
<envar>PGREALM</envar>
|
|
||||||
environment variables will be passed on to
|
|
||||||
<application>psql</application>
|
|
||||||
and processed as described in <xref linkend="app-psql" endterm="psql-ref">.
|
|
||||||
</para>
|
</para>
|
||||||
<para>
|
</note>
|
||||||
Once invoked, <application>destroyuser</application>
|
</refsect2>
|
||||||
will warn you about the databases that will be destroyed in the
|
</refsynopsisdiv>
|
||||||
process and permit you to abort the removal of the user if desired.
|
|
||||||
</para>
|
<refsect1 id="R1-APP-DESTROYUSER-1">
|
||||||
</refsect1>
|
<refsect1info>
|
||||||
</REFENTRY>
|
<date>1998-10-02</date>
|
||||||
|
</refsect1info>
|
||||||
|
<title>
|
||||||
|
Description
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
<application>destroyuser</application> removes an existing
|
||||||
|
<productname>Postgres</productname> user
|
||||||
|
and the databases for which that user
|
||||||
|
is database administrator.
|
||||||
|
Only users with <literal>usesuper</literal> set in
|
||||||
|
the <literal>pg_shadow</literal> class can destroy
|
||||||
|
<productname>Postgres</productname> users. As shipped,
|
||||||
|
the user <literal>postgres</literal> can remove users.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
<application>destroyuser</application> is a shell script that invokes
|
||||||
|
<application>psql</application>.
|
||||||
|
Hence, a <application>postmaster</application>
|
||||||
|
process must be running on the database server host before
|
||||||
|
<application>destroyuser</application> is executed.
|
||||||
|
The
|
||||||
|
<envar>PGOPTION</envar>
|
||||||
|
and
|
||||||
|
<envar>PGREALM</envar>
|
||||||
|
environment variables will be passed on to
|
||||||
|
<application>psql</application>
|
||||||
|
and processed as described in <xref endterm="psql-ref"
|
||||||
|
linkend="app-psql">.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Once invoked, <application>destroyuser</application>
|
||||||
|
will warn you about the databases that will be destroyed in the
|
||||||
|
process and permit you to abort the removal of the user if desired.
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
|
||||||
|
<!-- Keep this comment at the end of the file
|
||||||
|
Local variables:
|
||||||
|
mode: sgml
|
||||||
|
sgml-omittag:nil
|
||||||
|
sgml-shorttag:t
|
||||||
|
sgml-minimize-attributes:nil
|
||||||
|
sgml-always-quote-attributes:t
|
||||||
|
sgml-indent-step:1
|
||||||
|
sgml-indent-data:t
|
||||||
|
sgml-parent-document:nil
|
||||||
|
sgml-default-dtd-file:"../reference.ced"
|
||||||
|
sgml-exposed-tags:nil
|
||||||
|
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
||||||
|
sgml-local-ecat-files:nil
|
||||||
|
End:
|
||||||
|
-->
|
||||||
|
|
|
@ -1,168 +1,164 @@
|
||||||
<REFENTRY ID="SQL-DROPAGGREGATE">
|
<refentry id="SQL-DROPAGGREGATE">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
DROP AGGREGATE
|
DROP AGGREGATE
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
DROP AGGREGATE
|
DROP AGGREGATE
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Removes the definition of an aggregate function
|
Removes the definition of an aggregate function
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
DROP AGGREGATE <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">type</REPLACEABLE>
|
DROP AGGREGATE <replaceable class="PARAMETER">name</replaceable> <replaceable class="PARAMETER">type</replaceable>
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPAGGREGATE-1">
|
<refsect2 id="R2-SQL-DROPAGGREGATE-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</PARA>
|
<variablelist>
|
||||||
<VARIABLELIST>
|
<varlistentry>
|
||||||
<VARLISTENTRY>
|
<term><replaceable class="parameter">name</replaceable></term>
|
||||||
<TERM>
|
<listitem>
|
||||||
<replaceable class="parameter">name</replaceable>
|
<para>
|
||||||
</TERM>
|
The name of an existing aggregate function.
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The name of an existing aggregate function.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">type</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The type of an existing aggregate function.
|
|
||||||
(Refer to the <citetitle>PostgreSQL User's Guide</citetitle> for
|
|
||||||
further information about data types).
|
|
||||||
<comment>This should become a cross-reference rather than a
|
|
||||||
hard-coded chapter number</comment>
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
</variablelist>
|
|
||||||
</REFSECT2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPAGGREGATE-2">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-04-15</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Outputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>DROP</ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Message returned if the command is successful.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>WARN RemoveAggregate: aggregate '<replaceable class="parameter">name</replaceable>' for '<replaceable class="parameter">type</replaceable>' does not exist</ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
This message occurs if the aggregate function specified does not
|
|
||||||
exist in the database.
|
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</VARIABLELIST>
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">type</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The type of an existing aggregate function.
|
||||||
|
(Refer to the <citetitle>PostgreSQL User's Guide</citetitle> for
|
||||||
|
further information about data types).
|
||||||
|
<comment>This should become a cross-reference rather than a
|
||||||
|
hard-coded chapter number</comment>
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</REFSYNOPSISDIV>
|
|
||||||
|
<refsect2 id="R2-SQL-DROPAGGREGATE-2">
|
||||||
<REFSECT1 ID="R1-SQL-DROPAGGREGATE-1">
|
<refsect2info>
|
||||||
<REFSECT1INFO>
|
<date>1998-04-15</date>
|
||||||
<DATE>1998-04-15</DATE>
|
</refsect2info>
|
||||||
</REFSECT1INFO>
|
<title>
|
||||||
<TITLE>
|
Outputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
DROP
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Message returned if the command is successful.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
WARN RemoveAggregate: aggregate '<replaceable class="parameter">agg</replaceable>' for '<replaceable class="parameter">type</replaceable>' does not exist
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
This message occurs if the aggregate function specified does not
|
||||||
|
exist in the database.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-DROPAGGREGATE-1">
|
||||||
|
<refsect1info>
|
||||||
|
<date>1998-04-15</date>
|
||||||
|
</refsect1info>
|
||||||
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<command>DROP AGGREGATE</command> will remove all references to an existing
|
<command>DROP AGGREGATE</command> will remove all references to an existing
|
||||||
aggregate definition. To execute this command the current
|
aggregate definition. To execute this command the current
|
||||||
user must be the owner of the aggregate.
|
user must be the owner of the aggregate.
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPAGGREGATE-3">
|
<refsect2 id="R2-SQL-DROPAGGREGATE-3">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Notes
|
Notes
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
The <command>DROP AGGREGATE</command> statement is a
|
The <command>DROP AGGREGATE</command> statement is a
|
||||||
<productname>Postgres</productname>
|
<productname>Postgres</productname>
|
||||||
language extension.
|
language extension.
|
||||||
</PARA>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
Refer to the <command>CREATE AGGREGATE</command> statement to
|
Refer to the <command>CREATE AGGREGATE</command> statement to
|
||||||
create aggregate functions.
|
create aggregate functions.
|
||||||
</PARA>
|
</para>
|
||||||
</REFSECT2>
|
|
||||||
</REFSECT1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DROPAGGREGATE-2">
|
|
||||||
<TITLE>
|
|
||||||
Usage
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
To remove the <literal>myavg</literal> aggregate for type
|
|
||||||
<literal>int4</literal>:
|
|
||||||
</PARA>
|
|
||||||
<ProgramListing>
|
|
||||||
DROP AGGREGATE myavg int4;
|
|
||||||
</ProgramListing>
|
|
||||||
</REFSECT1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DROPAGGREGATE-3">
|
|
||||||
<TITLE>
|
|
||||||
Compatibility
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
</PARA>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPAGGREGATE-4">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-04-15</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
SQL92
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
There is no DROP AGGREGATE statement in <acronym>SQL92</acronym>.
|
|
||||||
</PARA>
|
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
|
||||||
|
<refsect1 id="R1-SQL-DROPAGGREGATE-2">
|
||||||
|
<title>
|
||||||
|
Usage
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
To remove the <literal>myavg</literal> aggregate for type
|
||||||
|
<literal>int4</literal>:
|
||||||
|
</para>
|
||||||
|
<programlisting>
|
||||||
|
DROP AGGREGATE myavg int4;
|
||||||
|
</programlisting>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-DROPAGGREGATE-3">
|
||||||
|
<title>
|
||||||
|
Compatibility
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<refsect2 id="R2-SQL-DROPAGGREGATE-4">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-04-15</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
SQL92
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
There is no DROP AGGREGATE statement in <acronym>SQL92</acronym>.
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
mode: sgml
|
mode: sgml
|
||||||
sgml-omittag:t
|
sgml-omittag:nil
|
||||||
sgml-shorttag:t
|
sgml-shorttag:t
|
||||||
sgml-minimize-attributes:nil
|
sgml-minimize-attributes:nil
|
||||||
sgml-always-quote-attributes:t
|
sgml-always-quote-attributes:t
|
||||||
|
|
|
@ -1,161 +1,159 @@
|
||||||
<REFENTRY ID="SQL-DROPDATABASE">
|
<refentry id="SQL-DROPDATABASE">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
DROP DATABASE
|
DROP DATABASE
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
DROP DATABASE
|
DROP DATABASE
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Destroys an existing database
|
Destroys an existing database
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
DROP DATABASE <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE>
|
DROP DATABASE <replaceable class="PARAMETER">name</replaceable>
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPDATABASE-1">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-04-15</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Inputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
</PARA>
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue><REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE></ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The name of an existing database to remove.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
</variablelist>
|
|
||||||
</REFSECT2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPDATABASE-2">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-04-15</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Outputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
|
|
||||||
<VARIABLELIST>
|
<refsect2 id="R2-SQL-DROPDATABASE-1">
|
||||||
<VARLISTENTRY>
|
<refsect2info>
|
||||||
<TERM>
|
<date>1998-04-15</date>
|
||||||
<ReturnValue>DESTROYDB</ReturnValue>
|
</refsect2info>
|
||||||
</TERM>
|
<title>
|
||||||
<LISTITEM>
|
Inputs
|
||||||
<PARA>
|
</title>
|
||||||
This message is returned if the command is successful.
|
<para>
|
||||||
</PARA>
|
<variablelist>
|
||||||
</LISTITEM>
|
<varlistentry>
|
||||||
</VARLISTENTRY>
|
<term><replaceable class="PARAMETER">name</replaceable></term>
|
||||||
<VARLISTENTRY>
|
<listitem>
|
||||||
<TERM>
|
<para>
|
||||||
<ReturnValue>WARN: destroydb: database "<replaceable class="parameter">name</replaceable>" does not exist.</ReturnValue>
|
The name of an existing database to remove.
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
This message occurs if the specified database does not exist.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>ERROR: destroydb cannot be executed on an open database</ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
This message occurs if the specified database does not exist.
|
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</VARIABLELIST>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</REFSYNOPSISDIV>
|
|
||||||
|
<refsect2 id="R2-SQL-DROPDATABASE-2">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-04-15</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
Outputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
DESTROYDB
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
This message is returned if the command is successful.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
WARN: destroydb: database "<replaceable class="parameter">name</replaceable>" does not exist.
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
This message occurs if the specified database does not exist.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
ERROR: destroydb cannot be executed on an open database
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
This message occurs if the specified database does not exist.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DROPDATABASE-1">
|
<refsect1 id="R1-SQL-DROPDATABASE-1">
|
||||||
<REFSECT1INFO>
|
<refsect1info>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSECT1INFO>
|
</refsect1info>
|
||||||
<TITLE>
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<command>DROP DATABASE</command> removes the catalog entries for an existing
|
<command>DROP DATABASE</command> removes the catalog entries for an existing
|
||||||
database and deletes the directory containing the data.
|
database and deletes the directory containing the data.
|
||||||
It can only be executed by the database administrator
|
It can only be executed by the database administrator
|
||||||
(See the <command>CREATE DATABASE</command> command for details).
|
(See the <command>CREATE DATABASE</command> command for details).
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPDATABASE-3">
|
<refsect2 id="R2-SQL-DROPDATABASE-3">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Notes
|
Notes
|
||||||
</TITLE>
|
</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
DROP DATABASE statement is a <productname>Postgres</productname>
|
<command>DROP DATABASE</command> statement is a <productname>Postgres</productname>
|
||||||
language extension.
|
language extension.
|
||||||
|
|
||||||
<tip>
|
<tip>
|
||||||
<para>
|
<para>
|
||||||
This query cannot be executed while connected to the target
|
This query cannot be executed while connected to the target
|
||||||
database. It is usually preferable to use the
|
database. It is usually preferable to use the
|
||||||
<command>destroydb</command> script instead.
|
<command>destroydb</command> script instead.
|
||||||
</para>
|
</para>
|
||||||
</tip>
|
</tip>
|
||||||
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Refer to the <command>CREATE DATABASE</command> statement for
|
Refer to the <command>CREATE DATABASE</command> statement for
|
||||||
information on how to create a database.
|
information on how to create a database.
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</REFSECT1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DROPDATABASE-3">
|
|
||||||
<TITLE>
|
|
||||||
Compatibility
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
</PARA>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPDATABASE-4">
|
<refsect1 id="R1-SQL-DROPDATABASE-3">
|
||||||
<REFSECT2INFO>
|
<title>
|
||||||
<DATE>1998-04-15</DATE>
|
Compatibility
|
||||||
</REFSECT2INFO>
|
</title>
|
||||||
<TITLE>
|
<para>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<refsect2 id="R2-SQL-DROPDATABASE-4">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-04-15</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
SQL92
|
SQL92
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
There is no <command>DROP DATABASE</command> in <acronym>SQL92</acronym>.
|
There is no <command>DROP DATABASE</command> in <acronym>SQL92</acronym>.
|
||||||
</PARA>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
</refentry>
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
mode: sgml
|
mode: sgml
|
||||||
sgml-omittag:t
|
sgml-omittag:nil
|
||||||
sgml-shorttag:t
|
sgml-shorttag:t
|
||||||
sgml-minimize-attributes:nil
|
sgml-minimize-attributes:nil
|
||||||
sgml-always-quote-attributes:t
|
sgml-always-quote-attributes:t
|
||||||
|
|
|
@ -1,179 +1,173 @@
|
||||||
<REFENTRY ID="SQL-DROPFUNCTION">
|
<refentry id="SQL-DROPFUNCTION">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
DROP FUNCTION
|
DROP FUNCTION
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
DROP FUNCTION
|
DROP FUNCTION
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Removes a user-defined C function
|
Removes a user-defined C function
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
DROP FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceable class="parameter">type</replaceable> [, ...] ] )
|
DROP FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceable class="parameter">type</replaceable> [, ...] ] )
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPFUNCTION-1">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-04-15</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Inputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
</PARA>
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter"> name</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The name of an existing function.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">type</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The type of function parameters.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
</variablelist>
|
|
||||||
</REFSECT2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPFUNCTION-2">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-04-15</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Outputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
|
|
||||||
<VARIABLELIST>
|
<refsect2 id="R2-SQL-DROPFUNCTION-1">
|
||||||
<VARLISTENTRY>
|
<refsect2info>
|
||||||
<TERM>
|
<date>1998-04-15</date>
|
||||||
<ReturnValue>DROP</ReturnValue>
|
</refsect2info>
|
||||||
</TERM>
|
<title>
|
||||||
<LISTITEM>
|
Inputs
|
||||||
<PARA>
|
</title>
|
||||||
Message returned if the command completes successfully.
|
<para>
|
||||||
</PARA>
|
<variablelist>
|
||||||
</LISTITEM>
|
<varlistentry>
|
||||||
</VARLISTENTRY>
|
<term><replaceable class="parameter"> name</replaceable></term>
|
||||||
<VARLISTENTRY>
|
<listitem>
|
||||||
<TERM>
|
<para>
|
||||||
<ReturnValue>WARN RemoveFunction: Function "<replaceable class="parameter">name</replaceable>" ("<replaceable class="parameter">types</replaceable>") does not exist</ReturnValue>
|
The name of an existing function.
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
This message is given if the function specified does not
|
|
||||||
exist in the current database.
|
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</VARIABLELIST>
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">type</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The type of function parameters.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</REFSYNOPSISDIV>
|
|
||||||
|
<refsect2 id="R2-SQL-DROPFUNCTION-2">
|
||||||
<REFSECT1 ID="R1-SQL-DROPFUNCTION-1">
|
<refsect2info>
|
||||||
<REFSECT1INFO>
|
<date>1998-04-15</date>
|
||||||
<DATE>1998-04-15</DATE>
|
</refsect2info>
|
||||||
</REFSECT1INFO>
|
<title>
|
||||||
<TITLE>
|
Outputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
DROP
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Message returned if the command completes successfully.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
WARN RemoveFunction: Function "<replaceable class="parameter">name</replaceable>" ("<replaceable class="parameter">types</replaceable>") does not exist
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
This message is given if the function specified does not
|
||||||
|
exist in the current database.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-DROPFUNCTION-1">
|
||||||
|
<refsect1info>
|
||||||
|
<date>1998-04-15</date>
|
||||||
|
</refsect1info>
|
||||||
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
DROP FUNCTION will remove references to an existing C
|
DROP FUNCTION will remove references to an existing C
|
||||||
function. To execute this command the user must be the
|
function. To execute this command the user must be the
|
||||||
owner of the function. The input argument types to the
|
owner of the function. The input argument types to the
|
||||||
function must be specified, as only the function with the
|
function must be specified, as only the function with the
|
||||||
given name and argument types will be removed.
|
given name and argument types will be removed.
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPFUNCTION-3">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-04-15</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Notes
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
Refer to <citerefentry>
|
|
||||||
<refentrytitle>
|
|
||||||
CREATE FUNCTION
|
|
||||||
</refentrytitle>
|
|
||||||
</citerefentry>
|
|
||||||
to create aggregate functions.
|
|
||||||
</PARA>
|
|
||||||
</REFSECT2>
|
|
||||||
</refsect1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DROPFUNCTION-2">
|
|
||||||
<TITLE>
|
|
||||||
Usage
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
This command removes the square root function:
|
|
||||||
</PARA>
|
|
||||||
<ProgramListing>
|
|
||||||
DROP FUNCTION sqrt(int4);
|
|
||||||
</ProgramListing>
|
|
||||||
</REFSECT1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DROPFUNCTION-3">
|
<refsect2 id="R2-SQL-DROPFUNCTION-3">
|
||||||
<TITLE>
|
<refsect2info>
|
||||||
Bugs
|
<date>1998-04-15</date>
|
||||||
</TITLE>
|
</refsect2info>
|
||||||
<PARA>
|
<title>
|
||||||
No checks are made to ensure that types, operators or access
|
Notes
|
||||||
methods that rely on the function have been removed first.
|
</title>
|
||||||
</PARA>
|
<para>
|
||||||
</REFSECT1>
|
Refer to <command>CREATE FUNCTION</command>
|
||||||
|
to create aggregate functions.
|
||||||
<REFSECT1 ID="R1-SQL-DROPFUNCTION-4">
|
</para>
|
||||||
<TITLE>
|
|
||||||
Compatibility
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
DROP FUNCTION is a <productname>Postgres</productname> language extension.
|
|
||||||
</PARA>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPFUNCTION-4">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-04-15</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
SQL/PSM
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
SQL/PSM is a proposed standard to enable function extensibility.
|
|
||||||
The SQL/PSM DROP FUNCTION statement has the following syntax:
|
|
||||||
<programlisting>
|
|
||||||
DROP [ SPECIFIC ] FUNCTION <replaceable class="parameter">name</replaceable> { RESTRICT | CASCADE }</programlisting>
|
|
||||||
</PARA>
|
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
|
||||||
|
<refsect1 id="R1-SQL-DROPFUNCTION-2">
|
||||||
|
<title>
|
||||||
|
Usage
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
This command removes the square root function:
|
||||||
|
|
||||||
|
<programlisting>
|
||||||
|
DROP FUNCTION sqrt(int4);
|
||||||
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-DROPFUNCTION-3">
|
||||||
|
<title>
|
||||||
|
Bugs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
No checks are made to ensure that types, operators or access
|
||||||
|
methods that rely on the function have been removed first.
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-DROPFUNCTION-4">
|
||||||
|
<title>
|
||||||
|
Compatibility
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
DROP FUNCTION is a <productname>Postgres</productname> language extension.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<refsect2 id="R2-SQL-DROPFUNCTION-4">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-04-15</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
SQL/PSM
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
SQL/PSM is a proposed standard to enable function extensibility.
|
||||||
|
The SQL/PSM DROP FUNCTION statement has the following syntax:
|
||||||
|
<programlisting>
|
||||||
|
DROP [ SPECIFIC ] FUNCTION <replaceable class="parameter">name</replaceable> { RESTRICT | CASCADE }
|
||||||
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
mode: sgml
|
mode: sgml
|
||||||
sgml-omittag:t
|
sgml-omittag:nil
|
||||||
sgml-shorttag:t
|
sgml-shorttag:t
|
||||||
sgml-minimize-attributes:nil
|
sgml-minimize-attributes:nil
|
||||||
sgml-always-quote-attributes:t
|
sgml-always-quote-attributes:t
|
||||||
|
|
|
@ -1,157 +1,156 @@
|
||||||
<REFENTRY ID="SQL-DROPINDEX">
|
<refentry id="SQL-DROPINDEX">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
DROP INDEX
|
DROP INDEX
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
DROP INDEX
|
DROP INDEX
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Removes an index from a database
|
Removes an index from a database
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
DROP INDEX <REPLACEABLE CLASS="PARAMETER">index_name</REPLACEABLE>
|
DROP INDEX <replaceable class="PARAMETER">index_name</replaceable>
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPINDEX-1">
|
<refsect2 id="R2-SQL-DROPINDEX-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</PARA>
|
<variablelist>
|
||||||
<VARIABLELIST>
|
<varlistentry>
|
||||||
<VARLISTENTRY>
|
<term><replaceable class="PARAMETER">index_name</replaceable></term>
|
||||||
<TERM>
|
<listitem>
|
||||||
<ReturnValue><REPLACEABLE CLASS="PARAMETER">index_name</REPLACEABLE></ReturnValue>
|
<para>
|
||||||
</TERM>
|
The name of the index to remove.
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The name of the index to remove.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
</variablelist>
|
|
||||||
</REFSECT2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPINDEX-2">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-04-15</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Outputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>DROP</ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The message returned if the index is successfully dropped.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>ERROR: index "<REPLACEABLE CLASS="PARAMETER">index_name</REPLACEABLE>" nonexistent</ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
This message occurs if <REPLACEABLE CLASS="PARAMETER">index_name</REPLACEABLE>
|
|
||||||
is not an index in the database.
|
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</VARIABLELIST>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</REFSYNOPSISDIV>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DROPINDEX-1">
|
<refsect2 id="R2-SQL-DROPINDEX-2">
|
||||||
<REFSECT1INFO>
|
<refsect2info>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSECT1INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
|
Outputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
DROP
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The message returned if the index is successfully dropped.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
ERROR: index "<replaceable class="PARAMETER">index_name</replaceable>" nonexistent
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
This message occurs if <replaceable class="PARAMETER">index_name</replaceable>
|
||||||
|
is not an index in the database.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-DROPINDEX-1">
|
||||||
|
<refsect1info>
|
||||||
|
<date>1998-04-15</date>
|
||||||
|
</refsect1info>
|
||||||
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<command>DROP INDEX</command> drops an existing index from the database
|
<command>DROP INDEX</command> drops an existing index from the database
|
||||||
system. To execute this command you must be the owner of
|
system. To execute this command you must be the owner of
|
||||||
the index.
|
the index.
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPINDEX-3">
|
<refsect2 id="R2-SQL-DROPINDEX-3">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Notes
|
Notes
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<command>DROP INDEX</command> is a <productname>Postgres</productname>
|
<command>DROP INDEX</command> is a <productname>Postgres</productname>
|
||||||
language extension.
|
language extension.
|
||||||
</PARA>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
Refer to the <command>CREATE INDEX</command> statement for
|
Refer to the <command>CREATE INDEX</command> statement for
|
||||||
information on how to create indexes.
|
information on how to create indexes.
|
||||||
</PARA>
|
</para>
|
||||||
</REFSECT2>
|
|
||||||
</refsect1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DROPINDEX-2">
|
|
||||||
<TITLE>
|
|
||||||
Usage
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
This command will remove the <literal>title_idx</literal> index:
|
|
||||||
</PARA>
|
|
||||||
<ProgramListing>
|
|
||||||
DROP INDEX title_idx;
|
|
||||||
</ProgramListing>
|
|
||||||
</REFSECT1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DROPINDEX-3">
|
|
||||||
<TITLE>
|
|
||||||
Compatibility
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
</PARA>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPINDEX-4">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-04-15</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
SQL92
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
<acronym>SQL92</acronym> defines commands by which to access
|
|
||||||
a generic relational database.
|
|
||||||
Indexes are an implementation-dependent feature and hence
|
|
||||||
there are no index-specific commands or definitions in the
|
|
||||||
<acronym>SQL92</acronym> language.
|
|
||||||
</PARA>
|
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
|
||||||
|
<refsect1 id="R1-SQL-DROPINDEX-2">
|
||||||
|
<title>
|
||||||
|
Usage
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
This command will remove the <literal>title_idx</literal> index:
|
||||||
|
|
||||||
|
<programlisting>
|
||||||
|
DROP INDEX title_idx;
|
||||||
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-DROPINDEX-3">
|
||||||
|
<title>
|
||||||
|
Compatibility
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<refsect2 id="R2-SQL-DROPINDEX-4">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-04-15</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
SQL92
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
<acronym>SQL92</acronym> defines commands by which to access
|
||||||
|
a generic relational database.
|
||||||
|
Indexes are an implementation-dependent feature and hence
|
||||||
|
there are no index-specific commands or definitions in the
|
||||||
|
<acronym>SQL92</acronym> language.
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
mode: sgml
|
mode: sgml
|
||||||
sgml-omittag:t
|
sgml-omittag:nil
|
||||||
sgml-shorttag:t
|
sgml-shorttag:t
|
||||||
sgml-minimize-attributes:nil
|
sgml-minimize-attributes:nil
|
||||||
sgml-always-quote-attributes:t
|
sgml-always-quote-attributes:t
|
||||||
|
|
|
@ -1,172 +1,170 @@
|
||||||
<REFENTRY ID="SQL-DROPLANGUAGE">
|
<refentry id="SQL-DROPLANGUAGE">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
DROP LANGUAGE
|
DROP LANGUAGE
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
DROP LANGUAGE
|
DROP LANGUAGE
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Removes a user-defined procedural language
|
Removes a user-defined procedural language
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
DROP PROCEDURAL LANGUAGE '<REPLACEABLE CLASS="PARAMETER">langname</REPLACEABLE>'
|
DROP PROCEDURAL LANGUAGE '<replaceable class="PARAMETER">name</replaceable>'
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPLANGUAGE-1">
|
<refsect2 id="R2-SQL-DROPLANGUAGE-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</PARA>
|
|
||||||
<VARIABLELIST>
|
<variablelist>
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term><replaceable class="PARAMETER">name</replaceable></term>
|
||||||
<REPLACEABLE CLASS="PARAMETER">langname</REPLACEABLE>
|
<listitem>
|
||||||
</TERM>
|
<para>
|
||||||
<LISTITEM>
|
The name of an existing procedural language.
|
||||||
<PARA>
|
|
||||||
The name of an existing language.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
</variablelist>
|
|
||||||
</REFSECT2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPLANGUAGE-2">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-04-15</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Outputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>DROP</ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
This message is returned if the language is successfully dropped.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>
|
|
||||||
ERROR: Language "<replaceable class="parameter">langname</replaceable>" doesn't exist</ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
This message occurs if the language
|
|
||||||
"<replaceable class="parameter">langname</replaceable>" is
|
|
||||||
not found.
|
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</VARIABLELIST>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
|
||||||
</REFSYNOPSISDIV>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DROPLANGUAGE-1">
|
|
||||||
<REFSECT1INFO>
|
|
||||||
<DATE>1998-04-15</DATE>
|
|
||||||
</REFSECT1INFO>
|
|
||||||
<TITLE>
|
|
||||||
Description
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
<command>DROP PROCEDURAL LANGUAGE</command> will remove the definition
|
|
||||||
of the previously registered procedural language having the name
|
|
||||||
'<replaceable class="parameter">langname</replaceable>'.
|
|
||||||
</PARA>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPLANGUAGE-3">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-04-15</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Notes
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
The <command>DROP PROCEDURAL LANGUAGE</command> statement is
|
|
||||||
a <productname>Postgres</productname> language extension.
|
|
||||||
</PARA>
|
|
||||||
<PARA>
|
|
||||||
Refer to <command>CREATE PROCEDURAL LANGUAGE</command>
|
|
||||||
for information on how to create procedural languages.
|
|
||||||
</PARA>
|
|
||||||
</refsect2>
|
</refsect2>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPLANGUAGE-4">
|
<refsect2 id="R2-SQL-DROPLANGUAGE-2">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
|
Outputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
DROP
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
This message is returned if the language is successfully dropped.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
ERROR: Language "<replaceable class="parameter">name</replaceable>" doesn't exist
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
This message occurs if a language called
|
||||||
|
<replaceable class="parameter">name</replaceable> is
|
||||||
|
not found in the database.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-DROPLANGUAGE-1">
|
||||||
|
<refsect1info>
|
||||||
|
<date>1998-04-15</date>
|
||||||
|
</refsect1info>
|
||||||
|
<title>
|
||||||
|
Description
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
<command>DROP PROCEDURAL LANGUAGE</command> will remove the definition
|
||||||
|
of the previously registered procedural language called
|
||||||
|
<replaceable class="parameter">name</replaceable>.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<refsect2 id="R2-SQL-DROPLANGUAGE-3">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-04-15</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
Notes
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
The <command>DROP PROCEDURAL LANGUAGE</command> statement is
|
||||||
|
a <productname>Postgres</productname> language extension.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Refer to <command>CREATE PROCEDURAL LANGUAGE</command>
|
||||||
|
for information on how to create procedural languages.
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
|
||||||
|
<refsect2 id="R2-SQL-DROPLANGUAGE-4">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-04-15</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
Bugs
|
Bugs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
No checks are made if functions or trigger procedures registered
|
No checks are made if functions or trigger procedures registered
|
||||||
in this language still exist. To re-enable them without having
|
in this language still exist. To re-enable them without having
|
||||||
to drop and recreate all the functions, the pg_proc's prolang
|
to drop and recreate all the functions, the pg_proc's prolang
|
||||||
attribute of the functions must be adjusted to the new object
|
attribute of the functions must be adjusted to the new object
|
||||||
ID of the recreated pg_language entry for the PL.
|
ID of the recreated pg_language entry for the PL.
|
||||||
</PARA>
|
</para>
|
||||||
</REFSECT2>
|
|
||||||
</refsect1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DROPLANGUAGE-2">
|
|
||||||
<TITLE>
|
|
||||||
Usage
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
This command removes the PL/Sample language:
|
|
||||||
</PARA>
|
|
||||||
<ProgramListing>
|
|
||||||
DROP PROCEDURAL LANGUAGE 'plsample'
|
|
||||||
</ProgramListing>
|
|
||||||
</REFSECT1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DROPLANGUAGE-3">
|
|
||||||
<TITLE>
|
|
||||||
Compatibility
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
</PARA>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPLANGUAGE-5">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-04-15</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
SQL92
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
There is no <command>DROP PROCEDURAL LANGUAGE</command> in
|
|
||||||
<acronym>SQL92</acronym>.
|
|
||||||
</PARA>
|
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
|
||||||
|
<refsect1 id="R1-SQL-DROPLANGUAGE-2">
|
||||||
|
<title>
|
||||||
|
Usage
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
This command removes the PL/Sample language:
|
||||||
|
|
||||||
|
<programlisting>
|
||||||
|
DROP PROCEDURAL LANGUAGE 'plsample';
|
||||||
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-DROPLANGUAGE-3">
|
||||||
|
<title>
|
||||||
|
Compatibility
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<refsect2 id="R2-SQL-DROPLANGUAGE-5">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-04-15</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
SQL92
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
There is no <command>DROP PROCEDURAL LANGUAGE</command> in
|
||||||
|
<acronym>SQL92</acronym>.
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
mode: sgml
|
mode: sgml
|
||||||
sgml-omittag:t
|
sgml-omittag:nil
|
||||||
sgml-shorttag:t
|
sgml-shorttag:t
|
||||||
sgml-minimize-attributes:nil
|
sgml-minimize-attributes:nil
|
||||||
sgml-always-quote-attributes:t
|
sgml-always-quote-attributes:t
|
||||||
|
|
|
@ -1,207 +1,204 @@
|
||||||
<REFENTRY ID="SQL-DROPOPERATOR">
|
<refentry id="SQL-DROPOPERATOR">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
DROP OPERATOR
|
DROP OPERATOR
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
DROP OPERATOR
|
DROP OPERATOR
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Removes an operator from the database
|
Removes an operator from the database
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
|
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
DROP OPERATOR <REPLACEABLE CLASS="PARAMETER">id</REPLACEABLE> ( <REPLACEABLE CLASS="PARAMETER">type</REPLACEABLE> | NONE [,...] )
|
DROP OPERATOR <replaceable class="PARAMETER">id</replaceable> ( <replaceable class="PARAMETER">type</replaceable> | NONE [,...] )
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPOPERATOR-1">
|
<refsect2 id="R2-SQL-DROPOPERATOR-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</PARA>
|
<variablelist>
|
||||||
<VARIABLELIST>
|
<varlistentry>
|
||||||
<VARLISTENTRY>
|
<term><replaceable class="parameter">id</replaceable></term>
|
||||||
<TERM>
|
<listitem>
|
||||||
<replaceable class="parameter">id</replaceable>
|
<para>
|
||||||
</TERM>
|
The identifier of an existing operator.
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The identifier of an existing operator.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<replaceable class="parameter">type</replaceable>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The type of function parameters.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
</variablelist>
|
|
||||||
</REFSECT2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPOPERATOR-2">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-09-22</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Outputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>DROP</ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The message returned if the command is successful.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>ERROR: RemoveOperator: binary operator '<REPLACEABLE CLASS="PARAMETER">id</REPLACEABLE>' taking '<REPLACEABLE CLASS="PARAMETER">type1</REPLACEABLE>' and '<REPLACEABLE CLASS="PARAMETER">type2</REPLACEABLE>' does not exist</ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
This message occurs if the specified binary operator does not exist.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>ERROR: RemoveOperator: left unary operator '<REPLACEABLE CLASS="PARAMETER">id</REPLACEABLE>' taking '<REPLACEABLE CLASS="PARAMETER">type</REPLACEABLE>' does not exist</ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
This message occurs if the specified left unary operator
|
|
||||||
specified does not exist.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>ERROR: RemoveOperator: right unary operator '<REPLACEABLE CLASS="PARAMETER">id</REPLACEABLE>' taking '<REPLACEABLE CLASS="PARAMETER">type</REPLACEABLE>' does not exist</ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
This message occurs if the specified right unary operator
|
|
||||||
specified does not exist.
|
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</VARIABLELIST>
|
<varlistentry>
|
||||||
|
<term><replaceable class="parameter">type</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The type of function parameters.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</REFSYNOPSISDIV>
|
|
||||||
|
<refsect2 id="R2-SQL-DROPOPERATOR-2">
|
||||||
<REFSECT1 ID="R1-SQL-DROPOPERATOR-1">
|
<refsect2info>
|
||||||
<REFSECT1INFO>
|
<date>1998-09-22</date>
|
||||||
<DATE>1998-09-22</DATE>
|
</refsect2info>
|
||||||
</REFSECT1INFO>
|
<title>
|
||||||
<TITLE>
|
Outputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
DROP
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The message returned if the command is successful.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
ERROR: RemoveOperator: binary operator '<replaceable class="PARAMETER">oper</replaceable>' taking '<replaceable class="PARAMETER">type</replaceable>' and '<replaceable class="PARAMETER">type2</replaceable>' does not exist
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
This message occurs if the specified binary operator does not exist.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
ERROR: RemoveOperator: left unary operator '<replaceable class="PARAMETER">oper</replaceable>' taking '<replaceable class="PARAMETER">type</replaceable>' does not exist
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
This message occurs if the specified left unary operator
|
||||||
|
specified does not exist.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
ERROR: RemoveOperator: right unary operator '<replaceable class="PARAMETER">oper</replaceable>' taking '<replaceable class="PARAMETER">type</replaceable>' does not exist
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
This message occurs if the specified right unary operator
|
||||||
|
specified does not exist.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-DROPOPERATOR-1">
|
||||||
|
<refsect1info>
|
||||||
|
<date>1998-09-22</date>
|
||||||
|
</refsect1info>
|
||||||
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
The DROP OPERATOR statement drops an existing operator from the
|
<command>DROP OPERATOR</command> drops an existing operator from the
|
||||||
database.
|
database.
|
||||||
To execute this command you must be the owner of the operator.
|
To execute this command you must be the owner of the operator.
|
||||||
</PARA>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
The left or right type of a left or right unary
|
The left or right type of a left or right unary
|
||||||
operator, respectively, may be specified as NONE.
|
operator, respectively, may be specified as <literal>NONE</literal>.
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPOPERATOR-3">
|
<refsect2 id="R2-SQL-DROPOPERATOR-3">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Notes
|
Notes
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
The <command>DROP OPERATOR</command> statement is a
|
The <command>DROP OPERATOR</command> statement is a
|
||||||
<productname>Postgres</productname>
|
<productname>Postgres</productname>
|
||||||
language extension.
|
language extension.
|
||||||
</PARA>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
Refer to <command>CREATE OPERATOR</command> for
|
Refer to <command>CREATE OPERATOR</command> for
|
||||||
information on how to create operators.
|
information on how to create operators.
|
||||||
</PARA>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
It is the user's responsibility to remove any access methods and
|
It is the user's responsibility to remove any access methods and
|
||||||
operator classes that rely on the deleted operator.
|
operator classes that rely on the deleted operator.
|
||||||
</PARA>
|
</para>
|
||||||
</REFSECT2>
|
|
||||||
</refsect1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DROPOPERATOR-2">
|
|
||||||
<TITLE>
|
|
||||||
Usage
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
Remove power operator <literal>a^n</literal> for <literal>int4</literal>:
|
|
||||||
</PARA>
|
|
||||||
<ProgramListing>
|
|
||||||
DROP OPERATOR ^ (int4, int4);
|
|
||||||
</ProgramListing>
|
|
||||||
<PARA>
|
|
||||||
Remove left unary operator <literal>!a</literal> for booleans:
|
|
||||||
</PARA>
|
|
||||||
<ProgramListing>
|
|
||||||
DROP OPERATOR ! (none, bool);
|
|
||||||
</ProgramListing>
|
|
||||||
<PARA>
|
|
||||||
Remove right unary factorial operator <literal>a!</literal> for
|
|
||||||
<literal>int4</literal>:
|
|
||||||
</PARA>
|
|
||||||
<ProgramListing>
|
|
||||||
DROP OPERATOR ! (int4, none);
|
|
||||||
</ProgramListing>
|
|
||||||
</REFSECT1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DROPOPERATOR-3">
|
|
||||||
<TITLE>
|
|
||||||
Compatibility
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
</PARA>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPOPERATOR-4">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-09-22</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
SQL92
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
There is no <command>DROP OPERATOR</command> in <acronym>SQL92</acronym>.
|
|
||||||
</PARA>
|
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
|
||||||
|
<refsect1 id="R1-SQL-DROPOPERATOR-2">
|
||||||
|
<title>
|
||||||
|
Usage
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
Remove power operator <literal>a^n</literal> for <literal>int4</literal>:
|
||||||
|
|
||||||
|
<programlisting>
|
||||||
|
DROP OPERATOR ^ (int4, int4);
|
||||||
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Remove left unary negation operator (<literal>b !</literal>) for booleans:
|
||||||
|
<programlisting>
|
||||||
|
DROP OPERATOR ! (none, bool);
|
||||||
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Remove right unary factorial operator (<literal>! i</literal>) for
|
||||||
|
<literal>int4</literal>:
|
||||||
|
<programlisting>
|
||||||
|
DROP OPERATOR ! (int4, none);
|
||||||
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-DROPOPERATOR-3">
|
||||||
|
<title>
|
||||||
|
Compatibility
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<refsect2 id="R2-SQL-DROPOPERATOR-4">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-09-22</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
SQL92
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
There is no <command>DROP OPERATOR</command> in <acronym>SQL92</acronym>.
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
mode: sgml
|
mode: sgml
|
||||||
sgml-omittag:t
|
sgml-omittag:nil
|
||||||
sgml-shorttag:t
|
sgml-shorttag:t
|
||||||
sgml-minimize-attributes:nil
|
sgml-minimize-attributes:nil
|
||||||
sgml-always-quote-attributes:t
|
sgml-always-quote-attributes:t
|
||||||
|
|
|
@ -1,168 +1,166 @@
|
||||||
<REFENTRY ID="SQL-DROPRULE">
|
<refentry id="SQL-DROPRULE">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
DROP RULE
|
DROP RULE
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
DROP RULE
|
DROP RULE
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Removes an existing rule from the database
|
Removes an existing rule from the database
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
DROP RULE <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE>
|
DROP RULE <replaceable class="PARAMETER">name</replaceable>
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPRULE-1">
|
<refsect2 id="R2-SQL-DROPRULE-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</PARA>
|
<variablelist>
|
||||||
<VARIABLELIST>
|
<varlistentry>
|
||||||
<VARLISTENTRY>
|
<term><replaceable class="parameter">name</replaceable></term>
|
||||||
<TERM>
|
<listitem>
|
||||||
<replaceable class="parameter">name</replaceable>
|
<para>
|
||||||
</TERM>
|
The name of an existing rule to drop.
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The name of an existing rule to drop.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
</variablelist>
|
|
||||||
</REFSECT2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPRULE-2">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-09-22</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Outputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>DROP</ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Message returned if successfully.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>ERROR: RewriteGetRuleEventRel: rule "<replaceable class="parameter">name</replaceable>" not found</ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
This message occurs if the specified rule does not exist.
|
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</VARIABLELIST>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</REFSYNOPSISDIV>
|
|
||||||
|
<refsect2 id="R2-SQL-DROPRULE-2">
|
||||||
<REFSECT1 ID="R1-SQL-DROPRULE-1">
|
<refsect2info>
|
||||||
<REFSECT1INFO>
|
<date>1998-09-22</date>
|
||||||
<DATE>1998-09-22</DATE>
|
</refsect2info>
|
||||||
</REFSECT1INFO>
|
<title>
|
||||||
<TITLE>
|
Outputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
DROP
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Message returned if successfully.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
ERROR: RewriteGetRuleEventRel: rule "<replaceable class="parameter">name</replaceable>" not found
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
This message occurs if the specified rule does not exist.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-DROPRULE-1">
|
||||||
|
<refsect1info>
|
||||||
|
<date>1998-09-22</date>
|
||||||
|
</refsect1info>
|
||||||
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<command>DROP RULE</command> drops a rule from the specified
|
<command>DROP RULE</command> drops a rule from the specified
|
||||||
<productname>Postgres</productname> rule
|
<productname>Postgres</productname> rule
|
||||||
system. <productname>Postgres</productname>
|
system. <productname>Postgres</productname>
|
||||||
will immediately cease enforcing it and
|
will immediately cease enforcing it and
|
||||||
will purge its definition from the system catalogs.
|
will purge its definition from the system catalogs.
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPRULE-3">
|
<refsect2 id="R2-SQL-DROPRULE-3">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Notes
|
Notes
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
The <command>DROP RULE</command> statement is a
|
The <command>DROP RULE</command> statement is a
|
||||||
<productname>Postgres</productname>
|
<productname>Postgres</productname>
|
||||||
language extension.
|
language extension.
|
||||||
</PARA>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
Refer to <command>CREATE RULE</command> for
|
Refer to <command>CREATE RULE</command> for
|
||||||
information on how to create rules.
|
information on how to create rules.
|
||||||
</PARA>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPRULE-4">
|
<refsect2 id="R2-SQL-DROPRULE-4">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Bugs
|
Bugs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
Once a rule is dropped, access to historical information
|
Once a rule is dropped, access to historical information
|
||||||
the rule has written may disappear.
|
the rule has written may disappear.
|
||||||
</PARA>
|
</para>
|
||||||
</REFSECT2>
|
|
||||||
</refsect1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DROPRULE-2">
|
|
||||||
<TITLE>
|
|
||||||
Usage
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
To drop the rewrite rule <literal>newrule</literal>:
|
|
||||||
</PARA>
|
|
||||||
<ProgramListing>
|
|
||||||
DROP RULE newrule
|
|
||||||
</ProgramListing>
|
|
||||||
</REFSECT1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DROPRULE-3">
|
|
||||||
<TITLE>
|
|
||||||
Compatibility
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
</PARA>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPRULE-5">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-09-22</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
SQL92
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
There is no <command>DROP RULE</command> in SQL92.
|
|
||||||
</PARA>
|
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
|
||||||
|
<refsect1 id="R1-SQL-DROPRULE-2">
|
||||||
|
<title>
|
||||||
|
Usage
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
To drop the rewrite rule <literal>newrule</literal>:
|
||||||
|
|
||||||
|
<programlisting>
|
||||||
|
DROP RULE newrule;
|
||||||
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-DROPRULE-3">
|
||||||
|
<title>
|
||||||
|
Compatibility
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<refsect2 id="R2-SQL-DROPRULE-5">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-09-22</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
SQL92
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
There is no <command>DROP RULE</command> in SQL92.
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
mode: sgml
|
mode: sgml
|
||||||
sgml-omittag:t
|
sgml-omittag:nil
|
||||||
sgml-shorttag:t
|
sgml-shorttag:t
|
||||||
sgml-minimize-attributes:nil
|
sgml-minimize-attributes:nil
|
||||||
sgml-always-quote-attributes:t
|
sgml-always-quote-attributes:t
|
||||||
|
|
|
@ -1,155 +1,153 @@
|
||||||
<REFENTRY ID="SQL-DROPSEQUENCE">
|
<refentry id="SQL-DROPSEQUENCE">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
DROP SEQUENCE
|
DROP SEQUENCE
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
DROP SEQUENCE
|
DROP SEQUENCE
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Removes an existing sequence
|
Removes an existing sequence
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
DROP SEQUENCE <REPLACEABLE CLASS="PARAMETER">seqname</REPLACEABLE> [, ...]
|
DROP SEQUENCE <replaceable class="PARAMETER">name</replaceable> [, ...]
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPSEQUENCE-1">
|
<refsect2 id="R2-SQL-DROPSEQUENCE-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</PARA>
|
<variablelist>
|
||||||
<VARIABLELIST>
|
<varlistentry>
|
||||||
<VARLISTENTRY>
|
<term><replaceable class="PARAMETER">name</replaceable></term>
|
||||||
<TERM>
|
<listitem>
|
||||||
<REPLACEABLE CLASS="PARAMETER">seqname</REPLACEABLE>
|
<para>
|
||||||
</TERM>
|
The name of a sequence.
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The name of a sequence.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
</variablelist>
|
|
||||||
</REFSECT2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPSEQUENCE-2">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-09-22</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Outputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>DROP</ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The message returned if the sequence is successfully dropped.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>WARN: Relation "<replaceable class="parameter">seqname</replaceable>" does not exist.</ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
This message occurs if the specified sequence does not exist.
|
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</VARIABLELIST>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</REFSYNOPSISDIV>
|
|
||||||
|
<refsect2 id="R2-SQL-DROPSEQUENCE-2">
|
||||||
<REFSECT1 ID="R1-SQL-DROPSEQUENCE-1">
|
<refsect2info>
|
||||||
<REFSECT1INFO>
|
<date>1998-09-22</date>
|
||||||
<DATE>1998-09-22</DATE>
|
</refsect2info>
|
||||||
</REFSECT1INFO>
|
<title>
|
||||||
<TITLE>
|
Outputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
DROP
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The message returned if the sequence is successfully dropped.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
WARN: Relation "<replaceable class="parameter">name</replaceable>" does not exist.
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
This message occurs if the specified sequence does not exist.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-DROPSEQUENCE-1">
|
||||||
|
<refsect1info>
|
||||||
|
<date>1998-09-22</date>
|
||||||
|
</refsect1info>
|
||||||
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<command>DROP SEQUENCE</command> removes sequence number generators from the
|
<command>DROP SEQUENCE</command> removes sequence number generators from the
|
||||||
data base. With the current implementation of sequences as
|
data base. With the current implementation of sequences as
|
||||||
special tables it works just like the <command>DROP TABLE</command>
|
special tables it works just like the <command>DROP TABLE</command>
|
||||||
statement.
|
statement.
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPSEQUENCE-3">
|
<refsect2 id="R2-SQL-DROPSEQUENCE-3">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Notes
|
Notes
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
The <command>DROP SEQUENCE</command> statement is a
|
The <command>DROP SEQUENCE</command> statement is a
|
||||||
<productname>Postgres</productname>
|
<productname>Postgres</productname>
|
||||||
language extension.
|
language extension.
|
||||||
</PARA>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
Refer to the <command>CREATE SEQUENCE</command> statement for
|
Refer to the <command>CREATE SEQUENCE</command> statement for
|
||||||
information on how to create a sequence.
|
information on how to create a sequence.
|
||||||
</PARA>
|
</para>
|
||||||
</REFSECT2>
|
|
||||||
</refsect1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DROPSEQUENCE-2">
|
|
||||||
<TITLE>
|
|
||||||
Usage
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
To remove sequence <literal>serial</literal> from database:
|
|
||||||
</PARA>
|
|
||||||
<ProgramListing>
|
|
||||||
DROP SEQUENCE serial
|
|
||||||
</ProgramListing>
|
|
||||||
</REFSECT1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DROPSEQUENCE-3">
|
|
||||||
<TITLE>
|
|
||||||
Compatibility
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
</PARA>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPSEQUENCE-4">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-09-22</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
SQL92
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
There is no <command>DROP SEQUENCE</command> in <acronym>SQL92</acronym>.
|
|
||||||
</PARA>
|
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-DROPSEQUENCE-2">
|
||||||
|
<title>
|
||||||
|
Usage
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
To remove sequence <literal>serial</literal> from database:
|
||||||
|
|
||||||
|
<programlisting>
|
||||||
|
DROP SEQUENCE serial;
|
||||||
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-DROPSEQUENCE-3">
|
||||||
|
<title>
|
||||||
|
Compatibility
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<refsect2 id="R2-SQL-DROPSEQUENCE-4">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-09-22</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
SQL92
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
There is no <command>DROP SEQUENCE</command> in <acronym>SQL92</acronym>.
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
mode: sgml
|
mode: sgml
|
||||||
sgml-omittag:t
|
sgml-omittag:nil
|
||||||
sgml-shorttag:t
|
sgml-shorttag:t
|
||||||
sgml-minimize-attributes:nil
|
sgml-minimize-attributes:nil
|
||||||
sgml-always-quote-attributes:t
|
sgml-always-quote-attributes:t
|
||||||
|
|
|
@ -1,146 +1,145 @@
|
||||||
<REFENTRY ID="SQL-DROPTABLE">
|
<refentry id="SQL-DROPTABLE">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
DROP TABLE
|
DROP TABLE
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
DROP TABLE
|
DROP TABLE
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Removes existing tables from a database
|
Removes existing tables from a database
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
DROP TABLE <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> [, ...]
|
DROP TABLE <replaceable class="PARAMETER">name</replaceable> [, ...]
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPTABLE-1">
|
<refsect2 id="R2-SQL-DROPTABLE-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</PARA>
|
<variablelist>
|
||||||
<VARIABLELIST>
|
<varlistentry>
|
||||||
<VARLISTENTRY>
|
<term><replaceable class="PARAMETER">name</replaceable></term>
|
||||||
<TERM>
|
<listitem>
|
||||||
<ReturnValue><REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE></ReturnValue>
|
<para>
|
||||||
</TERM>
|
The name of an existing table or view to drop.
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The name of an existing table or view to drop.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
</variablelist>
|
|
||||||
</REFSECT2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPTABLE-2">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-09-22</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Outputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>DROP</ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The message returned if the command completes successfully.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue> ERROR Relation "<replaceable class="parameter">table</replaceable>" Does Not Exist!</ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
If the specified table or view does not exist in the database.
|
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</VARIABLELIST>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</REFSYNOPSISDIV>
|
|
||||||
|
<refsect2 id="R2-SQL-DROPTABLE-2">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-09-22</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
Outputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
DROP
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The message returned if the command completes successfully.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
ERROR Relation "<replaceable class="parameter">name</replaceable>" Does Not Exist!
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
If the specified table or view does not exist in the database.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DROPTABLE-1">
|
<refsect1 id="R1-SQL-DROPTABLE-1">
|
||||||
<REFSECT1INFO>
|
<refsect1info>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSECT1INFO>
|
</refsect1info>
|
||||||
<TITLE>
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<command>DROP TABLE</command> removes tables and views from the database.
|
<command>DROP TABLE</command> removes tables and views from the database.
|
||||||
Only its owner may destroy a table or view. A table
|
Only its owner may destroy a table or view. A table
|
||||||
may be emptied of rows, but not destroyed, by using <command>DELETE</command>.
|
may be emptied of rows, but not destroyed, by using <command>DELETE</command>.
|
||||||
</PARA>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
If a table being destroyed has secondary indexes on it,
|
If a table being destroyed has secondary indexes on it,
|
||||||
they will be removed first. The removal of just a
|
they will be removed first. The removal of just a
|
||||||
secondary index will not affect the contents of the underlying table.
|
secondary index will not affect the contents of the underlying table.
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPTABLE-3">
|
<refsect2 id="R2-SQL-DROPTABLE-3">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Notes
|
Notes
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
Refer to <command>CREATE TABLE</command> and
|
Refer to <command>CREATE TABLE</command> and
|
||||||
<command>ALTER TABLE</command> for information on
|
<command>ALTER TABLE</command> for information on
|
||||||
how to create or modify tables.
|
how to create or modify tables.
|
||||||
</PARA>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-DROPTABLE-2">
|
||||||
|
<title>
|
||||||
|
Usage
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
To destroy two tables, <literal>films</literal> and
|
||||||
|
<command>distributors</command>:
|
||||||
|
|
||||||
|
<programlisting>
|
||||||
|
DROP TABLE films, distributors;
|
||||||
|
</programlisting>
|
||||||
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DROPTABLE-2">
|
<refsect1 id="R1-SQL-DROPTABLE-3">
|
||||||
<TITLE>
|
<title>
|
||||||
Usage
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
To destroy the <literal>films</literal> and
|
|
||||||
<command>distributors</command> tables:
|
|
||||||
</PARA>
|
|
||||||
<ProgramListing>
|
|
||||||
DROP TABLE films, distributors
|
|
||||||
</ProgramListing>
|
|
||||||
</REFSECT1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DROPTABLE-3">
|
|
||||||
<TITLE>
|
|
||||||
Compatibility
|
Compatibility
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPTABLE-4">
|
<refsect2 id="R2-SQL-DROPTABLE-4">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
SQL92
|
SQL92
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
SQL92 specifies some additional capabilities for DROP TABLE:
|
SQL92 specifies some additional capabilities for DROP TABLE:
|
||||||
</PARA>
|
</para>
|
||||||
<synopsis>
|
<synopsis>
|
||||||
DROP TABLE <replaceable class="parameter">table</replaceable> { RESTRICT | CASCADE }
|
DROP TABLE <replaceable class="parameter">table</replaceable> { RESTRICT | CASCADE }
|
||||||
</synopsis>
|
</synopsis>
|
||||||
|
@ -172,12 +171,12 @@ DROP TABLE <replaceable class="parameter">table</replaceable> { RESTRICT | CASCA
|
||||||
</tip>
|
</tip>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
</refentry>
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
mode: sgml
|
mode: sgml
|
||||||
sgml-omittag:t
|
sgml-omittag:nil
|
||||||
sgml-shorttag:t
|
sgml-shorttag:t
|
||||||
sgml-minimize-attributes:nil
|
sgml-minimize-attributes:nil
|
||||||
sgml-always-quote-attributes:t
|
sgml-always-quote-attributes:t
|
||||||
|
|
|
@ -1,184 +1,162 @@
|
||||||
<REFENTRY ID="SQL-DROPTRIGGER">
|
<refentry id="SQL-DROPTRIGGER">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
DROP TRIGGER
|
DROP TRIGGER
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
DROP TRIGGER
|
DROP TRIGGER
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Removes the definition of a trigger
|
Removes the definition of a trigger
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
DROP TRIGGER <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE> ON <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>
|
DROP TRIGGER <replaceable class="PARAMETER">name</replaceable> ON <replaceable class="PARAMETER">table</replaceable>
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPTRIGGER-1">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-09-22</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Inputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
</PARA>
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The name of an existing trigger.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The name of a table.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
</variablelist>
|
|
||||||
</REFSECT2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPTRIGGER-2">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-09-22</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Outputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
|
|
||||||
<VARIABLELIST>
|
<refsect2 id="R2-SQL-DROPTRIGGER-1">
|
||||||
<VARLISTENTRY>
|
<refsect2info>
|
||||||
<TERM>
|
<date>1998-09-22</date>
|
||||||
<ReturnValue>DROP</ReturnValue>
|
</refsect2info>
|
||||||
</TERM>
|
<title>
|
||||||
<LISTITEM>
|
Inputs
|
||||||
<PARA>
|
</title>
|
||||||
The message returned if the trigger is successfully dropped.
|
<para>
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
<variablelist>
|
||||||
</VARLISTENTRY>
|
<varlistentry>
|
||||||
<VARLISTENTRY>
|
<term><replaceable class="PARAMETER">name</replaceable></term>
|
||||||
<TERM>
|
<listitem>
|
||||||
<ReturnValue>ERROR: DropTrigger: there is no trigger <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE> on relation "<replaceable class="parameter">table</replaceable>"</ReturnValue>
|
<para>
|
||||||
</TERM>
|
The name of an existing trigger.
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
This message occurs if the trigger specified does not exist.
|
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</VARIABLELIST>
|
<varlistentry>
|
||||||
|
<term><replaceable class="PARAMETER">table</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The name of a table.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</REFSYNOPSISDIV>
|
|
||||||
|
<refsect2 id="R2-SQL-DROPTRIGGER-2">
|
||||||
<REFSECT1 ID="R1-SQL-DROPTRIGGER-1">
|
<refsect2info>
|
||||||
<REFSECT1INFO>
|
<date>1998-09-22</date>
|
||||||
<DATE>1998-09-22</DATE>
|
</refsect2info>
|
||||||
</REFSECT1INFO>
|
<title>
|
||||||
<TITLE>
|
Outputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
DROP
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The message returned if the trigger is successfully dropped.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
ERROR: DropTrigger: there is no trigger <replaceable class="PARAMETER">name</replaceable> on relation "<replaceable class="parameter">table</replaceable>"
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
This message occurs if the trigger specified does not exist.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-DROPTRIGGER-1">
|
||||||
|
<refsect1info>
|
||||||
|
<date>1998-09-22</date>
|
||||||
|
</refsect1info>
|
||||||
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<command>DROP TRIGGER</command> will remove all references to an existing
|
<command>DROP TRIGGER</command> will remove all references to an existing
|
||||||
trigger definition. To execute this command the current
|
trigger definition. To execute this command the current
|
||||||
user must be the owner of the trigger.
|
user must be the owner of the trigger.
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPTRIGGER-3">
|
<refsect2 id="R2-SQL-DROPTRIGGER-3">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Notes
|
Notes
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<command>DROP TRIGGER</command> is a <productname>Postgres</productname>
|
<command>DROP TRIGGER</command> is a <productname>Postgres</productname>
|
||||||
language extension.
|
language extension.
|
||||||
</PARA>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
Refer to <command>CREATE TRIGGER</command> for
|
Refer to <command>CREATE TRIGGER</command> for
|
||||||
information on how to create triggers.
|
information on how to create triggers.
|
||||||
</PARA>
|
</para>
|
||||||
</REFSECT2>
|
|
||||||
</refsect1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DROPTRIGGER-2">
|
|
||||||
<TITLE>
|
|
||||||
Usage
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
Destroy the <literal>if_dist_exists</literal> trigger
|
|
||||||
on table <literal>films</literal>:
|
|
||||||
</PARA>
|
|
||||||
<ProgramListing>
|
|
||||||
DROP TRIGGER if_dist_exists ON films;
|
|
||||||
</ProgramListing>
|
|
||||||
</REFSECT1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DROPTRIGGER-3">
|
|
||||||
<TITLE>
|
|
||||||
Compatibility
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
</PARA>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPTRIGGER-4">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-09-22</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
SQL92
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
There is no <command>DROP TRIGGER</command> statement in
|
|
||||||
<acronym>SQL92</acronym>.
|
|
||||||
</PARA>
|
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
|
||||||
|
<refsect1 id="R1-SQL-DROPTRIGGER-2">
|
||||||
|
<title>
|
||||||
|
Usage
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
Destroy the <literal>if_dist_exists</literal> trigger
|
||||||
|
on table <literal>films</literal>:
|
||||||
|
|
||||||
<!--
|
<programlisting>
|
||||||
<REPLACEABLE CLASS="PARAMETER">
|
DROP TRIGGER if_dist_exists ON films;
|
||||||
</REPLACEABLE>
|
</programlisting>
|
||||||
<ReturnValue></ReturnValue>
|
</para>
|
||||||
<PARA>
|
</refsect1>
|
||||||
</PARA>
|
|
||||||
<VARIABLELIST>
|
<refsect1 id="R1-SQL-DROPTRIGGER-3">
|
||||||
<VARLISTENTRY>
|
<title>
|
||||||
<TERM>•
|
Compatibility
|
||||||
</TERM>
|
</title>
|
||||||
<LISTITEM>
|
<para>
|
||||||
<PARA>
|
</para>
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
<refsect2 id="R2-SQL-DROPTRIGGER-4">
|
||||||
</VARLISTENTRY>
|
<refsect2info>
|
||||||
</VARIABLELIST>
|
<date>1998-09-22</date>
|
||||||
<PARA>
|
</refsect2info>
|
||||||
</PARA>
|
<title>
|
||||||
-->
|
SQL92
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
There is no <command>DROP TRIGGER</command> statement in
|
||||||
|
<acronym>SQL92</acronym>.
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
mode: sgml
|
mode: sgml
|
||||||
sgml-omittag:t
|
sgml-omittag:nil
|
||||||
sgml-shorttag:t
|
sgml-shorttag:t
|
||||||
sgml-minimize-attributes:nil
|
sgml-minimize-attributes:nil
|
||||||
sgml-always-quote-attributes:t
|
sgml-always-quote-attributes:t
|
||||||
|
|
|
@ -1,172 +1,170 @@
|
||||||
<REFENTRY ID="SQL-DROPTYPE">
|
<refentry id="SQL-DROPTYPE">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
DROP TYPE
|
DROP TYPE
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
DROP TYPE
|
DROP TYPE
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Removes a user-defined type from the system catalogs
|
Removes a user-defined type from the system catalogs
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
DROP TYPE <REPLACEABLE CLASS="PARAMETER">typename</REPLACEABLE>
|
DROP TYPE <replaceable class="PARAMETER">typename</replaceable>
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPTYPE-1">
|
<refsect2 id="R2-SQL-DROPTYPE-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</PARA>
|
<variablelist>
|
||||||
<VARIABLELIST>
|
<varlistentry>
|
||||||
<VARLISTENTRY>
|
<term><replaceable class="PARAMETER">typename</replaceable></term>
|
||||||
<TERM>
|
<listitem>
|
||||||
<REPLACEABLE CLASS="PARAMETER">typename</REPLACEABLE>
|
<para>
|
||||||
</TERM>
|
The name of an existing type.
|
||||||
<LISTITEM>
|
</para>
|
||||||
<PARA>
|
</listitem>
|
||||||
The name of an existing type.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
</variablelist>
|
|
||||||
</REFSECT2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPTYPE-2">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-09-22</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Outputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>DROP</ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The message returned if the command is successful.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>ERROR: RemoveType: type '<replaceable class="parameter">typename</replaceable>' does not exist</ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
This message occurs if the specified type is not found.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</VARIABLELIST>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</REFSYNOPSISDIV>
|
|
||||||
|
<refsect2 id="R2-SQL-DROPTYPE-2">
|
||||||
<REFSECT1 ID="R1-SQL-DROPTYPE-1">
|
<refsect2info>
|
||||||
<REFSECT1INFO>
|
<date>1998-09-22</date>
|
||||||
<DATE>1998-09-22</DATE>
|
</refsect2info>
|
||||||
</REFSECT1INFO>
|
<title>
|
||||||
<TITLE>
|
Outputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
DROP
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The message returned if the command is successful.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
ERROR: RemoveType: type '<replaceable class="parameter">typename</replaceable>' does not exist
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
This message occurs if the specified type is not found.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-DROPTYPE-1">
|
||||||
|
<refsect1info>
|
||||||
|
<date>1998-09-22</date>
|
||||||
|
</refsect1info>
|
||||||
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<command>DROP TYPE</command> will remove a user type from the
|
<command>DROP TYPE</command> will remove a user type from the
|
||||||
system catalogs.
|
system catalogs.
|
||||||
</PARA>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
Only the owner of a type can remove it.
|
Only the owner of a type can remove it.
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPTYPE-3">
|
<refsect2 id="R2-SQL-DROPTYPE-3">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Notes
|
Notes
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
DROP TYPE statement is a <productname>Postgres</productname>
|
DROP TYPE statement is a <productname>Postgres</productname>
|
||||||
language extension.
|
language extension.
|
||||||
</PARA>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
Refer to <command>CREATE TYPE</command> for
|
Refer to <command>CREATE TYPE</command> for
|
||||||
inforamation on how to create types.
|
inforamation on how to create types.
|
||||||
</PARA>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
It is the user's responsibility to remove any operators,
|
It is the user's responsibility to remove any operators,
|
||||||
functions, aggregates, access methods, subtypes, and classes
|
functions, aggregates, access methods, subtypes, and classes
|
||||||
that use a deleted type.
|
that use a deleted type.
|
||||||
</PARA>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPTYPE-4">
|
<refsect2 id="R2-SQL-DROPTYPE-4">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Bugs
|
Bugs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
If a built-in type is removed, the behavior of the backend
|
If a built-in type is removed, the behavior of the backend
|
||||||
is unpredictable.
|
is unpredictable.
|
||||||
</PARA>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DROPTYPE-2">
|
<refsect1 id="R1-SQL-DROPTYPE-2">
|
||||||
<TITLE>
|
<title>
|
||||||
Usage
|
Usage
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
To remove the <literal>box</literal> type:
|
To remove the <literal>box</literal> type:
|
||||||
</PARA>
|
|
||||||
<ProgramListing>
|
<programlisting>
|
||||||
DROP TYPE box
|
DROP TYPE box;
|
||||||
</ProgramListing>
|
</programlisting>
|
||||||
</REFSECT1>
|
</para>
|
||||||
|
</refsect1>
|
||||||
<REFSECT1 ID="R1-SQL-DROPTYPE-3">
|
|
||||||
<TITLE>
|
<refsect1 id="R1-SQL-DROPTYPE-3">
|
||||||
|
<title>
|
||||||
Compatibility
|
Compatibility
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPTYPE-5">
|
<refsect2 id="R2-SQL-DROPTYPE-5">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
SQL3
|
SQL3
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
DROP TYPE is a <acronym>SQL3</acronym> statement.
|
DROP TYPE is a <acronym>SQL3</acronym> statement.
|
||||||
</PARA>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
</refentry>
|
||||||
|
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
mode: sgml
|
mode: sgml
|
||||||
sgml-omittag:t
|
sgml-omittag:nil
|
||||||
sgml-shorttag:t
|
sgml-shorttag:t
|
||||||
sgml-minimize-attributes:nil
|
sgml-minimize-attributes:nil
|
||||||
sgml-always-quote-attributes:t
|
sgml-always-quote-attributes:t
|
||||||
|
|
|
@ -1,91 +1,90 @@
|
||||||
<REFENTRY ID="SQL-DROPUSER">
|
<refentry id="SQL-DROPUSER">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
DROP USER
|
DROP USER
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
DROP USER
|
DROP USER
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Removes an user account information
|
Removes an user account information
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
DROP USER <REPLACEABLE CLASS="PARAMETER">username</REPLACEABLE>
|
DROP USER <replaceable class="PARAMETER">name</replaceable>
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPUSER-1">
|
<refsect2 id="R2-SQL-DROPUSER-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</PARA>
|
|
||||||
<VARIABLELIST>
|
<variablelist>
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term><replaceable class="PARAMETER">name</replaceable></term>
|
||||||
<REPLACEABLE CLASS="PARAMETER">username</REPLACEABLE>
|
<listitem>
|
||||||
</TERM>
|
<para>
|
||||||
<LISTITEM>
|
The name of an existing user.
|
||||||
<PARA>
|
</para>
|
||||||
The name of an existing user.
|
</listitem>
|
||||||
</PARA>
|
</varlistentry>
|
||||||
</LISTITEM>
|
</variablelist>
|
||||||
</VARLISTENTRY>
|
|
||||||
</variablelist>
|
|
||||||
</REFSECT2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPUSER-2">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-09-22</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Outputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>DROP</ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The message returned if the user is successfully deleted.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>ERROR: removeUser: user "<replaceable class="parameter">username</replaceable>" does not exist.</ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
This message occurs if the username is not found.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
</VARIABLELIST>
|
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</REFSYNOPSISDIV>
|
|
||||||
|
<refsect2 id="R2-SQL-DROPUSER-2">
|
||||||
<REFSECT1 ID="R1-SQL-DROPUSER-1">
|
<refsect2info>
|
||||||
<REFSECT1INFO>
|
<date>1998-09-22</date>
|
||||||
<DATE>1998-09-22</DATE>
|
</refsect2info>
|
||||||
</REFSECT1INFO>
|
<title>
|
||||||
<TITLE>
|
Outputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
DROP
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The message returned if the user is successfully deleted.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
ERROR: removeUser: user "<replaceable class="parameter">name</replaceable>" does not exist.
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
This message occurs if the username is not found.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-DROPUSER-1">
|
||||||
|
<refsect1info>
|
||||||
|
<date>1998-09-22</date>
|
||||||
|
</refsect1info>
|
||||||
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<command>DROP USER</command> removes the specified
|
<command>DROP USER</command> removes the specified
|
||||||
user from the database,
|
user from the database,
|
||||||
along with any databases owned by the user. It
|
along with any databases owned by the user. It
|
||||||
|
@ -93,65 +92,64 @@ DROP USER <REPLACEABLE CLASS="PARAMETER">username</REPLACEABLE>
|
||||||
named user in databases not owned by the user. This statement
|
named user in databases not owned by the user. This statement
|
||||||
can be used in place of the <application>destroyuser</application>
|
can be used in place of the <application>destroyuser</application>
|
||||||
script, regardless of how the user was created.
|
script, regardless of how the user was created.
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPUSER-3">
|
<refsect2 id="R2-SQL-DROPUSER-3">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Notes
|
Notes
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<command>DROP USER</command> is a <productname>Postgres</productname>
|
<command>DROP USER</command> is a <productname>Postgres</productname>
|
||||||
language extension.
|
language extension.
|
||||||
</PARA>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
Refer to <command>CREATE USER</command> and
|
Refer to <command>CREATE USER</command> and
|
||||||
<command>ALTER USER</command> for information on
|
<command>ALTER USER</command> for information on
|
||||||
how to create or modify user accounts.
|
how to create or modify user accounts.
|
||||||
</PARA>
|
</para>
|
||||||
</REFSECT2>
|
|
||||||
</refsect1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DROPUSER-2">
|
|
||||||
<TITLE>
|
|
||||||
Usage
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
To drop a user account:
|
|
||||||
</PARA>
|
|
||||||
<ProgramListing>
|
|
||||||
DROP USER Jonathan;
|
|
||||||
</ProgramListing>
|
|
||||||
</REFSECT1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DROPUSER-3">
|
|
||||||
<TITLE>
|
|
||||||
Compatibility
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
</PARA>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPUSER-4">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-09-22</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
SQL92
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
There is no <command>DROP USER</command> in <acronym>SQL92</acronym>.
|
|
||||||
</PARA>
|
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-DROPUSER-2">
|
||||||
|
<title>
|
||||||
|
Usage
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
To drop a user account:
|
||||||
|
<programlisting>
|
||||||
|
DROP USER Jonathan;
|
||||||
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-DROPUSER-3">
|
||||||
|
<title>
|
||||||
|
Compatibility
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<refsect2 id="R2-SQL-DROPUSER-4">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-09-22</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
SQL92
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
There is no <command>DROP USER</command> in <acronym>SQL92</acronym>.
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
mode: sgml
|
mode: sgml
|
||||||
sgml-omittag:t
|
sgml-omittag:nil
|
||||||
sgml-shorttag:t
|
sgml-shorttag:t
|
||||||
sgml-minimize-attributes:nil
|
sgml-minimize-attributes:nil
|
||||||
sgml-always-quote-attributes:t
|
sgml-always-quote-attributes:t
|
||||||
|
|
|
@ -1,76 +1,74 @@
|
||||||
<REFENTRY ID="SQL-DROPVIEW">
|
<refentry id="SQL-DROPVIEW">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
DROP VIEW
|
DROP VIEW
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
DROP VIEW
|
DROP VIEW
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Removes an existing view from a database
|
Removes an existing view from a database
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
DROP VIEW <REPLACEABLE CLASS="PARAMETER">view</REPLACEABLE>
|
DROP VIEW <replaceable class="PARAMETER">name</replaceable>
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPVIEW-1">
|
<refsect2 id="R2-SQL-DROPVIEW-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</PARA>
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<REPLACEABLE CLASS="PARAMETER">view</REPLACEABLE>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The name of an existing view.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
</variablelist>
|
|
||||||
</REFSECT2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPVIEW-2">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-09-22</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Outputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
|
|
||||||
<VARIABLELIST>
|
<variablelist>
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term><replaceable class="PARAMETER">name</replaceable></term>
|
||||||
<ReturnValue>DROP</ReturnValue>
|
<listitem>
|
||||||
</TERM>
|
<para>
|
||||||
<LISTITEM>
|
The name of an existing view.
|
||||||
<PARA>
|
|
||||||
The message returned if the command is successful.
|
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
<VARLISTENTRY>
|
</variablelist>
|
||||||
<TERM>
|
</para>
|
||||||
<ReturnValue>
|
</refsect2>
|
||||||
ERROR: RewriteGetRuleEventRel: rule "_RET<REPLACEABLE CLASS="PARAMETER">view</REPLACEABLE>" not found</ReturnValue>
|
|
||||||
</TERM>
|
<refsect2 id="R2-SQL-DROPVIEW-2">
|
||||||
<LISTITEM>
|
<refsect2info>
|
||||||
<PARA>
|
<date>1998-09-22</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
Outputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
DROP
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The message returned if the command is successful.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
ERROR: RewriteGetRuleEventRel: rule "_RET<replaceable class="PARAMETER">name</replaceable>" not found
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
This message occurs if the specified view does not exist in
|
This message occurs if the specified view does not exist in
|
||||||
the database.
|
the database.
|
||||||
</para>
|
</para>
|
||||||
|
@ -78,99 +76,99 @@ DROP VIEW <REPLACEABLE CLASS="PARAMETER">view</REPLACEABLE>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</REFSYNOPSISDIV>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DROPVIEW-1">
|
<refsect1 id="R1-SQL-DROPVIEW-1">
|
||||||
<REFSECT1INFO>
|
<refsect1info>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSECT1INFO>
|
</refsect1info>
|
||||||
<TITLE>
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<command>DROP VIEW</command> drops an existing view from the database.
|
<command>DROP VIEW</command> drops an existing view from the database.
|
||||||
To execute this command you must be the owner of the
|
To execute this command you must be the owner of the
|
||||||
view.
|
view.
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPVIEW-3">
|
<refsect2 id="R2-SQL-DROPVIEW-3">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Notes
|
Notes
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
The <productname>Postgres</productname>
|
The <productname>Postgres</productname>
|
||||||
<command>DROP TABLE</command> statement also drops views.
|
<command>DROP TABLE</command> statement also drops views.
|
||||||
</PARA>
|
</para>
|
||||||
<PARA>
|
<para>
|
||||||
Refer to <command>CREATE VIEW</command>
|
Refer to <command>CREATE VIEW</command>
|
||||||
for information on how to create views.
|
for information on how to create views.
|
||||||
</PARA>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DROPVIEW-2">
|
<refsect1 id="R1-SQL-DROPVIEW-2">
|
||||||
<TITLE>
|
<title>
|
||||||
Usage
|
Usage
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
This command will remove the view called <literal>kinds</literal>:
|
This command will remove the view called <literal>kinds</literal>:
|
||||||
</PARA>
|
</para>
|
||||||
<ProgramListing>
|
<programlisting>
|
||||||
DROP VIEW kinds;
|
DROP VIEW kinds;
|
||||||
</ProgramListing>
|
</programlisting>
|
||||||
</REFSECT1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-DROPVIEW-3">
|
<refsect1 id="R1-SQL-DROPVIEW-3">
|
||||||
<TITLE>
|
<title>
|
||||||
Compatibility
|
Compatibility
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-DROPVIEW-4">
|
<refsect2 id="R2-SQL-DROPVIEW-4">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
SQL92
|
SQL92
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<acronym>SQL92</acronym> specifies some additional capabilities for
|
<acronym>SQL92</acronym> specifies some additional capabilities for
|
||||||
<command>DROP VIEW</command>:
|
<command>DROP VIEW</command>:
|
||||||
</PARA>
|
|
||||||
|
|
||||||
<synopsis>
|
<synopsis>
|
||||||
DROP VIEW <replaceable class="parameter">view</replaceable> { RESTRICT | CASCADE }
|
DROP VIEW <replaceable class="parameter">view</replaceable> { RESTRICT | CASCADE }
|
||||||
</synopsis>
|
</synopsis>
|
||||||
|
</para>
|
||||||
|
|
||||||
<REFSECT3 ID="R3-SQL-DROPVIEW-1">
|
<refsect3 id="R3-SQL-DROPVIEW-1">
|
||||||
<REFSECT3INFO>
|
<refsect3info>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSECT3INFO>
|
</refsect3info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>RESTRICT</term>
|
<term>RESTRICT</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Ensures that only a view with no dependent views or
|
Ensures that only a view with no dependent views or
|
||||||
integrity constraints can be destroyed.
|
integrity constraints can be destroyed.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>CASCADE</term>
|
<term>CASCADE</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Any referencing views and integrity constraints
|
Any referencing views and integrity constraints
|
||||||
will be dropped as well.
|
will be dropped as well.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -178,31 +176,27 @@ DROP VIEW <replaceable class="parameter">view</replaceable> { RESTRICT | CASCADE
|
||||||
</para>
|
</para>
|
||||||
</refsect3>
|
</refsect3>
|
||||||
|
|
||||||
<REFSECT3 ID="R3-SQL-DROPVIEW-2">
|
<refsect3 id="R3-SQL-DROPVIEW-2">
|
||||||
<REFSECT3INFO>
|
<refsect3info>
|
||||||
<DATE>1998-09-22</DATE>
|
<date>1998-09-22</date>
|
||||||
</REFSECT3INFO>
|
</refsect3info>
|
||||||
<TITLE>
|
<title>
|
||||||
Notes
|
Notes
|
||||||
</TITLE>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
<tip>
|
At present, to remove a referenced view from a
|
||||||
<para>
|
<productname>Postgres</productname> database,
|
||||||
At present, to remove a referenced view from a
|
you must drop it explicitly.
|
||||||
<productname>Postgres</productname> database,
|
|
||||||
you must drop it explicitly.
|
|
||||||
</para>
|
|
||||||
</tip>
|
|
||||||
</para>
|
</para>
|
||||||
</refsect3>
|
</refsect3>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
</refentry>
|
||||||
|
|
||||||
<!-- Keep this comment at the end of the file
|
<!-- Keep this comment at the end of the file
|
||||||
Local variables:
|
Local variables:
|
||||||
mode: sgml
|
mode: sgml
|
||||||
sgml-omittag:t
|
sgml-omittag:nil
|
||||||
sgml-shorttag:t
|
sgml-shorttag:t
|
||||||
sgml-minimize-attributes:nil
|
sgml-minimize-attributes:nil
|
||||||
sgml-always-quote-attributes:t
|
sgml-always-quote-attributes:t
|
||||||
|
|
|
@ -1,186 +1,180 @@
|
||||||
<REFENTRY ID="SQL-EXPLAIN">
|
<refentry id="SQL-EXPLAIN">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
EXPLAIN
|
EXPLAIN
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
EXPLAIN
|
EXPLAIN
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Shows statement execution details
|
Shows statement execution details
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
|
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-09-01</DATE>
|
<date>1998-09-01</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
EXPLAIN [ VERBOSE ] <REPLACEABLE CLASS="PARAMETER">query</REPLACEABLE>
|
EXPLAIN [ VERBOSE ] <replaceable class="PARAMETER">query</replaceable>
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-EXPLAIN-1">
|
<refsect2 id="R2-SQL-EXPLAIN-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-01</DATE>
|
<date>1998-09-01</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
|
|
||||||
<VARIABLELIST>
|
<variablelist>
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term>VERBOSE</term>
|
||||||
VERBOSE
|
<listitem>
|
||||||
</TERM>
|
<para>
|
||||||
<LISTITEM>
|
Flag to show detailed query plan.
|
||||||
<PARA>
|
</para>
|
||||||
Flag to show detailed query plan.
|
</listitem>
|
||||||
</para>
|
</varlistentry>
|
||||||
</listitem>
|
<varlistentry>
|
||||||
</varlistentry>
|
<term><replaceable class="PARAMETER">query</replaceable></term>
|
||||||
<VARLISTENTRY>
|
<listitem>
|
||||||
<TERM>
|
<para>
|
||||||
<REPLACEABLE CLASS="PARAMETER">query</REPLACEABLE>
|
Any <replaceable class="PARAMETER">query</replaceable>.
|
||||||
</TERM>
|
</para>
|
||||||
<LISTITEM>
|
</listitem>
|
||||||
<PARA>
|
</varlistentry>
|
||||||
Any <REPLACEABLE CLASS="PARAMETER">query</REPLACEABLE>.
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</refsect2>
|
||||||
</varlistentry>
|
|
||||||
</VARIABLELIST>
|
|
||||||
</para>
|
|
||||||
</REFSECT2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-EXPLAIN-2">
|
<refsect2 id="R2-SQL-EXPLAIN-2">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Outputs
|
Outputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
|
|
||||||
<VARIABLELIST>
|
<variablelist>
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term><computeroutput>
|
||||||
NOTICE: QUERY PLAN:
|
NOTICE: QUERY PLAN:
|
||||||
<replaceable>plan</replaceable>
|
<replaceable>plan</replaceable>
|
||||||
</TERM>
|
</computeroutput></term>
|
||||||
<LISTITEM>
|
<listitem>
|
||||||
<PARA>
|
<para>
|
||||||
Explicit query plan from the <productname>Postgres</productname> backend.
|
Explicit query plan from the <productname>Postgres</productname> backend.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term><computeroutput>
|
||||||
EXPLAIN
|
EXPLAIN
|
||||||
</TERM>
|
</computeroutput></term>
|
||||||
<LISTITEM>
|
<listitem>
|
||||||
<PARA>
|
<para>
|
||||||
Flag sent after query plan is shown.
|
Flag sent after query plan is shown.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</VARIABLELIST>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT2>
|
</refsect2>
|
||||||
</REFSYNOPSISDIV>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-EXPLAIN-1">
|
<refsect1 id="R1-SQL-EXPLAIN-1">
|
||||||
<REFSECT1INFO>
|
<refsect1info>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSECT1INFO>
|
</refsect1info>
|
||||||
<TITLE>
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
This command outputs details about the supplied query.
|
This command outputs details about the supplied query.
|
||||||
The default output is the computed query cost.
|
The default output is the computed query cost.
|
||||||
The cost value is only meaningful to the optimizer in comparing
|
The cost value is only meaningful to the optimizer in comparing
|
||||||
various query plans.
|
various query plans.
|
||||||
VERBOSE displays the full query plan and cost to your screen,
|
VERBOSE displays the full query plan and cost to your screen,
|
||||||
and pretty-prints the plan to the postmaster log file.
|
and pretty-prints the plan to the postmaster log file.
|
||||||
</para>
|
</para>
|
||||||
<REFSECT2 ID="R2-SQL-EXPLAIN-3">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-04-15</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Notes
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
There is only sparse documentation on the optimizer's use of cost
|
|
||||||
information in <productname>Postgres</productname>.
|
|
||||||
General information on cost estimation for query optimization
|
|
||||||
can be found in database textbooks.
|
|
||||||
Refer to the <citetitle>Programmer's Guide</citetitle>
|
|
||||||
in the chapters on indexes and the genetic query optimizer for
|
|
||||||
more information.
|
|
||||||
</para>
|
|
||||||
</REFSECT2>
|
|
||||||
</refsect1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-EXPLAIN-2">
|
<refsect2 id="R2-SQL-EXPLAIN-3">
|
||||||
<TITLE>
|
<refsect2info>
|
||||||
Usage
|
<date>1998-04-15</date>
|
||||||
</TITLE>
|
</refsect2info>
|
||||||
<PARA>
|
<title>
|
||||||
To show a query plan for a simple query:
|
Notes
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
There is only sparse documentation on the optimizer's use of cost
|
||||||
|
information in <productname>Postgres</productname>.
|
||||||
|
General information on cost estimation for query optimization
|
||||||
|
can be found in database textbooks.
|
||||||
|
Refer to the <citetitle>Programmer's Guide</citetitle>
|
||||||
|
in the chapters on indexes and the genetic query optimizer for
|
||||||
|
more information.
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
<ProgramListing>
|
<refsect1 id="R1-SQL-EXPLAIN-2">
|
||||||
postgres=> explain select * from foo;
|
<title>
|
||||||
|
Usage
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
To show a query plan for a simple query:
|
||||||
|
|
||||||
|
<programlisting>
|
||||||
|
EXPLAIN select * from foo;
|
||||||
NOTICE: QUERY PLAN:
|
NOTICE: QUERY PLAN:
|
||||||
|
|
||||||
Seq Scan on foo (cost=0.00 rows=0 width=4)
|
Seq Scan on foo (cost=0.00 rows=0 width=4)
|
||||||
|
|
||||||
EXPLAIN
|
EXPLAIN
|
||||||
</ProgramListing>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-EXPLAIN-3">
|
<refsect1 id="R1-SQL-EXPLAIN-3">
|
||||||
<TITLE>
|
<title>
|
||||||
Compatibility
|
Compatibility
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-EXPLAIN-4">
|
<refsect2 id="R2-SQL-EXPLAIN-4">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-01</DATE>
|
<date>1998-09-01</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
SQL92
|
SQL92
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
There is no EXPLAIN statement defined in SQL92.
|
There is no <command>EXPLAIN</command> statement defined in SQL92.
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
</refentry>
|
||||||
|
|
||||||
<!--
|
<!-- Keep this comment at the end of the file
|
||||||
<REPLACEABLE CLASS="PARAMETER">
|
Local variables:
|
||||||
</REPLACEABLE>
|
mode: sgml
|
||||||
<ReturnValue></ReturnValue>
|
sgml-omittag:nil
|
||||||
<PARA>
|
sgml-shorttag:t
|
||||||
</PARA>
|
sgml-minimize-attributes:nil
|
||||||
<VARIABLELIST>
|
sgml-always-quote-attributes:t
|
||||||
<VARLISTENTRY>
|
sgml-indent-step:1
|
||||||
<TERM>•
|
sgml-indent-data:t
|
||||||
</TERM>
|
sgml-parent-document:nil
|
||||||
<LISTITEM>
|
sgml-default-dtd-file:"../reference.ced"
|
||||||
<PARA>
|
sgml-exposed-tags:nil
|
||||||
</PARA>
|
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
||||||
</LISTITEM>
|
sgml-local-ecat-files:nil
|
||||||
</VARLISTENTRY>
|
End:
|
||||||
</VARIABLELIST>
|
|
||||||
<PARA>
|
|
||||||
</PARA>
|
|
||||||
-->
|
-->
|
||||||
|
|
|
@ -1,300 +1,287 @@
|
||||||
<REFENTRY ID="SQL-FETCH">
|
<refentry id="SQL-FETCH">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
FETCH
|
FETCH
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
FETCH
|
FETCH
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Gets rows using a cursor
|
Gets rows using a cursor
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-09-01</DATE>
|
<date>1998-09-01</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
FETCH [ <REPLACEABLE CLASS="PARAMETER">selector</REPLACEABLE> ] [ <REPLACEABLE CLASS="PARAMETER">count</REPLACEABLE> ]
|
FETCH [ <replaceable class="PARAMETER">selector</replaceable> ] [ <replaceable class="PARAMETER">count</replaceable> ] { IN | FROM } <replaceable class="PARAMETER">cursor</replaceable>
|
||||||
{ IN | FROM } <REPLACEABLE CLASS="PARAMETER">cursor</REPLACEABLE>
|
FETCH [ RELATIVE ] [ { [ <replaceable class="PARAMETER">#</replaceable> | ALL | NEXT | PRIOR ] } ] FROM ] <replaceable class="PARAMETER">cursor</replaceable>
|
||||||
FETCH [ RELATIVE ] [ { [ <REPLACEABLE CLASS="PARAMETER">#</REPLACEABLE> | ALL | NEXT | PRIOR ] } ]
|
</synopsis>
|
||||||
FROM ] <REPLACEABLE CLASS="PARAMETER">cursor</REPLACEABLE>
|
|
||||||
</SYNOPSIS>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-FETCH-1">
|
<refsect2 id="R2-SQL-FETCH-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-01</DATE>
|
<date>1998-09-01</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
|
|
||||||
<VARIABLELIST>
|
<variablelist>
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term><replaceable class="PARAMETER">selector</replaceable></term>
|
||||||
<REPLACEABLE CLASS="PARAMETER">selector</REPLACEABLE>
|
<listitem>
|
||||||
</TERM>
|
<para>
|
||||||
<LISTITEM>
|
<replaceable class="PARAMETER">selector</replaceable>
|
||||||
<PARA>
|
defines the fetch direction. It can be one
|
||||||
<REPLACEABLE CLASS="PARAMETER">selector</REPLACEABLE>
|
the following:
|
||||||
defines the fetch direction. It can be one
|
|
||||||
the following:
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
</variablelist>
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
FORWARD
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
fetch next row(s). This is the default
|
|
||||||
if <REPLACEABLE CLASS="PARAMETER">selector</REPLACEABLE> is omitted.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
BACKWARD
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
fetch previous row(s).
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
RELATIVE
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Noise word for SQL92 compatibility.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term>FORWARD</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
fetch next row(s). This is the default
|
||||||
|
if <replaceable class="PARAMETER">selector</replaceable> is omitted.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term>BACKWARD</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
fetch previous row(s).
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term>RELATIVE</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Noise word for SQL92 compatibility.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term><replaceable class="PARAMETER">count</replaceable></term>
|
||||||
<REPLACEABLE CLASS="PARAMETER">count</REPLACEABLE>
|
<listitem>
|
||||||
</TERM>
|
<para>
|
||||||
<LISTITEM>
|
<replaceable class="PARAMETER">count</replaceable>
|
||||||
<PARA>
|
determines how many rows to fetch. It can be one of the following:
|
||||||
<REPLACEABLE CLASS="PARAMETER">count</REPLACEABLE>
|
|
||||||
determines how many rows to fetch. It can be one of the following:
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="PARAMETER">#</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
A signed integer that specify how many rows to fetch.
|
||||||
|
Note that a negative integer is equivalent to changing the sense of
|
||||||
|
FORWARD and BACKWARD.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term>
|
||||||
<REPLACEABLE CLASS="PARAMETER">#</REPLACEABLE>
|
ALL
|
||||||
</TERM>
|
</term>
|
||||||
<LISTITEM>
|
<listitem>
|
||||||
<PARA>
|
<para>
|
||||||
A signed integer that specify how many rows to fetch.
|
Retrieve all remaining rows.
|
||||||
Note that a negative integer is equivalent to changing the sense of
|
</para>
|
||||||
FORWARD and BACKWARD.
|
</listitem>
|
||||||
</para>
|
</varlistentry>
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term>
|
||||||
ALL
|
NEXT
|
||||||
</TERM>
|
</term>
|
||||||
<LISTITEM>
|
<listitem>
|
||||||
<PARA>
|
<para>
|
||||||
Retrieve all remaining rows.
|
Equivalent to specifying a count of <command>1</command>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term>
|
||||||
NEXT
|
PRIOR
|
||||||
</TERM>
|
</term>
|
||||||
<LISTITEM>
|
<listitem>
|
||||||
<PARA>
|
<para>
|
||||||
Equivalent to specifying a count of <command>1</command>.
|
Equivalent to specifying a count of <command>-1</command>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term><replaceable class="PARAMETER">cursor</replaceable></term>
|
||||||
PRIOR
|
<listitem>
|
||||||
</TERM>
|
<para>
|
||||||
<LISTITEM>
|
An open cursor's name.
|
||||||
<PARA>
|
</para>
|
||||||
Equivalent to specifying a count of <command>-1</command>.
|
</listitem>
|
||||||
</para>
|
</varlistentry>
|
||||||
</listitem>
|
</variablelist>
|
||||||
</varlistentry>
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
|
||||||
<VARLISTENTRY>
|
<refsect2 id="R2-SQL-FETCH-2">
|
||||||
<TERM>
|
<refsect2info>
|
||||||
<REPLACEABLE CLASS="PARAMETER">cursor</REPLACEABLE>
|
<date>1998-04-15</date>
|
||||||
</TERM>
|
</refsect2info>
|
||||||
<LISTITEM>
|
<title>
|
||||||
<PARA>
|
Outputs
|
||||||
An open cursor's name.
|
</title>
|
||||||
</para>
|
<para>
|
||||||
</listitem>
|
<command>FETCH</command> returns the results of the query defined by the specified cursor.
|
||||||
</varlistentry>
|
The following messages will be returned if the query fails:
|
||||||
</variablelist>
|
|
||||||
</para>
|
|
||||||
</REFSECT2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-FETCH-2">
|
<variablelist>
|
||||||
<REFSECT2INFO>
|
<varlistentry>
|
||||||
<DATE>1998-04-15</DATE>
|
<term><computeroutput>
|
||||||
</REFSECT2INFO>
|
NOTICE: PerformPortalFetch: portal "<replaceable class="PARAMETER">cursor</replaceable>" not found
|
||||||
<TITLE>
|
</computeroutput></term>
|
||||||
Outputs
|
<listitem>
|
||||||
</TITLE>
|
<para>
|
||||||
<PARA>
|
If <replaceable class="PARAMETER">cursor</replaceable>
|
||||||
FETCH returns the results of the query defined by the specified cursor.
|
is not previously declared.
|
||||||
The following messages will be returned if the query fails:
|
The cursor must be declared within a transaction block.
|
||||||
</para>
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<VARIABLELIST>
|
<varlistentry>
|
||||||
<VARLISTENTRY>
|
<term><computeroutput>
|
||||||
<TERM>
|
|
||||||
NOTICE: PerformPortalFetch: portal "<REPLACEABLE CLASS="PARAMETER">cursor</REPLACEABLE>" not found
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
If <REPLACEABLE CLASS="PARAMETER">cursor</REPLACEABLE>
|
|
||||||
is not previously declared.
|
|
||||||
The cursor must be declared within a transaction block.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
NOTICE: FETCH/ABSOLUTE not supported, using RELATIVE
|
NOTICE: FETCH/ABSOLUTE not supported, using RELATIVE
|
||||||
</TERM>
|
</computeroutput></term>
|
||||||
<LISTITEM>
|
<listitem>
|
||||||
<PARA>
|
<para>
|
||||||
<productname>Postgres</productname> does not support absolute
|
<productname>Postgres</productname> does not support absolute
|
||||||
positioning of cursors.
|
positioning of cursors.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term><computeroutput>
|
||||||
ERROR: FETCH/RELATIVE at current position is not supported
|
ERROR: FETCH/RELATIVE at current position is not supported
|
||||||
</TERM>
|
</computeroutput></term>
|
||||||
<LISTITEM>
|
<listitem>
|
||||||
<PARA>
|
<para>
|
||||||
<acronym>SQL92</acronym> allows one to repetatively retrieve the cursor
|
<acronym>SQL92</acronym> allows one to repetatively retrieve the cursor
|
||||||
at its "current position" using the syntax
|
at its "current position" using the syntax
|
||||||
<programlisting>
|
<synopsis>
|
||||||
FETCH RELATIVE 0 FROM <REPLACEABLE CLASS="PARAMETER">cursor</REPLACEABLE>
|
FETCH RELATIVE 0 FROM <replaceable class="PARAMETER">cursor</replaceable>
|
||||||
</programlisting>
|
</synopsis>
|
||||||
|
</para>
|
||||||
|
|
||||||
<productname>Postgres</productname> does not currently support
|
<para>
|
||||||
this notion; in fact the value zero is reserved to indicate that
|
<productname>Postgres</productname> does not currently support
|
||||||
all rows should be retrieved and is equivalent to specifying the ALL keyword.
|
this notion; in fact the value zero is reserved to indicate that
|
||||||
If the RELATIVE keyword has been used, the <productname>Postgres</productname>
|
all rows should be retrieved and is equivalent to specifying the ALL keyword.
|
||||||
assumes that the user intended <acronym>SQL92</acronym> behavior
|
If the RELATIVE keyword has been used, the <productname>Postgres</productname>
|
||||||
and returns this error message.
|
assumes that the user intended <acronym>SQL92</acronym> behavior
|
||||||
</para>
|
and returns this error message.
|
||||||
</listitem>
|
</para>
|
||||||
</varlistentry>
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
</variablelist>
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
</REFSECT2>
|
<refsect1 id="R1-SQL-FETCH-1">
|
||||||
</REFSYNOPSISDIV>
|
<refsect1info>
|
||||||
|
<date>1998-04-15</date>
|
||||||
<REFSECT1 ID="R1-SQL-FETCH-1">
|
</refsect1info>
|
||||||
<REFSECT1INFO>
|
<title>
|
||||||
<DATE>1998-04-15</DATE>
|
Description
|
||||||
</REFSECT1INFO>
|
</title>
|
||||||
<TITLE>
|
<para>
|
||||||
Description
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
FETCH allows a user to retrieve rows using a cursor.
|
FETCH allows a user to retrieve rows using a cursor.
|
||||||
The number of rows retrieved is specified by
|
The number of rows retrieved is specified by
|
||||||
<REPLACEABLE CLASS="PARAMETER">#</REPLACEABLE>.
|
<replaceable class="PARAMETER">#</replaceable>.
|
||||||
If the number of rows remaining in the cursor is less
|
If the number of rows remaining in the cursor is less
|
||||||
than <REPLACEABLE CLASS="PARAMETER">#</REPLACEABLE>,
|
than <replaceable class="PARAMETER">#</replaceable>,
|
||||||
then only those available are fetched.
|
then only those available are fetched.
|
||||||
Substituting the keyword ALL in place of a number will
|
Substituting the keyword ALL in place of a number will
|
||||||
cause all remaining rows in the cursor to be retrieved.
|
cause all remaining rows in the cursor to be retrieved.
|
||||||
Instances may be fetched in both FORWARD and BACKWARD
|
Instances may be fetched in both FORWARD and BACKWARD
|
||||||
directions. The default direction is FORWARD.
|
directions. The default direction is FORWARD.
|
||||||
|
|
||||||
<tip>
|
<tip>
|
||||||
<para>
|
<para>
|
||||||
Negative numbers are now allowed to be specified for the
|
Negative numbers are now allowed to be specified for the
|
||||||
row count. A negative number is equivalent to reversing
|
row count. A negative number is equivalent to reversing
|
||||||
the sense of the FORWARD and BACKWARD keywords. For example,
|
the sense of the FORWARD and BACKWARD keywords. For example,
|
||||||
<command>FORWARD -1</command> is the same as <command>BACKWARD 1</command>.
|
<command>FORWARD -1</command> is the same as <command>BACKWARD 1</command>.
|
||||||
</para>
|
</para>
|
||||||
</tip>
|
</tip>
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
Note that the FORWARD and BACKWARD keywords are
|
Note that the FORWARD and BACKWARD keywords are
|
||||||
<productname>Postgres</productname> extensions.
|
<productname>Postgres</productname> extensions.
|
||||||
The <acronym>SQL92</acronym> syntax is also supported, specified
|
The <acronym>SQL92</acronym> syntax is also supported, specified
|
||||||
in the second form of the command. See below for details
|
in the second form of the command. See below for details
|
||||||
on compatibility issues.
|
on compatibility issues.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
Once all rows are fetched, every other fetch access returns
|
Once all rows are fetched, every other fetch access returns
|
||||||
no rows.
|
no rows.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Updating data in a cursor is not supported by
|
Updating data in a cursor is not supported by
|
||||||
<productname>Postgres</productname>,
|
<productname>Postgres</productname>,
|
||||||
because mapping cursor updates back to base tables is
|
because mapping cursor updates back to base tables is
|
||||||
not generally possible, as is also the case with VIEW updates.
|
not generally possible, as is also the case with VIEW updates.
|
||||||
Consequently,
|
Consequently,
|
||||||
users must issue explicit UPDATE commands to replace data.
|
users must issue explicit UPDATE commands to replace data.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Cursors may only be used inside of transactions because
|
Cursors may only be used inside of transactions because
|
||||||
the data that they store spans multiple user queries.
|
the data that they store spans multiple user queries.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-FETCH-3">
|
<refsect2 id="R2-SQL-FETCH-3">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-04-15</DATE>
|
<date>1998-04-15</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Notes
|
Notes
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
Refer to MOVE statements to change cursor position.
|
Use <command>MOVE</command> to change cursor position.
|
||||||
Refer to DECLARE statements to declare a cursor.
|
<command>DECLARE</command> will define a cursor.
|
||||||
Refer to BEGIN WORK, COMMIT WORK, ROLLBACK WORK statements
|
Refer to <command>BEGIN</command>, <command>COMMIT</command>, and
|
||||||
for further information about transactions.
|
<command>ROLLBACK</command>
|
||||||
</para>
|
for further information about transactions.
|
||||||
</REFSECT2>
|
</para>
|
||||||
</refsect1>
|
</refsect2>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-FETCH-2">
|
<refsect1 id="R1-SQL-FETCH-2">
|
||||||
<TITLE>
|
<title>
|
||||||
Usage
|
Usage
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<ProgramListing>
|
<programlisting>
|
||||||
--set up and use a cursor:
|
--set up and use a cursor:
|
||||||
--
|
--
|
||||||
BEGIN WORK;
|
BEGIN WORK;
|
||||||
|
@ -326,82 +313,75 @@ Usage
|
||||||
--
|
--
|
||||||
CLOSE liahona;
|
CLOSE liahona;
|
||||||
COMMIT WORK;
|
COMMIT WORK;
|
||||||
</ProgramListing>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
</REFSECT1>
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-FETCH-3">
|
<refsect1 id="R1-SQL-FETCH-3">
|
||||||
<TITLE>
|
<title>
|
||||||
Compatibility
|
Compatibility
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
The non-embedded use of cursors is a <productname>Postgres</productname>
|
The non-embedded use of cursors is a <productname>Postgres</productname>
|
||||||
extension. The syntax and usage of cursors is being compared
|
extension. The syntax and usage of cursors is being compared
|
||||||
against the embedded form of cursors defined in <acronym>SQL92</acronym>.
|
against the embedded form of cursors defined in <acronym>SQL92</acronym>.
|
||||||
</PARA>
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-FETCH-4">
|
<refsect2 id="R2-SQL-FETCH-4">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-01</DATE>
|
<date>1998-09-01</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
SQL92
|
SQL92
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<acronym>SQL92</acronym> allows absolute positioning of the cursor for
|
<acronym>SQL92</acronym> allows absolute positioning of the cursor for
|
||||||
FETCH, and allows placing the results into explicit variables.
|
FETCH, and allows placing the results into explicit variables.
|
||||||
|
|
||||||
<synopsis>
|
<synopsis>
|
||||||
FETCH ABSOLUTE <REPLACEABLE CLASS="PARAMETER">#</REPLACEABLE>
|
FETCH ABSOLUTE <replaceable class="PARAMETER">#</replaceable>
|
||||||
FROM <REPLACEABLE CLASS="PARAMETER">cursor</REPLACEABLE>
|
FROM <replaceable class="PARAMETER">cursor</replaceable>
|
||||||
INTO :<REPLACEABLE CLASS="PARAMETER">variable</REPLACEABLE> [, ...]
|
INTO :<replaceable class="PARAMETER">variable</replaceable> [, ...]
|
||||||
</synopsis>
|
</synopsis>
|
||||||
|
|
||||||
<VARIABLELIST>
|
<variablelist>
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term>ABSOLUTE</term>
|
||||||
ABSOLUTE
|
<listitem>
|
||||||
</TERM>
|
<para>
|
||||||
<LISTITEM>
|
The cursor should be positioned to the specified absolute
|
||||||
<PARA>
|
row number. All row numbers in <productname>Postgres</productname>
|
||||||
The cursor should be positioned to the specified absolute
|
are relative numbers so this capability is not supported.
|
||||||
row number. All row numbers in <productname>Postgres</productname>
|
</para>
|
||||||
are relative numbers so this capability is not supported.
|
</listitem>
|
||||||
</para>
|
</varlistentry>
|
||||||
</listitem>
|
<varlistentry>
|
||||||
</varlistentry>
|
<term>:<replaceable class="PARAMETER">variable</replaceable></term>
|
||||||
<VARLISTENTRY>
|
<listitem>
|
||||||
<TERM>
|
<para>
|
||||||
:<REPLACEABLE CLASS="PARAMETER">variable</REPLACEABLE>
|
Target host variable(s).
|
||||||
</TERM>
|
</para>
|
||||||
<LISTITEM>
|
</listitem>
|
||||||
<PARA>
|
</varlistentry>
|
||||||
Target host variable(s).
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</refsect2>
|
||||||
</varlistentry>
|
</refsect1>
|
||||||
</variablelist>
|
</refentry>
|
||||||
</para>
|
|
||||||
</refsect2>
|
|
||||||
</refsect1>
|
|
||||||
</REFENTRY>
|
|
||||||
|
|
||||||
<!--
|
<!-- Keep this comment at the end of the file
|
||||||
<REPLACEABLE CLASS="PARAMETER">
|
Local variables:
|
||||||
</REPLACEABLE>
|
mode: sgml
|
||||||
<ReturnValue></ReturnValue>
|
sgml-omittag:nil
|
||||||
<PARA>
|
sgml-shorttag:t
|
||||||
</PARA>
|
sgml-minimize-attributes:nil
|
||||||
<VARIABLELIST>
|
sgml-always-quote-attributes:t
|
||||||
<VARLISTENTRY>
|
sgml-indent-step:1
|
||||||
<TERM>•
|
sgml-indent-data:t
|
||||||
</TERM>
|
sgml-parent-document:nil
|
||||||
<LISTITEM>
|
sgml-default-dtd-file:"../reference.ced"
|
||||||
<PARA>
|
sgml-exposed-tags:nil
|
||||||
</PARA>
|
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
||||||
</LISTITEM>
|
sgml-local-ecat-files:nil
|
||||||
</VARLISTENTRY>
|
End:
|
||||||
</VARIABLELIST>
|
|
||||||
<PARA>
|
|
||||||
</PARA>
|
|
||||||
-->
|
-->
|
||||||
|
|
|
@ -1,269 +1,257 @@
|
||||||
<REFENTRY ID="SQL-GRANT">
|
<refentry id="SQL-GRANT">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
GRANT
|
GRANT
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
GRANT
|
GRANT
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Grants access privilege to a user, a group or all users
|
Grants access privilege to a user, a group or all users
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-09-23</DATE>
|
<date>1998-09-23</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
GRANT <REPLACEABLE CLASS="PARAMETER">privilege</REPLACEABLE> [, ...]
|
GRANT <replaceable class="PARAMETER">privilege</replaceable> [, ...] ON <replaceable class="PARAMETER">object</replaceable> [, ...]
|
||||||
ON <REPLACEABLE CLASS="PARAMETER">object</REPLACEABLE> [, ...]
|
TO { PUBLIC | GROUP <replaceable class="PARAMETER">group</replaceable> | <replaceable class="PARAMETER">username</replaceable> }
|
||||||
TO { PUBLIC | GROUP <REPLACEABLE CLASS="PARAMETER">group</REPLACEABLE> | <REPLACEABLE CLASS="PARAMETER">username</REPLACEABLE> }
|
</synopsis>
|
||||||
</SYNOPSIS>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-GRANT-1">
|
<refsect2 id="R2-SQL-GRANT-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-23</DATE>
|
<date>1998-09-23</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<REPLACEABLE CLASS="PARAMETER">privilege</REPLACEABLE>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The possible privileges are:
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
SELECT
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Access all of the columns of a specific
|
|
||||||
table/view.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
INSERT
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Insert data into all columns of a
|
|
||||||
specific table.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
UPDATE
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Update all columns of a specific
|
|
||||||
table.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
DELETE
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Delete rows from a specific table.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
RULE
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Define rules on the table/view
|
|
||||||
(See CREATE RULE statement).
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
ALL
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Grant all privileges.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<REPLACEABLE CLASS="PARAMETER">object</REPLACEABLE>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The name of an object to which to grant access.
|
|
||||||
The possible objects are:
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
<itemizedlist mark="bullet" spacing="compact">
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
table
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
view
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
sequence
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
index
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</itemizedlist>
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
<variablelist>
|
||||||
<TERM>
|
<varlistentry>
|
||||||
PUBLIC
|
<term><replaceable class="PARAMETER">privilege</replaceable></term>
|
||||||
</TERM>
|
<listitem>
|
||||||
<LISTITEM>
|
<para>
|
||||||
<PARA>
|
The possible privileges are:
|
||||||
A short form representing all users.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
GROUP <REPLACEABLE CLASS="PARAMETER">group</REPLACEABLE>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
A <REPLACEABLE CLASS="PARAMETER">group</REPLACEABLE> to whom to grant privileges.
|
|
||||||
In the current release, the group must be created explicitly as described below.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<REPLACEABLE CLASS="PARAMETER">username</REPLACEABLE>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The name of a user to whom grant privileges. PUBLIC is a short form
|
|
||||||
representing all users.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
</VARIABLELIST>
|
|
||||||
</para>
|
|
||||||
</REFSECT2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-GRANT-2">
|
<variablelist>
|
||||||
<REFSECT2INFO>
|
<varlistentry>
|
||||||
<DATE>1998-09-23</DATE>
|
<term>SELECT</term>
|
||||||
</REFSECT2INFO>
|
<listitem>
|
||||||
<TITLE>
|
<para>
|
||||||
Outputs
|
Access all of the columns of a specific
|
||||||
</TITLE>
|
table/view.
|
||||||
<PARA>
|
</para>
|
||||||
|
</listitem>
|
||||||
<VARIABLELIST>
|
</varlistentry>
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
CHANGE
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Message returned if successful.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
ERROR: ChangeAcl: class "<REPLACEABLE CLASS="PARAMETER">object</REPLACEABLE>"
|
|
||||||
not found
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Message returned if the specified object is not available or
|
|
||||||
if it is impossible
|
|
||||||
to give privileges to the specified group or users.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
</VARIABLELIST>
|
|
||||||
</para>
|
|
||||||
</REFSECT2>
|
|
||||||
</REFSYNOPSISDIV>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-GRANT-1">
|
<varlistentry>
|
||||||
<REFSECT1INFO>
|
<term>INSERT</term>
|
||||||
<DATE>1998-09-23</DATE>
|
<listitem>
|
||||||
</REFSECT1INFO>
|
<para>
|
||||||
<TITLE>
|
Insert data into all columns of a
|
||||||
Description
|
specific table.
|
||||||
</TITLE>
|
</para>
|
||||||
<PARA>
|
</listitem>
|
||||||
GRANT allows the creator of an object to give specific permissions to
|
</varlistentry>
|
||||||
all users (PUBLIC) or to a certain user or group.
|
|
||||||
Users other than the creator don't have any access permission
|
|
||||||
unless the creator GRANTs permissions, after the object
|
|
||||||
is created.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
Once a user has a privilege on an object, he is enabled to exercise
|
|
||||||
that privilege.
|
|
||||||
There is no need to GRANT privileges to the creator of
|
|
||||||
an object, the creator automatically holds ALL privileges, and can
|
|
||||||
also drop the object.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-GRANT-3">
|
<varlistentry>
|
||||||
<REFSECT2INFO>
|
<term>UPDATE</term>
|
||||||
<DATE>1998-09-23</DATE>
|
<listitem>
|
||||||
</REFSECT2INFO>
|
<para>
|
||||||
<TITLE>
|
Update all columns of a specific
|
||||||
Notes
|
table.
|
||||||
</TITLE>
|
</para>
|
||||||
<PARA>
|
</listitem>
|
||||||
Use the <command>psql \z</command> command
|
</varlistentry>
|
||||||
for further information about permissions
|
|
||||||
on existing objects:
|
<varlistentry>
|
||||||
<programlisting>
|
<term>DELETE</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Delete rows from a specific table.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>RULE</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Define rules on the table/view
|
||||||
|
(See CREATE RULE statement).
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>ALL</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Grant all privileges.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="PARAMETER">object</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The name of an object to which to grant access.
|
||||||
|
The possible objects are:
|
||||||
|
|
||||||
|
<itemizedlist spacing="compact" mark="bullet">
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
table
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
view
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
sequence
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
index
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>PUBLIC</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
A short form representing all users.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>GROUP <replaceable class="PARAMETER">group</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
A <replaceable class="PARAMETER">group</replaceable> to whom to grant privileges.
|
||||||
|
In the current release, the group must be created explicitly as described below.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>
|
||||||
|
<replaceable class="PARAMETER">username</replaceable>
|
||||||
|
</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The name of a user to whom grant privileges. PUBLIC is a short form
|
||||||
|
representing all users.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
|
||||||
|
<refsect2 id="R2-SQL-GRANT-2">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-09-23</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
Outputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
CHANGE
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Message returned if successful.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
ERROR: ChangeAcl: class "<replaceable class="PARAMETER">object</replaceable>" not found
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Message returned if the specified object is not available or
|
||||||
|
if it is impossible
|
||||||
|
to give privileges to the specified group or users.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-GRANT-1">
|
||||||
|
<refsect1info>
|
||||||
|
<date>1998-09-23</date>
|
||||||
|
</refsect1info>
|
||||||
|
<title>
|
||||||
|
Description
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
<command>GRANT</command> allows the creator of an object to give specific permissions to
|
||||||
|
all users (PUBLIC) or to a certain user or group.
|
||||||
|
Users other than the creator don't have any access permission
|
||||||
|
unless the creator GRANTs permissions, after the object
|
||||||
|
is created.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Once a user has a privilege on an object, he is enabled to exercise
|
||||||
|
that privilege.
|
||||||
|
There is no need to GRANT privileges to the creator of
|
||||||
|
an object, the creator automatically holds ALL privileges, and can
|
||||||
|
also drop the object.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<refsect2 id="R2-SQL-GRANT-3">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-09-23</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
Notes
|
||||||
|
</title>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Currently, to grant privileges in <productname>Postgres</productname>
|
||||||
|
to only few columns, you must
|
||||||
|
create a view having desired columns and then grant privileges
|
||||||
|
to that view.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Use <command>psql \z</command>
|
||||||
|
for further information about permissions
|
||||||
|
on existing objects:
|
||||||
|
<programlisting>
|
||||||
Database = lusitania
|
Database = lusitania
|
||||||
+------------------+---------------------------------------------+
|
+------------------+---------------------------------------------+
|
||||||
| Relation | Grant/Revoke Permissions |
|
| Relation | Grant/Revoke Permissions |
|
||||||
|
@ -280,229 +268,204 @@
|
||||||
a -- INSERT
|
a -- INSERT
|
||||||
R -- RULE
|
R -- RULE
|
||||||
arwR -- ALL
|
arwR -- ALL
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
<tip>
|
<tip>
|
||||||
<para>
|
<para>
|
||||||
Currently, to create a GROUP you have to insert
|
Currently, to create a GROUP you have to insert
|
||||||
data manually into table pg_group as:
|
data manually into table pg_group as:
|
||||||
<programlisting>
|
|
||||||
INSERT INTO pg_group VALUES ('todos');
|
|
||||||
CREATE USER miriam IN GROUP todos;
|
|
||||||
</programlisting>
|
|
||||||
Refer to REVOKE statements to revoke access privileges.
|
|
||||||
</para>
|
|
||||||
</tip>
|
|
||||||
</para>
|
|
||||||
</REFSECT2>
|
|
||||||
</refsect1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-GRANT-2">
|
|
||||||
<TITLE>
|
|
||||||
Usage
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
<ProgramListing>
|
|
||||||
-- grant insert privilege to all users on table films:
|
|
||||||
--
|
|
||||||
GRANT INSERT ON films TO PUBLIC;
|
|
||||||
</programlisting>
|
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
-- grant all privileges to user manuel on view kinds:
|
INSERT INTO pg_group VALUES ('todos');
|
||||||
--
|
CREATE USER miriam IN GROUP todos;
|
||||||
GRANT ALL ON kinds TO manuel;
|
</programlisting>
|
||||||
</ProgramListing>
|
</para>
|
||||||
</para>
|
</tip>
|
||||||
</REFSECT1>
|
</para>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-GRANT-3">
|
<para>
|
||||||
<TITLE>
|
Refer to REVOKE statements to revoke access privileges.
|
||||||
Compatibility
|
</para>
|
||||||
</TITLE>
|
</refsect2>
|
||||||
<PARA>
|
</refsect1>
|
||||||
</PARA>
|
|
||||||
|
<refsect1 id="R1-SQL-GRANT-2">
|
||||||
|
<title>
|
||||||
|
Usage
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
Grant insert privilege to all users on table films:
|
||||||
|
|
||||||
|
<programlisting>
|
||||||
|
GRANT INSERT ON films TO PUBLIC;
|
||||||
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Grant all privileges to user manuel on view kinds:
|
||||||
|
|
||||||
|
<programlisting>
|
||||||
|
GRANT ALL ON kinds TO manuel;
|
||||||
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-GRANT-3">
|
||||||
|
<title>
|
||||||
|
Compatibility
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-GRANT-4">
|
<refsect2 id="R2-SQL-GRANT-4">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-23</DATE>
|
<date>1998-09-23</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
SQL92
|
SQL92
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
The <acronym>SQL92</acronym> syntax for GRANT allows setting privileges
|
The <acronym>SQL92</acronym> syntax for GRANT allows setting privileges
|
||||||
for individual columns
|
for individual columns
|
||||||
within a table, and allows setting a privilege to grant
|
within a table, and allows setting a privilege to grant
|
||||||
the same privileges to others.
|
the same privileges to others:
|
||||||
|
|
||||||
<SYNOPSIS>
|
|
||||||
GRANT <REPLACEABLE CLASS="PARAMETER">privilege</REPLACEABLE> [, ...]
|
|
||||||
ON <REPLACEABLE CLASS="PARAMETER">object</REPLACEABLE> [ ( <REPLACEABLE CLASS="PARAMETER">column</REPLACEABLE> [, ...] ) ] [, ...]
|
|
||||||
TO { PUBLIC | <REPLACEABLE CLASS="PARAMETER">username</REPLACEABLE> [, ...] }
|
|
||||||
[ WITH GRANT OPTION ]
|
|
||||||
</SYNOPSIS>
|
|
||||||
|
|
||||||
Fields are compatible with the those in the <acronym>Postgres</acronym>
|
|
||||||
implementation, with the following additions:
|
|
||||||
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<REPLACEABLE CLASS="PARAMETER">privilege</REPLACEABLE>
|
|
||||||
SELECT
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
<acronym>SQL92</acronym> permits additional privileges to be specified:
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
REFERENCES
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Allowed to reference some or all of the columns of a specific
|
|
||||||
table/view in integrity constraints.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
USAGE
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Allowed to use a domain, character set, collation
|
|
||||||
or translation.
|
|
||||||
If an object specifies anything other than a table/view,
|
|
||||||
<REPLACEABLE CLASS="PARAMETER">privilege</REPLACEABLE>
|
|
||||||
must specify only USAGE.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
</variablelist>
|
|
||||||
|
|
||||||
<tip>
|
|
||||||
<para>
|
|
||||||
Currently, to grant privileges in <productname>Postgres</productname>
|
|
||||||
to only few columns, you must
|
|
||||||
create a view having desired columns and then grant privileges
|
|
||||||
to that view.
|
|
||||||
</para>
|
|
||||||
</tip>
|
|
||||||
|
|
||||||
<variablelist>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<REPLACEABLE CLASS="PARAMETER">object</REPLACEABLE>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
|
|
||||||
<variablelist>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<REPLACEABLE CLASS="PARAMETER">object</REPLACEABLE>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
<acronym>SQL92</acronym> allows an additional non-functional keyword:
|
|
||||||
|
|
||||||
<simplelist>
|
|
||||||
<member>
|
|
||||||
[ TABLE ] table
|
|
||||||
</member>
|
|
||||||
</simplelist>
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
CHARACTER SET
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Allowed to use the specified character set.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
COLLATION
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Allowed to use the specified collation sequence.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
TRANSLATION
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Allowed to use the specified character set translation.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
DOMAIN
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Allowed to use the specified domain.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
WITH GRANT OPTION
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Allowed to grant the same privilege to others.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
</variablelist>
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
</variablelist>
|
|
||||||
</para>
|
|
||||||
</refsect2>
|
|
||||||
</refsect1>
|
|
||||||
</REFENTRY>
|
|
||||||
|
|
||||||
<!--
|
<synopsis>
|
||||||
<REPLACEABLE CLASS="PARAMETER">
|
GRANT <replaceable class="PARAMETER">privilege</replaceable> [, ...]
|
||||||
</REPLACEABLE>
|
ON <replaceable class="PARAMETER">object</replaceable> [ ( <replaceable class="PARAMETER">column</replaceable> [, ...] ) ] [, ...]
|
||||||
<ReturnValue></ReturnValue>
|
TO { PUBLIC | <replaceable class="PARAMETER">username</replaceable> [, ...] } [ WITH GRANT OPTION ]
|
||||||
<PARA>
|
</synopsis>
|
||||||
</PARA>
|
</para>
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
<para>
|
||||||
<TERM>•
|
Fields are compatible with the those in the <acronym>Postgres</acronym>
|
||||||
</TERM>
|
implementation, with the following additions:
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
<variablelist>
|
||||||
</PARA>
|
<varlistentry>
|
||||||
</LISTITEM>
|
<term><replaceable class="PARAMETER">privilege</replaceable></term>
|
||||||
</VARLISTENTRY>
|
<listitem>
|
||||||
</VARIABLELIST>
|
<para>
|
||||||
<PARA>
|
<acronym>SQL92</acronym> permits additional privileges to be specified:
|
||||||
</PARA>
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term>SELECT</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>REFERENCES</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Allowed to reference some or all of the columns of a specific
|
||||||
|
table/view in integrity constraints.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>USAGE</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Allowed to use a domain, character set, collation
|
||||||
|
or translation.
|
||||||
|
If an object specifies anything other than a table/view,
|
||||||
|
<replaceable class="PARAMETER">privilege</replaceable>
|
||||||
|
must specify only USAGE.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="PARAMETER">object</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term>[ TABLE ] <replaceable class="PARAMETER">table</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
<acronym>SQL92</acronym> allows the additional
|
||||||
|
non-functional keyword <literal>TABLE</literal>.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>CHARACTER SET</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Allowed to use the specified character set.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>COLLATION</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Allowed to use the specified collation sequence.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>TRANSLATION</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Allowed to use the specified character set translation.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>DOMAIN</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Allowed to use the specified domain.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>WITH GRANT OPTION</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Allowed to grant the same privilege to others.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
|
||||||
|
<!-- Keep this comment at the end of the file
|
||||||
|
Local variables:
|
||||||
|
mode: sgml
|
||||||
|
sgml-omittag:nil
|
||||||
|
sgml-shorttag:t
|
||||||
|
sgml-minimize-attributes:nil
|
||||||
|
sgml-always-quote-attributes:t
|
||||||
|
sgml-indent-step:1
|
||||||
|
sgml-indent-data:t
|
||||||
|
sgml-parent-document:nil
|
||||||
|
sgml-default-dtd-file:"../reference.ced"
|
||||||
|
sgml-exposed-tags:nil
|
||||||
|
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
||||||
|
sgml-local-ecat-files:nil
|
||||||
|
End:
|
||||||
-->
|
-->
|
||||||
|
|
|
@ -1,313 +1,315 @@
|
||||||
<REFENTRY ID="APP-INITDB">
|
<refentry id="APP-INITDB">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
<application>initdb</application>
|
<application>initdb</application>
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>Application</REFMISCINFO>
|
<refmiscinfo>Application</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
<application>initdb</application>
|
<application>initdb</application>
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Create a new <productname>Postgres</productname> database installation
|
Create a new <productname>Postgres</productname> database installation
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-10-02</DATE>
|
<date>1998-10-02</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
initdb [ --pgdata=<replaceable class="parameter">dbdir</replaceable> | -r <replaceable class="parameter">dbdir</replaceable> ]
|
initdb [ --pgdata=<replaceable class="parameter">dbdir</replaceable> | -r <replaceable class="parameter">dbdir</replaceable> ]
|
||||||
[ --pglib=<replaceable class="parameter">libdir</replaceable> | -l <replaceable class="parameter">libdir</replaceable> ]
|
[ --pglib=<replaceable class="parameter">libdir</replaceable> | -l <replaceable class="parameter">libdir</replaceable> ]
|
||||||
[ --template=<replaceable class="parameter">template</replaceable> | -t <replaceable class="parameter">template</replaceable> ]
|
[ --template=<replaceable class="parameter">template</replaceable> | -t <replaceable class="parameter">template</replaceable> ]
|
||||||
[ --username=<replaceable class="parameter">name</replaceable> | -u <replaceable class="parameter">name</replaceable> ]
|
[ --username=<replaceable class="parameter">name</replaceable> | -u <replaceable class="parameter">name</replaceable> ]
|
||||||
[ --noclean | -n ] [ --debug | -d ]
|
[ --noclean | -n ] [ --debug | -d ]
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-APP-INITDB-1">
|
<refsect2 id="R2-APP-INITDB-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-10-02</DATE>
|
<date>1998-10-02</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<variablelist>
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
--pglib=<replaceable class="parameter">libdir</replaceable>
|
|
||||||
</term>
|
|
||||||
<term>
|
|
||||||
-l <replaceable class="parameter">libdir</replaceable>
|
|
||||||
</term>
|
|
||||||
<term>
|
|
||||||
<envar>PGLIB</envar>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Where are the files that make up <productname>Postgres</productname>?
|
|
||||||
Apart from files that
|
|
||||||
have to go in particular directories because of their function, the
|
|
||||||
files that make up the <productname>Postgres</productname> software
|
|
||||||
were installed in a directory
|
|
||||||
called the <replaceable class="parameter">libdir</replaceable> directory.
|
|
||||||
An example of a file that will be found
|
|
||||||
there that <application>initdb</application>
|
|
||||||
needs is <filename>global1.bki.source</filename>,
|
|
||||||
which contains all the information that goes
|
|
||||||
into the shared catalog tables.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
--pgdata=<replaceable class="parameter">dbdir</replaceable>
|
|
||||||
</term>
|
|
||||||
<term>
|
|
||||||
-r <replaceable class="parameter">dbdir</replaceable>
|
|
||||||
</term>
|
|
||||||
<term>
|
|
||||||
<envar>PGDATA</envar>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Where in your Unix filesystem do you want the database data to go?
|
|
||||||
The top level directory is called the <envar>PGDATA</envar> directory.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
--username=<replaceable class="parameter">name</replaceable>
|
|
||||||
</term>
|
|
||||||
<term>
|
|
||||||
-u <replaceable class="parameter">name</replaceable>
|
|
||||||
</term>
|
|
||||||
<term>
|
|
||||||
<envar>PGUSER</envar>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Who will be the <productname>Postgres</productname> superuser
|
|
||||||
for this database system? The
|
|
||||||
<productname>Postgres</productname> superuser is a Unix user
|
|
||||||
who owns all files that store the database
|
|
||||||
system and also owns the postmaster and backend processes that access them.
|
|
||||||
Or just let it default to you (the Unix user who runs
|
|
||||||
<application>initdb</application>).
|
|
||||||
</para>
|
|
||||||
<note>
|
|
||||||
<para>
|
|
||||||
Only the Unix superuser (<literal>root</literal>)
|
|
||||||
can create a database system with an owner
|
|
||||||
different from the <productname>Postgres</productname> superuser.
|
|
||||||
</para>
|
|
||||||
</note>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
</variablelist>
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
Other, less commonly used, parameters are also available:
|
|
||||||
|
|
||||||
<variablelist>
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
--template=<replaceable class="parameter">template</replaceable>
|
|
||||||
</term>
|
|
||||||
<term>
|
|
||||||
-t <replaceable class="parameter">template</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Replace the <literal>template1</literal>
|
|
||||||
database in an existing database system, and don't touch anything else.
|
|
||||||
This is useful when you need to upgrade your <literal>template1</literal>
|
|
||||||
database using <application>initdb</application>
|
|
||||||
from a newer release of <productname>Postgres</productname>,
|
|
||||||
or when your <literal>template1</literal>
|
|
||||||
database has become corrupted by some system problem. Normally the
|
|
||||||
contents of <literal>template1</literal>
|
|
||||||
remain constant throughout the life of the database system. You can't
|
|
||||||
destroy anything by running <application>initdb</application>
|
|
||||||
with the
|
|
||||||
<option>--template</option>
|
|
||||||
option.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
--noclean
|
|
||||||
</term>
|
|
||||||
<term>
|
|
||||||
-n
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
By default, when <application>initdb</application>
|
|
||||||
determines that error prevent it from completely creating the database
|
|
||||||
system, it removes any files it may have created before determining
|
|
||||||
that it can't finish the job. That includes any core files left by
|
|
||||||
the programs it invokes. This option inhibits any tidying-up and is
|
|
||||||
thus useful for debugging.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
--debug
|
|
||||||
</term>
|
|
||||||
<term>
|
|
||||||
-d
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Print debugging output from the bootstrap backend.
|
|
||||||
The bootstrap backend is the program <application>initdb</application>
|
|
||||||
uses to create the catalog tables. This option generates a tremendous
|
|
||||||
amount of output. It also turns off the final vacuuming step.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
</variablelist>
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
Files are also input to <application>initdb</application>:
|
|
||||||
|
|
||||||
<variablelist>
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
<application>postconfig</application>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
If appearing somewhere in the Unix command search path
|
|
||||||
(defined by the PATH environment variable).
|
|
||||||
This is a program that specifies defaults for some of the
|
|
||||||
command options. See below.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
<filename><envar>PGLIB</envar>/global1.bki.source</filename>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Contents for the shared catalog tables in the new database system. This
|
|
||||||
file is part of the <productname>Postgres</productname> software.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
<filename><envar>PGLIB</envar>/local1_template1.bki.source</filename>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Contents for the template1 tables in the new database system. This
|
|
||||||
file is part of the <productname>Postgres</productname> software.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
</variablelist>
|
|
||||||
</para>
|
|
||||||
</refsect2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-APP-INITDB-2">
|
<variablelist>
|
||||||
<REFSECT2INFO>
|
<varlistentry>
|
||||||
<DATE>1998-09-26</DATE>
|
<term>--pglib=<replaceable class="parameter">libdir</replaceable></term>
|
||||||
</REFSECT2INFO>
|
<term>-l <replaceable class="parameter">libdir</replaceable></term>
|
||||||
<TITLE>
|
<term><envar>PGLIB</envar></term>
|
||||||
Outputs
|
<listitem>
|
||||||
</TITLE>
|
<para>
|
||||||
<PARA>
|
Where are the files that make up <productname>Postgres</productname>?
|
||||||
<application>initdb</application> will create files in the <envar>PGDATA</envar>
|
Apart from files that
|
||||||
data area which are the system tables and framework for a complete
|
have to go in particular directories because of their function, the
|
||||||
installation.
|
files that make up the <productname>Postgres</productname> software
|
||||||
</para>
|
were installed in a directory
|
||||||
</refsect2>
|
called the <replaceable class="parameter">libdir</replaceable> directory.
|
||||||
</refsynopsisdiv>
|
An example of a file that will be found
|
||||||
|
there that <application>initdb</application>
|
||||||
|
needs is <filename>global1.bki.source</filename>,
|
||||||
|
which contains all the information that goes
|
||||||
|
into the shared catalog tables.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-APP-INITDB-1">
|
<varlistentry>
|
||||||
<REFSECT1INFO>
|
<term>--pgdata=<replaceable class="parameter">dbdir</replaceable></term>
|
||||||
<DATE>1998-09-26</DATE>
|
<term>-r <replaceable class="parameter">dbdir</replaceable></term>
|
||||||
</REFSECT1INFO>
|
<term><envar>PGDATA</envar></term>
|
||||||
<TITLE>
|
<listitem>
|
||||||
Description
|
<para>
|
||||||
</TITLE>
|
Where in your Unix filesystem do you want the database data to go?
|
||||||
<PARA>
|
The top level directory is called the <envar>PGDATA</envar> directory.
|
||||||
<application>initdb</application> creates a new
|
</para>
|
||||||
<productname>Postgres</productname> database system.
|
</listitem>
|
||||||
A database system is a
|
</varlistentry>
|
||||||
collection of databases that are all administered by the same Unix user
|
|
||||||
and managed by a single postmaster.
|
<varlistentry>
|
||||||
</para>
|
<term>--username=<replaceable class="parameter">name</replaceable></term>
|
||||||
<para>
|
<term>-u <replaceable class="parameter">name</replaceable></term>
|
||||||
Creating a database system consists of creating the directories in which
|
<term><envar>PGUSER</envar></term>
|
||||||
the database data will live, generating the shared catalog tables
|
<listitem>
|
||||||
(tables that don't belong to any particular database), and
|
<para>
|
||||||
creating the <literal>template1</literal>
|
Who will be the <productname>Postgres</productname> superuser
|
||||||
database. What is the <literal>template1</literal>
|
for this database system? The
|
||||||
database? When you create a database, <productname>Postgres</productname>
|
<productname>Postgres</productname> superuser is a Unix user
|
||||||
does it by copying
|
who owns all files that store the database
|
||||||
everything from the <literal>template1</literal>
|
system and also owns the postmaster and backend processes that access them.
|
||||||
database. It contains catalog tables filled in for things like the
|
Or just let it default to you (the Unix user who runs
|
||||||
builtin types.
|
<application>initdb</application>).
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<note>
|
||||||
After <application>initdb</application>
|
<para>
|
||||||
creates the database, it completes the initialization by running
|
Only the Unix superuser (<literal>root</literal>)
|
||||||
<application>vacuum</application>, which resets some optimization parameters.
|
can create a database system with an owner
|
||||||
</para>
|
different from the <productname>Postgres</productname> superuser.
|
||||||
<para>
|
</para>
|
||||||
There are three ways to give parameters to <application>initdb</application>.
|
</note>
|
||||||
|
</listitem>
|
||||||
First, you can use <application>initdb</application> command options.
|
</varlistentry>
|
||||||
Second, you can set environment
|
</variablelist>
|
||||||
variables before invoking <application>initdb</application>.
|
</para>
|
||||||
Third, you can have a program called <application>postconfig</application>
|
|
||||||
in your Unix command search path.
|
<para>
|
||||||
|
Other, less commonly used, parameters are also available:
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term>--template=<replaceable class="parameter">template</replaceable></term>
|
||||||
|
<term>-t <replaceable class="parameter">template</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Replace the <literal>template1</literal>
|
||||||
|
database in an existing database system, and don't touch anything else.
|
||||||
|
This is useful when you need to upgrade your <literal>template1</literal>
|
||||||
|
database using <application>initdb</application>
|
||||||
|
from a newer release of <productname>Postgres</productname>,
|
||||||
|
or when your <literal>template1</literal>
|
||||||
|
database has become corrupted by some system problem. Normally the
|
||||||
|
contents of <literal>template1</literal>
|
||||||
|
remain constant throughout the life of the database system. You can't
|
||||||
|
destroy anything by running <application>initdb</application>
|
||||||
|
with the
|
||||||
|
<option>--template</option>
|
||||||
|
option.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>--noclean</term>
|
||||||
|
<term>-n</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
By default, when <application>initdb</application>
|
||||||
|
determines that error prevent it from completely creating the database
|
||||||
|
system, it removes any files it may have created before determining
|
||||||
|
that it can't finish the job. That includes any core files left by
|
||||||
|
the programs it invokes. This option inhibits any tidying-up and is
|
||||||
|
thus useful for debugging.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>--debug</term>
|
||||||
|
<term>-d</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Print debugging output from the bootstrap backend.
|
||||||
|
The bootstrap backend is the program <application>initdb</application>
|
||||||
|
uses to create the catalog tables. This option generates a tremendous
|
||||||
|
amount of output. It also turns off the final vacuuming step.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Files are also input to <application>initdb</application>:
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><application>postconfig</application></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
If appearing somewhere in the Unix command search path
|
||||||
|
(defined by the PATH environment variable).
|
||||||
|
This is a program that specifies defaults for some of the
|
||||||
|
command options. See below.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><filename><envar>PGLIB</envar>/global1.bki.source</filename></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Contents for the shared catalog tables in the new database system. This
|
||||||
|
file is part of the <productname>Postgres</productname> software.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><filename><envar>PGLIB</envar>/local1_template1.bki.source</filename></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Contents for the template1 tables in the new database system. This
|
||||||
|
file is part of the <productname>Postgres</productname> software.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
|
||||||
|
<refsect2 id="R2-APP-INITDB-2">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-09-26</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
Outputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
<application>initdb</application> will create files in the
|
||||||
|
<envar>PGDATA</envar>
|
||||||
|
data area which are the system tables and framework for a complete
|
||||||
|
installation.
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
|
<refsect1 id="R1-APP-INITDB-1">
|
||||||
|
<refsect1info>
|
||||||
|
<date>1998-09-26</date>
|
||||||
|
</refsect1info>
|
||||||
|
<title>
|
||||||
|
Description
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
<application>initdb</application> creates a new
|
||||||
|
<productname>Postgres</productname> database system.
|
||||||
|
A database system is a
|
||||||
|
collection of databases that are all administered by the same Unix user
|
||||||
|
and managed by a single postmaster.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Creating a database system consists of creating the directories in which
|
||||||
|
the database data will live, generating the shared catalog tables
|
||||||
|
(tables that don't belong to any particular database), and
|
||||||
|
creating the <literal>template1</literal>
|
||||||
|
database. What is the <literal>template1</literal>
|
||||||
|
database? When you create a database, <productname>Postgres</productname>
|
||||||
|
does it by copying
|
||||||
|
everything from the <literal>template1</literal>
|
||||||
|
database. It contains catalog tables filled in for things like the
|
||||||
|
builtin types.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
After <application>initdb</application>
|
||||||
|
creates the database, it completes the initialization by running
|
||||||
|
<application>vacuum</application>, which resets some optimization parameters.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
There are three ways to give parameters to <application>initdb</application>.
|
||||||
|
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
You can use <application>initdb</application> command options.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
You can set environment
|
||||||
|
variables before invoking <application>initdb</application>.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
You can have a program called <application>postconfig</application>
|
||||||
|
in your Unix command search path.
|
||||||
<application>initdb</application> invokes that program and that program then writes
|
<application>initdb</application> invokes that program and that program then writes
|
||||||
<application>initdb</application> parameters to its standard output stream.
|
<application>initdb</application> parameters to its standard output stream.
|
||||||
This third option is not a common thing to do, however.
|
This third option is not a common thing to do, however.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
</listitem>
|
||||||
Command options always override parameters specified any other way.
|
</itemizedlist>
|
||||||
The values returned by <application>postconfig</application>
|
</para>
|
||||||
override any environment variables, but your
|
|
||||||
<application>postconfig</application>
|
<para>
|
||||||
program may base its output on the environment variables if you want
|
Command options always override parameters specified any other way.
|
||||||
their values to be used.
|
The values returned by <application>postconfig</application>
|
||||||
</para>
|
override any environment variables, but your
|
||||||
<para>
|
<application>postconfig</application>
|
||||||
The value that <application>postconfig</application>
|
program may base its output on the environment variables if you want
|
||||||
outputs must have the format
|
their values to be used.
|
||||||
<programlisting>
|
</para>
|
||||||
<replaceable>var1</replaceable>=<replaceable class="parameter">value1</replaceable> <replaceable>var2</replaceable>=<replaceable class="parameter">value2</replaceable> ...
|
|
||||||
</programlisting>
|
<para>
|
||||||
|
The value that <application>postconfig</application>
|
||||||
It can output nothing if it doesn't want to supply any parameters.
|
outputs must have the format
|
||||||
The <replaceable>var</replaceable> values are equal to
|
<synopsis>
|
||||||
the corresponding environment variable
|
<replaceable>var1</replaceable>=<replaceable class="parameter">value1</replaceable> <replaceable class="parameter">var2</replaceable>=<replaceable class="parameter">value2</replaceable> ...
|
||||||
names. For example,
|
</synopsis>
|
||||||
<programlisting>
|
|
||||||
PGDATA=/tmp/postgres_test
|
It can output nothing if it doesn't want to supply any parameters.
|
||||||
</programlisting>
|
The <replaceable>var</replaceable> values are equal to
|
||||||
has the
|
the corresponding environment variable
|
||||||
same effect as invoking <application>initdb</application>
|
names. For example,
|
||||||
with an environment variable called <envar>PGDATA</envar> whose value is
|
<programlisting>
|
||||||
<filename>/tmp/postgres_test</filename>.
|
PGDATA=/tmp/postgres_test
|
||||||
</para>
|
</programlisting>
|
||||||
</refsect1>
|
has the
|
||||||
</REFENTRY>
|
same effect as invoking <application>initdb</application>
|
||||||
|
with an environment variable called <envar>PGDATA</envar> whose value is
|
||||||
|
<filename>/tmp/postgres_test</filename>.
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
|
||||||
|
<!-- Keep this comment at the end of the file
|
||||||
|
Local variables:
|
||||||
|
mode: sgml
|
||||||
|
sgml-omittag:nil
|
||||||
|
sgml-shorttag:t
|
||||||
|
sgml-minimize-attributes:nil
|
||||||
|
sgml-always-quote-attributes:t
|
||||||
|
sgml-indent-step:1
|
||||||
|
sgml-indent-data:t
|
||||||
|
sgml-parent-document:nil
|
||||||
|
sgml-default-dtd-file:"../reference.ced"
|
||||||
|
sgml-exposed-tags:nil
|
||||||
|
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
||||||
|
sgml-local-ecat-files:nil
|
||||||
|
End:
|
||||||
|
-->
|
||||||
|
|
|
@ -1,228 +1,233 @@
|
||||||
<REFENTRY ID="APP-INITLOCATION">
|
<refentry id="APP-INITLOCATION">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
<application>initlocation</application>
|
<application>initlocation</application>
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>Application</REFMISCINFO>
|
<refmiscinfo>Application</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
<application>initlocation</application>
|
<application>initlocation</application>
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Create a secondary <productname>Postgres</productname> database storage area
|
Create a secondary <productname>Postgres</productname> database storage area
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-10-02</DATE>
|
<date>1998-10-02</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
initlocation [ --location=<replaceable class="parameter">altdir</replaceable> | -D <replaceable class="parameter">altdir</replaceable> ]
|
initlocation [ --location=<replaceable class="parameter">er">al</replaceable>ble> | -D <replaceable class="parameter">altdir</replaceable> ]
|
||||||
[ --username=<replaceable class="parameter">name</replaceable> | -u <replaceable class="parameter">name</replaceable> ]
|
[ --username=<replaceable class="parameter">name</replaceable> | -u <replaceable class="parameter">name</replaceable> ]
|
||||||
[ <replaceable class="parameter">altdir</replaceable> ]
|
[ <replaceable class="parameter">altdir</replaceable> ]
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-APP-INITLOCATION-1">
|
<refsect2 id="R2-APP-INITLOCATION-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-10-02</DATE>
|
<date>1998-10-02</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
|
|
||||||
<variablelist>
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
--location=<replaceable class="parameter">altdir</replaceable>
|
|
||||||
</term>
|
|
||||||
<term>
|
|
||||||
-D <replaceable class="parameter">altdir</replaceable>
|
|
||||||
</term>
|
|
||||||
<term>
|
|
||||||
<replaceable class="parameter">altdir</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Where in your Unix filesystem do you want alternate databases to go?
|
|
||||||
The top level directory is called the <envar>PGDATA</envar> directory, so you
|
|
||||||
might want to point your first alternate location at <envar>PGDATA2</envar>.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
--username=<replaceable class="parameter">name</replaceable>
|
|
||||||
</term>
|
|
||||||
<term>
|
|
||||||
-u <replaceable class="parameter">name</replaceable>
|
|
||||||
</term>
|
|
||||||
<term>
|
|
||||||
<envar>PGUSER</envar>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Who will be the Unix filesystem owner of this database storage area?
|
|
||||||
The
|
|
||||||
<productname>Postgres</productname> superuser is a Unix user
|
|
||||||
who owns all files that store the database
|
|
||||||
system and also owns the postmaster and backend processes that access them.
|
|
||||||
Usually, this is the user who should run <application>initlocation</application>
|
|
||||||
and who will thus have ownership of the directories and files.
|
|
||||||
</para>
|
|
||||||
<note>
|
|
||||||
<para>
|
|
||||||
Only the Unix superuser can create a database system with a
|
|
||||||
different user as the <productname>Postgres</productname> superuser.
|
|
||||||
Specifying a user other than the <productname>Postgres</productname> superuser
|
|
||||||
may lead to database security and data integrity problems. Refer to the
|
|
||||||
<citetitle><productname>PostgreSQL</productname> Administrator's Guide</citetitle>
|
|
||||||
for more information.
|
|
||||||
</para>
|
|
||||||
</note>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
</variablelist>
|
|
||||||
</para>
|
|
||||||
</refsect2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-APP-INITLOCATION-2">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-09-26</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Outputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
<application>initlocation</application> will create directories in
|
|
||||||
the specified place.
|
|
||||||
|
|
||||||
<variablelist>
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
We are initializing the database area with username postgres (uid=500).
|
|
||||||
This user will own all the files and must also own the server process.
|
|
||||||
Creating Postgres database system directory <replaceable class="parameter">altdir</replaceable>
|
|
||||||
Creating Postgres database system directory <replaceable class="parameter">altdir</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Successful completion.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
We are initializing the database area with username postgres (uid=500).
|
|
||||||
This user will own all the files and must also own the server process.
|
|
||||||
Creating Postgres database system directory /usr/local/src/testlocation
|
|
||||||
mkdir: cannot make directory `<replaceable class="parameter">altdir</replaceable>': Permission denied
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
You do not have filesystem permission to write to the specified directory area.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
Valid username not given. You must specify the username for
|
|
||||||
the Postgres superuser for the database system you are
|
|
||||||
initializing, either with the --username option or by default
|
|
||||||
to the USER environment variable.
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
The username which you have specified is not the
|
|
||||||
<productname>Postgres</productname> superuser.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
Can't tell what username to use. You don't have the USER
|
|
||||||
environment variable set to your username and didn't specify the
|
|
||||||
--username option
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Specify the <option>--username</option> command line option.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
</variablelist>
|
|
||||||
</para>
|
|
||||||
</refsect2>
|
|
||||||
</refsynopsisdiv>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-APP-INITLOCATION-1">
|
<variablelist>
|
||||||
<REFSECT1INFO>
|
<varlistentry>
|
||||||
<DATE>1998-09-26</DATE>
|
<term>--location=<replaceable class="parameter">altdir</replaceable></term>
|
||||||
</REFSECT1INFO>
|
<term>-D <replaceable class="parameter">altdir</replaceable></term>
|
||||||
<TITLE>
|
<term><replaceable class="parameter">altdir</replaceable></term>
|
||||||
Description
|
<listitem>
|
||||||
</TITLE>
|
<para>
|
||||||
<PARA>
|
Where in your Unix filesystem do you want alternate databases to go?
|
||||||
<application>initlocation</application>
|
The top level directory is called the <envar>PGDATA</envar> directory, so you
|
||||||
creates a new <productname>Postgres</productname> secondary database storage area.
|
might want to point your first alternate location at
|
||||||
A secondary storage area contains a required tree of directories with
|
<envar>PGDATA2</envar>.
|
||||||
the correct file permissions on those directories.
|
</para>
|
||||||
</para>
|
</listitem>
|
||||||
<para>
|
</varlistentry>
|
||||||
Creating a database storage area consists of creating the directories in which
|
|
||||||
database data might live.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
There are two kinds of arguments for <application>initlocation</application>.
|
|
||||||
First, you can specify an environment variable (e.g. <envar>PGDATA2</envar>).
|
|
||||||
This environment variable should be known to the backend for later use in
|
|
||||||
<command>CREATE DATABASE/WITH LOCATION</command>
|
|
||||||
or
|
|
||||||
<command>createdb -D <replaceable class="parameter">altdir</replaceable></command>.
|
|
||||||
However, <emphasis>the backend daemon must have this variable in it's
|
|
||||||
environment</emphasis> for this to succeed.
|
|
||||||
|
|
||||||
Second, you may be able to specify an explicit
|
|
||||||
absolute path to the top directory of the storage area. However,this second
|
|
||||||
option is possible only if explicitly enabled during the
|
|
||||||
<productname>Postgres</productname> installation. It is usually disabled
|
|
||||||
to alleviate security and data integrity concerns.
|
|
||||||
</para>
|
|
||||||
<note>
|
|
||||||
<para>
|
|
||||||
<productname>Postgres</productname> will add <filename>/base/</filename>
|
|
||||||
to the specified path to create the storage area.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
The backend requires that any argument to <option>WITH LOCATION</option> which is
|
|
||||||
in all uppercase and which has no path delimiters is an environment variable.
|
|
||||||
</para>
|
|
||||||
</note>
|
|
||||||
</refsect1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-APP-INITLOCATION-2">
|
<varlistentry>
|
||||||
<REFSECT1INFO>
|
<term>--username=<replaceable class="parameter">name</replaceable></term>
|
||||||
<DATE>1998-09-26</DATE>
|
<term>-u <replaceable class="parameter">name</replaceable></term>
|
||||||
</REFSECT1INFO>
|
<term><envar>PGUSER</envar></term>
|
||||||
<TITLE>
|
<listitem>
|
||||||
Usage
|
<para>
|
||||||
</TITLE>
|
Who will be the Unix filesystem owner of this database storage area?
|
||||||
<PARA>
|
The
|
||||||
To create a database in an alternate location, using an environment variable:
|
<productname>Postgres</productname> superuser is a Unix user
|
||||||
|
who owns all files that store the database
|
||||||
|
system and also owns the postmaster and backend processes that access them.
|
||||||
|
Usually, this is the user who should run <application>initlocation</application>
|
||||||
|
and who will thus have ownership of the directories and files.
|
||||||
|
</para>
|
||||||
|
<note>
|
||||||
|
<para>
|
||||||
|
Only the Unix superuser can create a database system with a
|
||||||
|
different user as the <productname>Postgres</productname> superuser.
|
||||||
|
Specifying a user other than the <productname>Postgres</productname> superuser
|
||||||
|
may lead to database security and data integrity problems. Refer to the
|
||||||
|
<citetitle><productname>PostgreSQL</productname> Administrator's Guide</citetitle>
|
||||||
|
for more information.
|
||||||
|
</para>
|
||||||
|
</note>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
|
||||||
<programlisting>
|
<refsect2 id="R2-APP-INITLOCATION-2">
|
||||||
% setenv PGDATA2 /opt/postgres/data
|
<refsect2info>
|
||||||
|
<date>1998-09-26</date>
|
||||||
% initlocation PGDATA2
|
</refsect2info>
|
||||||
% createdb -D PGDATA2
|
<title>
|
||||||
</programlisting>
|
Outputs
|
||||||
</para>
|
</title>
|
||||||
</refsect1>
|
<para>
|
||||||
</REFENTRY>
|
<application>initlocation</application> will create directories in
|
||||||
|
the specified place.
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
We are initializing the database area with username postgres (uid=500).
|
||||||
|
This user will own all the files and must also own the server process.
|
||||||
|
Creating Postgres database system directory <replaceable class="parameter">altdir</replaceable>
|
||||||
|
Creating Postgres database system directory <replaceable class="parameter">altdir</replaceable>
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Successful completion.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
We are initializing the database area with username postgres (uid=500).
|
||||||
|
This user will own all the files and must also own the server process.
|
||||||
|
Creating Postgres database system directory /usr/local/src/testlocation
|
||||||
|
mkdir: cannot make directory `<replaceable class="parameter">altdir</replaceable>': Permission denied
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
You do not have filesystem permission to write to the specified directory area.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
Valid username not given. You must specify the username for
|
||||||
|
the Postgres superuser for the database system you are
|
||||||
|
initializing, either with the --username option or by default
|
||||||
|
to the USER environment variable.
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The username which you have specified is not the
|
||||||
|
<productname>Postgres</productname> superuser.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
Can't tell what username to use. You don't have the USER
|
||||||
|
environment variable set to your username and didn't specify the
|
||||||
|
--username option
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Specify the <option>--username</option> command line option.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
|
<refsect1 id="R1-APP-INITLOCATION-1">
|
||||||
|
<refsect1info>
|
||||||
|
<date>1998-09-26</date>
|
||||||
|
</refsect1info>
|
||||||
|
<title>
|
||||||
|
Description
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
<application>initlocation</application>
|
||||||
|
creates a new <productname>Postgres</productname> secondary database storage area.
|
||||||
|
A secondary storage area contains a required tree of directories with
|
||||||
|
the correct file permissions on those directories.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Creating a database storage area consists of creating the directories in which
|
||||||
|
database data might live.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
There are two kinds of arguments for <application>initlocation</application>.
|
||||||
|
|
||||||
|
First, you can specify an environment variable (e.g. <envar>PGDATA2</envar>).
|
||||||
|
This environment variable should be known to the backend for later use in
|
||||||
|
<command>CREATE DATABASE/WITH LOCATION</command>
|
||||||
|
or
|
||||||
|
<command>createdb -D <replaceable class="parameter">altdir</replaceable></command>.
|
||||||
|
However, <emphasis>the backend daemon must have this variable in it's
|
||||||
|
environment</emphasis> for this to succeed.
|
||||||
|
|
||||||
|
Second, you may be able to specify an explicit
|
||||||
|
absolute path to the top directory of the storage area. However,this second
|
||||||
|
option is possible only if explicitly enabled during the
|
||||||
|
<productname>Postgres</productname> installation. It is usually disabled
|
||||||
|
to alleviate security and data integrity concerns.
|
||||||
|
</para>
|
||||||
|
<note>
|
||||||
|
<para>
|
||||||
|
<productname>Postgres</productname> will add <filename>/base/</filename>
|
||||||
|
to the specified path to create the storage area.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
The backend requires that any argument to <option>WITH LOCATION</option> which is
|
||||||
|
in all uppercase and which has no path delimiters is an environment variable.
|
||||||
|
</para>
|
||||||
|
</note>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1 id="R1-APP-INITLOCATION-2">
|
||||||
|
<refsect1info>
|
||||||
|
<date>1998-09-26</date>
|
||||||
|
</refsect1info>
|
||||||
|
<title>
|
||||||
|
Usage
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
To create a database in an alternate location, using an environment variable:
|
||||||
|
|
||||||
|
<programlisting>
|
||||||
|
% setenv PGDATA2 /opt/postgres/data
|
||||||
|
% initlocation PGDATA2
|
||||||
|
% createdb -D PGDATA2
|
||||||
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
|
||||||
|
<!-- Keep this comment at the end of the file
|
||||||
|
Local variables:
|
||||||
|
mode: sgml
|
||||||
|
sgml-omittag:nil
|
||||||
|
sgml-shorttag:t
|
||||||
|
sgml-minimize-attributes:nil
|
||||||
|
sgml-always-quote-attributes:t
|
||||||
|
sgml-indent-step:1
|
||||||
|
sgml-indent-data:t
|
||||||
|
sgml-parent-document:nil
|
||||||
|
sgml-default-dtd-file:"../reference.ced"
|
||||||
|
sgml-exposed-tags:nil
|
||||||
|
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
||||||
|
sgml-local-ecat-files:nil
|
||||||
|
End:
|
||||||
|
-->
|
||||||
|
|
|
@ -1,237 +1,235 @@
|
||||||
<REFENTRY ID="SQL-INSERT">
|
<refentry id="SQL-INSERT">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
INSERT
|
INSERT
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
INSERT
|
INSERT
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Inserts new rows into a table
|
Inserts new rows into a table
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-09-23</DATE>
|
<date>1998-09-23</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
INSERT INTO <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> [ ( <REPLACEABLE CLASS="PARAMETER">column</REPLACEABLE> [, ...] ) ]
|
INSERT INTO <replaceable class="PARAMETER">table</replaceable> [ ( <replaceable class="PARAMETER">column</replaceable> [, ...] ) ]
|
||||||
{ VALUES ( <REPLACEABLE CLASS="PARAMETER">expression</REPLACEABLE> [, ...] ) | SELECT <REPLACEABLE CLASS="PARAMETER">query</REPLACEABLE> }
|
{ VALUES ( <replaceable class="PARAMETER">expression</replaceable> [, ...] ) | SELECT <replaceable class="PARAMETER">query</replaceable> }
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-INSERT-1">
|
<refsect2 id="R2-SQL-INSERT-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-23</DATE>
|
<date>1998-09-23</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</PARA>
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The name of an existing table.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<REPLACEABLE CLASS="PARAMETER">column</REPLACEABLE>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
The name of a column in <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<REPLACEABLE CLASS="PARAMETER">expression</REPLACEABLE>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
A valid expression or value to assign to <REPLACEABLE CLASS="PARAMETER">column</REPLACEABLE>.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<REPLACEABLE CLASS="PARAMETER">query</REPLACEABLE>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
A valid query. Refer to the SELECT statement for a further description
|
|
||||||
of valid arguments.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
</VARIABLELIST>
|
|
||||||
|
|
||||||
</REFSECT2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-INSERT-2">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-09-23</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Outputs
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>INSERT <replaceable>oid</replaceable></ReturnValue> 1
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Message returned if only one row was inserted.
|
|
||||||
<ReturnValue><replaceable>oid</replaceable></ReturnValue>
|
|
||||||
is the numeric <acronym>OID</acronym> of the inserted row.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
<ReturnValue>INSERT 0 <replaceable>#</replaceable></ReturnValue>
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Message returned if more than one rows were inserted.
|
|
||||||
<ReturnValue><replaceable>#</replaceable></ReturnValue>
|
|
||||||
is the number of rows inserted.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
</VARIABLELIST>
|
|
||||||
</para>
|
|
||||||
</REFSECT2>
|
|
||||||
</REFSYNOPSISDIV>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-INSERT-1">
|
|
||||||
<REFSECT1INFO>
|
|
||||||
<DATE>1998-09-02</DATE>
|
|
||||||
</REFSECT1INFO>
|
|
||||||
<TITLE>
|
|
||||||
Description
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
INSERT allows one to insert new rows into a table. One can insert
|
|
||||||
a single row at time or several rows as a result of a query.
|
|
||||||
The columns in the target list may be listed in any order.
|
|
||||||
In every column not present in the target list will be inserted
|
|
||||||
the default value, if column has not a declared default value
|
|
||||||
it will be assumed as NULL. If the expression for each column
|
|
||||||
is not of the correct data type, automatic type coercion will be
|
|
||||||
attempted.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
You must have insert privilege to a table in order to append
|
|
||||||
to it, as well as select privilege on any table specified
|
|
||||||
in a WHERE clause.
|
|
||||||
</para>
|
|
||||||
</refsect1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-INSERT-2">
|
<variablelist>
|
||||||
<TITLE>
|
<varlistentry>
|
||||||
Usage
|
<term><replaceable class="PARAMETER">table</replaceable></term>
|
||||||
</TITLE>
|
<listitem>
|
||||||
<PARA>
|
<para>
|
||||||
<ProgramListing>
|
The name of an existing table.
|
||||||
--Insert a single row into table films;
|
</para>
|
||||||
--(in the second example the column date_prod is omitted
|
</listitem>
|
||||||
--therefore will be stored in it a default value of NULL):
|
</varlistentry>
|
||||||
--
|
<varlistentry>
|
||||||
INSERT INTO films VALUES
|
<term><replaceable class="PARAMETER">column</replaceable></term>
|
||||||
('UA502','Bananas',105,'1971-07-13','Comedy',INTERVAL '82 minute');
|
<listitem>
|
||||||
|
<para>
|
||||||
INSERT INTO films (code, title, did, date_prod, kind)
|
The name of a column in <replaceable class="PARAMETER">table</replaceable>.
|
||||||
VALUES ('T_601', 'Yojimbo', 106, DATE '1961-06-16', 'Drama');
|
</para>
|
||||||
</ProgramListing>
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
<ProgramListing>
|
|
||||||
--Insert a single row into table distributors, note that
|
<varlistentry>
|
||||||
--only column "name" is specified, to the non specified
|
<term><replaceable class="PARAMETER">expression</replaceable></term>
|
||||||
--column "did" will be assigned its default value:
|
<listitem>
|
||||||
--
|
<para>
|
||||||
INSERT INTO distributors (name) VALUES ('British Lion');
|
A valid expression or value to assign to <replaceable
|
||||||
</ProgramListing>
|
class="PARAMETER">column</replaceable>.
|
||||||
|
</para>
|
||||||
<ProgramListing>
|
</listitem>
|
||||||
--Insert several rows into table films from table tmp:
|
</varlistentry>
|
||||||
--
|
|
||||||
INSERT INTO films
|
<varlistentry>
|
||||||
SELECT * FROM tmp;
|
<term><replaceable class="PARAMETER">query</replaceable></term>
|
||||||
</ProgramListing>
|
<listitem>
|
||||||
|
<para>
|
||||||
<ProgramListing>
|
A valid query. Refer to the SELECT statement for a further description
|
||||||
--Insert into arrays:
|
of valid arguments.
|
||||||
--Create an empty 3x3 gameboard for noughts-and-crosses
|
</para>
|
||||||
--(all of these queries create the same board attribute)
|
</listitem>
|
||||||
--(Refer to the <citetitle>PostgreSQL User's Guide</citetitle> for further
|
</varlistentry>
|
||||||
--information about arrays).
|
</variablelist>
|
||||||
|
</para>
|
||||||
INSERT INTO tictactoe (game, board[1:3][1:3])
|
</refsect2>
|
||||||
VALUES (1,'{{"","",""},{},{"",""}}');
|
|
||||||
INSERT INTO tictactoe (game, board[3][3])
|
|
||||||
VALUES (2,'{}');
|
|
||||||
INSERT INTO tictactoe (game, board)
|
|
||||||
VALUES (3,'{{,,},{,,},{,,}}');
|
|
||||||
</ProgramListing>
|
|
||||||
</para>
|
|
||||||
</REFSECT1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-INSERT-3">
|
<refsect2 id="R2-SQL-INSERT-2">
|
||||||
<TITLE>
|
<refsect2info>
|
||||||
Compatibility
|
<date>1998-09-23</date>
|
||||||
</TITLE>
|
</refsect2info>
|
||||||
<PARA>
|
<title>
|
||||||
</PARA>
|
Outputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
INSERT <replaceable>oid</replaceable> 1
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Message returned if only one row was inserted.
|
||||||
|
<returnvalue><replaceable>oid</replaceable></returnvalue>
|
||||||
|
is the numeric <acronym>OID</acronym> of the inserted row.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
INSERT 0 <replaceable>#</replaceable>
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Message returned if more than one rows were inserted.
|
||||||
|
<returnvalue><replaceable>#</replaceable></returnvalue>
|
||||||
|
is the number of rows inserted.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-INSERT-1">
|
||||||
|
<refsect1info>
|
||||||
|
<date>1998-09-02</date>
|
||||||
|
</refsect1info>
|
||||||
|
<title>
|
||||||
|
Description
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
<command>INSERT</command> allows one to insert new rows into a table. One can insert
|
||||||
|
a single row at time or several rows as a result of a query.
|
||||||
|
The columns in the target list may be listed in any order.
|
||||||
|
In every column not present in the target list will be inserted
|
||||||
|
the default value, if column has not a declared default value
|
||||||
|
it will be assumed as NULL. If the expression for each column
|
||||||
|
is not of the correct data type, automatic type coercion will be
|
||||||
|
attempted.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
You must have insert privilege to a table in order to append
|
||||||
|
to it, as well as select privilege on any table specified
|
||||||
|
in a WHERE clause.
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-INSERT-2">
|
||||||
|
<title>
|
||||||
|
Usage
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
Insert a single row into table <literal>films</literal>:
|
||||||
|
|
||||||
|
<programlisting>
|
||||||
|
INSERT INTO films VALUES
|
||||||
|
('UA502','Bananas',105,'1971-07-13','Comedy',INTERVAL '82 minute');
|
||||||
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
In this second example the column <literal>date_prod</literal> is
|
||||||
|
omitted and therefore it will have the default value of NULL:
|
||||||
|
|
||||||
|
<programlisting>
|
||||||
|
INSERT INTO films (code, title, did, date_prod, kind)
|
||||||
|
VALUES ('T_601', 'Yojimbo', 106, DATE '1961-06-16', 'Drama');
|
||||||
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Insert a single row into table distributors; note that
|
||||||
|
only column <literal>name</literal> is specified, so the omitted
|
||||||
|
column <literal>did</literal> will be assigned its default value:
|
||||||
|
|
||||||
|
<programlisting>
|
||||||
|
INSERT INTO distributors (name) VALUES ('British Lion');
|
||||||
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Insert several rows into table films from table <literal>tmp</literal>:
|
||||||
|
|
||||||
|
<programlisting>
|
||||||
|
INSERT INTO films SELECT * FROM tmp;
|
||||||
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Insert into arrays (refer to <citetitle>The PostgreSQL User's Guide</citetitle> for further
|
||||||
|
information about arrays):
|
||||||
|
|
||||||
|
<programlisting>
|
||||||
|
-- Create an empty 3x3 gameboard for noughts-and-crosses
|
||||||
|
-- (all of these queries create the same board attribute)
|
||||||
|
INSERT INTO tictactoe (game, board[1:3][1:3])
|
||||||
|
VALUES (1,'{{"","",""},{},{"",""}}');
|
||||||
|
INSERT INTO tictactoe (game, board[3][3])
|
||||||
|
VALUES (2,'{}');
|
||||||
|
INSERT INTO tictactoe (game, board)
|
||||||
|
VALUES (3,'{{,,},{,,},{,,}}');
|
||||||
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-INSERT-3">
|
||||||
|
<title>
|
||||||
|
Compatibility
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
</para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-INSERT-4">
|
<refsect2 id="R2-SQL-INSERT-4">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-23</DATE>
|
<date>1998-09-23</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
SQL92
|
SQL92
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
The INSERT statement is fully compatible with <acronym>SQL92</acronym>.
|
<command>INSERT</command> is fully compatible with <acronym>SQL92</acronym>.
|
||||||
Possible limitations in features of the
|
Possible limitations in features of the
|
||||||
<REPLACEABLE CLASS="PARAMETER">query</REPLACEABLE>
|
<replaceable class="PARAMETER">query</replaceable>
|
||||||
clause are documented for the SELECT statement.
|
clause are documented for the SELECT statement.
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
</refentry>
|
||||||
|
|
||||||
<!--
|
<!-- Keep this comment at the end of the file
|
||||||
<REPLACEABLE CLASS="PARAMETER">
|
Local variables:
|
||||||
</REPLACEABLE>
|
mode: sgml
|
||||||
<ReturnValue></ReturnValue>
|
sgml-omittag:nil
|
||||||
<PARA>
|
sgml-shorttag:t
|
||||||
</PARA>
|
sgml-minimize-attributes:nil
|
||||||
<VARIABLELIST>
|
sgml-always-quote-attributes:t
|
||||||
<VARLISTENTRY>
|
sgml-indent-step:1
|
||||||
<TERM>•
|
sgml-indent-data:t
|
||||||
</TERM>
|
sgml-parent-document:nil
|
||||||
<LISTITEM>
|
sgml-default-dtd-file:"../reference.ced"
|
||||||
<PARA>
|
sgml-exposed-tags:nil
|
||||||
</PARA>
|
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
||||||
</LISTITEM>
|
sgml-local-ecat-files:nil
|
||||||
</VARLISTENTRY>
|
End:
|
||||||
</VARIABLELIST>
|
|
||||||
<PARA>
|
|
||||||
</PARA>
|
|
||||||
-->
|
-->
|
||||||
|
|
|
@ -1,185 +1,199 @@
|
||||||
<REFENTRY ID="SQL-LISTEN">
|
<refentry id="SQL-LISTEN">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
LISTEN
|
LISTEN
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
LISTEN
|
LISTEN
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Listen for notification on a notify condition
|
Listen for a response on a notify condition
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-10-07</DATE>
|
<date>1998-10-07</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
LISTEN <REPLACEABLE CLASS="PARAMETER">notifyname</REPLACEABLE>
|
LISTEN <replaceable class="PARAMETER">name</replaceable>
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-LISTEN-1">
|
<refsect2 id="R2-SQL-LISTEN-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-10-07</DATE>
|
<date>1998-10-07</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</PARA>
|
|
||||||
<VARIABLELIST>
|
<variablelist>
|
||||||
<VARLISTENTRY>
|
<varlistentry>
|
||||||
<TERM>
|
<term><replaceable class="PARAMETER">name</replaceable></term>
|
||||||
<REPLACEABLE CLASS="PARAMETER">notifyname</REPLACEABLE>
|
<listitem>
|
||||||
</TERM>
|
<para>
|
||||||
<LISTITEM>
|
Name of notify condition.
|
||||||
<PARA>
|
</para>
|
||||||
Name of notify condition.
|
</listitem>
|
||||||
</para>
|
</varlistentry>
|
||||||
</listitem>
|
</variablelist>
|
||||||
</varlistentry>
|
</para>
|
||||||
</VARIABLELIST>
|
</refsect2>
|
||||||
|
|
||||||
</REFSECT2>
|
<refsect2 id="R2-SQL-LISTEN-2">
|
||||||
|
<refsect2info>
|
||||||
<REFSECT2 ID="R2-SQL-LISTEN-2">
|
<date>1998-09-24</date>
|
||||||
<REFSECT2INFO>
|
</refsect2info>
|
||||||
<DATE>1998-09-24</DATE>
|
<title>
|
||||||
</REFSECT2INFO>
|
Outputs
|
||||||
<TITLE>
|
</title>
|
||||||
Outputs
|
<para>
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
<VARIABLELIST>
|
<term><computeroutput>
|
||||||
<VARLISTENTRY>
|
LISTEN
|
||||||
<TERM>
|
</computeroutput></term>
|
||||||
<returnvalue>LISTEN</returnvalue>
|
<listitem>
|
||||||
</TERM>
|
<para>
|
||||||
<LISTITEM>
|
Message returned upon successful completion of registration.
|
||||||
<PARA>
|
</para>
|
||||||
Message returned upon successful completion of registration.
|
</listitem>
|
||||||
</PARA>
|
</varlistentry>
|
||||||
</LISTITEM>
|
<varlistentry>
|
||||||
</VARLISTENTRY>
|
<term><computeroutput>
|
||||||
<VARLISTENTRY>
|
NOTICE Async_Listen: We are already listening on <replaceable class="PARAMETER">name</replaceable>
|
||||||
<TERM>
|
</computeroutput></term>
|
||||||
<returnvalue>NOTICE Async_Listen: We are already listening on notifyname</returnvalue>
|
<listitem>
|
||||||
</TERM>
|
<para>
|
||||||
<LISTITEM>
|
If this backend is already registered for that notify condition.
|
||||||
<PARA>
|
</para>
|
||||||
If this backend is already registered for that notify condition.
|
</listitem>
|
||||||
</PARA>
|
</varlistentry>
|
||||||
</listitem>
|
</variablelist>
|
||||||
</varlistentry>
|
</para>
|
||||||
</VARIABLELIST>
|
</refsect2>
|
||||||
</para>
|
</refsynopsisdiv>
|
||||||
</REFSECT2>
|
|
||||||
</REFSYNOPSISDIV>
|
<refsect1 id="R1-SQL-LISTEN-1">
|
||||||
|
<refsect1info>
|
||||||
<REFSECT1 ID="R1-SQL-LISTEN-1">
|
<date>1998-10-07</date>
|
||||||
<REFSECT1INFO>
|
</refsect1info>
|
||||||
<DATE>1998-10-07</DATE>
|
<title>
|
||||||
</REFSECT1INFO>
|
Description
|
||||||
<TITLE>
|
</title>
|
||||||
Description
|
<para>
|
||||||
</TITLE>
|
<command>LISTEN</command> registers the current <productname>Postgres</productname> backend as a
|
||||||
<PARA>
|
listener on the notify condition
|
||||||
LISTEN registers the current <productname>Postgres</productname> backend as a
|
<replaceable class="PARAMETER">name</replaceable>.
|
||||||
listener on the notify condition
|
</para>
|
||||||
<REPLACEABLE CLASS="PARAMETER">notifyname</REPLACEABLE>.
|
<para>
|
||||||
</para>
|
Whenever the command
|
||||||
<para>
|
<command>NOTIFY <replaceable class="PARAMETER">name</replaceable></command>
|
||||||
Whenever the command
|
is invoked, either by this backend or another one connected to
|
||||||
<command>NOTIFY <REPLACEABLE CLASS="PARAMETER">notifyname</REPLACEABLE></command>
|
the same database, all the backends currently listening on that notify
|
||||||
is invoked, either by this backend or another one connected to
|
condition are notified, and each will in turn notify its connected
|
||||||
the same database, all the backends currently listening on that notify
|
frontend application. See the discussion of <command>NOTIFY</command>
|
||||||
condition are notified, and each will in turn notify its connected
|
for more information.
|
||||||
frontend application. See the discussion of <command>NOTIFY</command>
|
</para>
|
||||||
for more information.
|
<para>
|
||||||
</para>
|
A backend can be unregistered for a given notify condition with the
|
||||||
<para>
|
<command>UNLISTEN</command> command. Also, a backend's listen registrations
|
||||||
A backend can be deregistered for a given notify condition with the
|
are automatically cleared when the backend process exits.
|
||||||
<command>UNLISTEN</command> command. Also, a backend's listen registrations
|
</para>
|
||||||
are automatically cleared when the backend process exits.
|
<para>
|
||||||
</para>
|
The method a frontend application must use to detect notify events depends on
|
||||||
<para>
|
which <productname>Postgres</productname> application programming interface it
|
||||||
The method a frontend application must use to detect notify events depends on
|
uses. With the basic libpq library, the application issues
|
||||||
which <productname>Postgres</productname> application programming interface it
|
<command>LISTEN</command> as an ordinary SQL command, and then must
|
||||||
uses. With the basic libpq library, the application issues
|
periodically call the routine <function>PQnotifies</function> to find out
|
||||||
<command>LISTEN</command> as an ordinary SQL command, and then must
|
whether any notify events have been received. Other interfaces such as
|
||||||
periodically call the routine <function>PQnotifies</function> to find out
|
libpgtcl provide higher-level methods for handling notify events; indeed,
|
||||||
whether any notify events have been received. Other interfaces such as
|
with libpgtcl the application programmer should not even issue
|
||||||
libpgtcl provide higher-level methods for handling notify events; indeed,
|
<command>LISTEN</command> or <command>UNLISTEN</command> directly. See the
|
||||||
with libpgtcl the application programmer should not even issue
|
documentation for the library you are using for more details.
|
||||||
<command>LISTEN</command> or <command>UNLISTEN</command> directly. See the
|
</para>
|
||||||
documentation for the library you are using for more details.
|
<para>
|
||||||
</para>
|
The reference page for <command>NOTIFY</command> contains a more extensive
|
||||||
<para>
|
discussion of the use of <command>LISTEN</command> and
|
||||||
The reference page for <command>NOTIFY</command> contains a more extensive
|
<command>NOTIFY</command>.
|
||||||
discussion of the use of <command>LISTEN</command> and
|
</para>
|
||||||
<command>NOTIFY</command>.
|
|
||||||
</para>
|
<refsect2 id="R2-SQL-LISTEN-3">
|
||||||
|
<refsect2info>
|
||||||
<REFSECT2 ID="R2-SQL-LISTEN-3">
|
<date>1998-10-07</date>
|
||||||
<REFSECT2INFO>
|
</refsect2info>
|
||||||
<DATE>1998-10-07</DATE>
|
<title>
|
||||||
</REFSECT2INFO>
|
Notes
|
||||||
<TITLE>
|
</title>
|
||||||
Notes
|
<para>
|
||||||
</TITLE>
|
<replaceable class="PARAMETER">name</replaceable>
|
||||||
<para>
|
can be any string valid as a name;
|
||||||
<REPLACEABLE CLASS="PARAMETER">notifyname</REPLACEABLE>
|
it need not correspond to the name of any actual table. If
|
||||||
can be any string valid as a name;
|
<replaceable class="PARAMETER">notifyname</replaceable>
|
||||||
it need not correspond to the name of any actual table. If
|
is enclosed in double-quotes, it need not even be a syntactically
|
||||||
<REPLACEABLE CLASS="PARAMETER">notifyname</REPLACEABLE>
|
valid name, but can be any string up to 31 characters long.
|
||||||
is enclosed in double-quotes, it need not even be a syntactically
|
</para>
|
||||||
valid name, but can be any string up to 31 characters long.
|
<para>
|
||||||
</para>
|
In some previous releases of
|
||||||
<para>
|
<productname>Postgres</productname>,
|
||||||
In some previous releases of
|
<replaceable class="PARAMETER">name</replaceable>
|
||||||
<productname>Postgres</productname>,
|
had to be enclosed in double-quotes when it did not correspond to any existing
|
||||||
<REPLACEABLE CLASS="PARAMETER">notifyname</REPLACEABLE>
|
table name, even if syntactically valid as a name. That is no longer required.
|
||||||
had to be enclosed in double-quotes when it did not correspond to any existing
|
</para>
|
||||||
table name, even if syntactically valid as a name. That is no longer required.
|
</refsect2>
|
||||||
</para>
|
</refsect1>
|
||||||
</REFSECT2>
|
|
||||||
</refsect1>
|
<refsect1 id="R1-SQL-LISTEN-2">
|
||||||
|
<title>
|
||||||
<REFSECT1 ID="R1-SQL-LISTEN-2">
|
Usage
|
||||||
<TITLE>
|
</title>
|
||||||
Usage
|
<para>
|
||||||
</TITLE>
|
Configure and execute a listen/notify sequence from <application>psql</application>:
|
||||||
<PARA>
|
<programlisting>
|
||||||
<ProgramListing>
|
LISTEN virtual;
|
||||||
-- Configure and execute a listen/notify sequence from psql
|
NOTIFY virtual;
|
||||||
postgres=> listen virtual;
|
|
||||||
LISTEN
|
ASYNC NOTIFY of 'virtual' from backend pid '11239' received
|
||||||
postgres=> notify virtual;
|
</programlisting>
|
||||||
NOTIFY
|
</para>
|
||||||
ASYNC NOTIFY of 'virtual' from backend pid '11239' received
|
</refsect1>
|
||||||
</ProgramListing>
|
|
||||||
</para>
|
<refsect1 id="R1-SQL-LISTEN-3">
|
||||||
</REFSECT1>
|
<title>
|
||||||
|
Compatibility
|
||||||
<REFSECT1 ID="R1-SQL-LISTEN-3">
|
</title>
|
||||||
<TITLE>
|
|
||||||
Compatibility
|
<refsect2 id="R2-SQL-LISTEN-4">
|
||||||
</TITLE>
|
<refsect2info>
|
||||||
|
<date>1998-09-01</date>
|
||||||
<REFSECT2 ID="R2-SQL-LISTEN-4">
|
</refsect2info>
|
||||||
<REFSECT2INFO>
|
<title>
|
||||||
<DATE>1998-09-01</DATE>
|
SQL92
|
||||||
</REFSECT2INFO>
|
</title>
|
||||||
<TITLE>
|
<para>
|
||||||
SQL92
|
There is no <command>LISTEN</command> in <acronym>SQL92</acronym>.
|
||||||
</TITLE>
|
</para>
|
||||||
<PARA>
|
</refsect2>
|
||||||
There is no <command>LISTEN</command> in <acronym>SQL92</acronym>.
|
</refsect1>
|
||||||
</para>
|
</refentry>
|
||||||
</refsect2>
|
|
||||||
</refsect1>
|
<!-- Keep this comment at the end of the file
|
||||||
</REFENTRY>
|
Local variables:
|
||||||
|
mode: sgml
|
||||||
|
sgml-omittag:nil
|
||||||
|
sgml-shorttag:t
|
||||||
|
sgml-minimize-attributes:nil
|
||||||
|
sgml-always-quote-attributes:t
|
||||||
|
sgml-indent-step:1
|
||||||
|
sgml-indent-data:t
|
||||||
|
sgml-parent-document:nil
|
||||||
|
sgml-default-dtd-file:"../reference.ced"
|
||||||
|
sgml-exposed-tags:nil
|
||||||
|
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
||||||
|
sgml-local-ecat-files:nil
|
||||||
|
End:
|
||||||
|
-->
|
||||||
|
|
|
@ -1,179 +1,192 @@
|
||||||
<REFENTRY ID="SQL-LOAD">
|
<refentry id="SQL-LOAD">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
LOAD
|
LOAD
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
LOAD
|
LOAD
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Dynamically loads an object file
|
Dynamically loads an object file
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-09-24</DATE>
|
<date>1998-09-24</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
<REPLACEABLE CLASS="PARAMETER">
|
LOAD '<replaceable class="PARAMETER">filename</replaceable>'
|
||||||
</REPLACEABLE>
|
</synopsis>
|
||||||
LOAD '<REPLACEABLE CLASS="PARAMETER">filename</REPLACEABLE>'
|
|
||||||
</SYNOPSIS>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-LOAD-1">
|
<refsect2 id="R2-SQL-LOAD-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-01</DATE>
|
<date>1998-09-01</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</PARA>
|
<variablelist>
|
||||||
<VARIABLELIST>
|
<varlistentry>
|
||||||
<VARLISTENTRY>
|
<term><replaceable class="PARAMETER">filename</replaceable></term>
|
||||||
<TERM>
|
<listitem>
|
||||||
<REPLACEABLE CLASS="PARAMETER">filename</REPLACEABLE>
|
<para>
|
||||||
</TERM>
|
Object file for dynamic loading.
|
||||||
<LISTITEM>
|
</para>
|
||||||
<PARA>
|
</listitem>
|
||||||
Object file for dynamic loading.
|
</varlistentry>
|
||||||
</para>
|
</variablelist>
|
||||||
</listitem>
|
</para>
|
||||||
</varlistentry>
|
</refsect2>
|
||||||
</VARIABLELIST>
|
|
||||||
|
|
||||||
</REFSECT2>
|
<refsect2 id="R2-SQL-LOAD-2">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-09-24</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
Outputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-LOAD-2">
|
<variablelist>
|
||||||
<REFSECT2INFO>
|
<varlistentry>
|
||||||
<DATE>1998-09-24</DATE>
|
<term><computeroutput>
|
||||||
</REFSECT2INFO>
|
LOAD
|
||||||
<TITLE>
|
</computeroutput></term>
|
||||||
Outputs
|
<listitem>
|
||||||
</TITLE>
|
<para>
|
||||||
<PARA>
|
Message returned on successful completion.
|
||||||
|
</para>
|
||||||
<VARIABLELIST>
|
</listitem>
|
||||||
<VARLISTENTRY>
|
</varlistentry>
|
||||||
<TERM>
|
<varlistentry>
|
||||||
<returnvalue>LOAD</returnvalue>
|
<term><computeroutput>
|
||||||
</TERM>
|
ERROR: LOAD: could not open file '<replaceable class="PARAMETER">filename</replaceable>'
|
||||||
<LISTITEM>
|
</computeroutput></term>
|
||||||
<PARA>
|
<listitem>
|
||||||
Message returned on successful completion.
|
<para>
|
||||||
</para>
|
Message returned if the specified file is not found. The file must be visible
|
||||||
</listitem>
|
<emphasis>to the <productname>Postgres</productname> backend</emphasis>,
|
||||||
</varlistentry>
|
with the appropriate full path name specified, to avoid this message.
|
||||||
<VARLISTENTRY>
|
</para>
|
||||||
<TERM>
|
</listitem>
|
||||||
<returnvalue>ERROR: LOAD: could not open file '<REPLACEABLE CLASS="PARAMETER">filename</REPLACEABLE>'</returnvalue>
|
</varlistentry>
|
||||||
</TERM>
|
</variablelist>
|
||||||
<LISTITEM>
|
</para>
|
||||||
<PARA>
|
</refsect2>
|
||||||
Message returned if the specified file is not found. The file must be visible
|
</refsynopsisdiv>
|
||||||
<emphasis>to the <productname>Postgres</productname> backend</emphasis>,
|
|
||||||
with the appropriate full path name specified, to avoid this message.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
</VARIABLELIST>
|
|
||||||
</para>
|
|
||||||
</REFSECT2>
|
|
||||||
</REFSYNOPSISDIV>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-LOAD-1">
|
|
||||||
<REFSECT1INFO>
|
|
||||||
<DATE>1998-09-24</DATE>
|
|
||||||
</REFSECT1INFO>
|
|
||||||
<TITLE>
|
|
||||||
Description
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
Loads an object (or ".o") file into the
|
|
||||||
<productname>Postgres</productname> backend address space. Once a
|
|
||||||
file is loaded, all functions in that file can be accessed. This
|
|
||||||
function is used in support of user-defined types and functions.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
If a file is not loaded using
|
|
||||||
<command>LOAD</command>,
|
|
||||||
the file will be loaded automatically the first time the
|
|
||||||
function is called by <productname>Postgres</productname>.
|
|
||||||
<command>LOAD</command>
|
|
||||||
can also be used to reload an object file if it has been edited and
|
|
||||||
recompiled. Only objects created from C language files are supported
|
|
||||||
at this time.
|
|
||||||
</para>
|
|
||||||
<REFSECT2 ID="R2-SQL-LOAD-3">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-09-24</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Notes
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
Functions in loaded object files should not call functions in other
|
|
||||||
object files loaded through the
|
|
||||||
<command>LOAD</command>
|
|
||||||
command. For example, all functions in file <literal>A</literal> should
|
|
||||||
call each other, functions in the standard or math libraries, or in
|
|
||||||
Postgres itself. They should not call functions defined in a different
|
|
||||||
loaded file <literal>B</literal>.
|
|
||||||
This is because if <literal>B</literal> is reloaded, the Postgres loader is
|
|
||||||
not able to relocate the calls from the functions in <literal>A</literal> into
|
|
||||||
the new address space of <literal>B</literal>.
|
|
||||||
If <literal>B</literal> is not reloaded, however, there will
|
|
||||||
not be a problem.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
Object files must be compiled to contain position independent code.
|
|
||||||
For example,
|
|
||||||
on DECstations you must use
|
|
||||||
<application>/bin/cc</application>
|
|
||||||
with the <literal>-G 0</literal> option when compiling object files to be
|
|
||||||
loaded.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
Note that if you are porting <productname>Postgres</productname>
|
|
||||||
to a new platform, <command>LOAD</command>
|
|
||||||
will have to work in order to support ADTs.
|
|
||||||
</para>
|
|
||||||
</REFSECT2>
|
|
||||||
</refsect1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-LOAD-2">
|
<refsect1 id="R1-SQL-LOAD-1">
|
||||||
<TITLE>
|
<refsect1info>
|
||||||
Usage
|
<date>1998-09-24</date>
|
||||||
</TITLE>
|
</refsect1info>
|
||||||
<PARA>
|
<title>
|
||||||
<ProgramListing>
|
Description
|
||||||
--Load the file /usr/postgres/demo/circle.o
|
</title>
|
||||||
--
|
<para>
|
||||||
LOAD '/usr/postgres/demo/circle.o'
|
Loads an object (or ".o") file into the
|
||||||
</ProgramListing>
|
<productname>Postgres</productname> backend address space. Once a
|
||||||
</para>
|
file is loaded, all functions in that file can be accessed. This
|
||||||
</REFSECT1>
|
function is used in support of user-defined types and functions.
|
||||||
|
</para>
|
||||||
<REFSECT1 ID="R1-SQL-LOAD-3">
|
<para>
|
||||||
<TITLE>
|
If a file is not loaded using
|
||||||
Compatibility
|
<command>LOAD</command>,
|
||||||
</TITLE>
|
the file will be loaded automatically the first time the
|
||||||
<PARA>
|
function is called by <productname>Postgres</productname>.
|
||||||
</PARA>
|
<command>LOAD</command>
|
||||||
|
can also be used to reload an object file if it has been edited and
|
||||||
<REFSECT2 ID="R2-SQL-LOAD-4">
|
recompiled. Only objects created from C language files are supported
|
||||||
<REFSECT2INFO>
|
at this time.
|
||||||
<DATE>1998-09-24</DATE>
|
</para>
|
||||||
</REFSECT2INFO>
|
<refsect2 id="R2-SQL-LOAD-3">
|
||||||
<TITLE>
|
<refsect2info>
|
||||||
SQL92
|
<date>1998-09-24</date>
|
||||||
</TITLE>
|
</refsect2info>
|
||||||
<PARA>
|
<title>
|
||||||
There is no <command>LOAD</command> in <acronym>SQL92</acronym>.
|
Notes
|
||||||
</para>
|
</title>
|
||||||
</refsect2>
|
<para>
|
||||||
</refsect1>
|
Functions in loaded object files should not call functions in other
|
||||||
</REFENTRY>
|
object files loaded through the
|
||||||
|
<command>LOAD</command>
|
||||||
|
command. For example, all functions in file <literal>A</literal> should
|
||||||
|
call each other, functions in the standard or math libraries, or in
|
||||||
|
Postgres itself. They should not call functions defined in a different
|
||||||
|
loaded file <literal>B</literal>.
|
||||||
|
This is because if <literal>B</literal> is reloaded, the Postgres loader is
|
||||||
|
not able to relocate the calls from the functions in
|
||||||
|
<literal>A</literal> into
|
||||||
|
the new address space of <literal>B</literal>.
|
||||||
|
If <literal>B</literal> is not reloaded, however, there will
|
||||||
|
not be a problem.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Object files must be compiled to contain position independent code.
|
||||||
|
For example,
|
||||||
|
on DECstations you must use
|
||||||
|
<application>/bin/cc</application>
|
||||||
|
with the <literal>-G 0</literal> option when compiling object files to be
|
||||||
|
loaded.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Note that if you are porting <productname>Postgres</productname>
|
||||||
|
to a new platform, <command>LOAD</command>
|
||||||
|
will have to work in order to support ADTs.
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-LOAD-2">
|
||||||
|
<title>
|
||||||
|
Usage
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
Load the file <filename>/usr/postgres/demo/circle.o</filename>:
|
||||||
|
|
||||||
|
<programlisting>
|
||||||
|
LOAD '/usr/postgres/demo/circle.o'
|
||||||
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-LOAD-3">
|
||||||
|
<title>
|
||||||
|
Compatibility
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<refsect2 id="R2-SQL-LOAD-4">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-09-24</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
SQL92
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
There is no <command>LOAD</command> in <acronym>SQL92</acronym>.
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
|
||||||
|
<!-- Keep this comment at the end of the file
|
||||||
|
Local variables:
|
||||||
|
mode: sgml
|
||||||
|
sgml-omittag:nil
|
||||||
|
sgml-shorttag:t
|
||||||
|
sgml-minimize-attributes:nil
|
||||||
|
sgml-always-quote-attributes:t
|
||||||
|
sgml-indent-step:1
|
||||||
|
sgml-indent-data:t
|
||||||
|
sgml-parent-document:nil
|
||||||
|
sgml-default-dtd-file:"../reference.ced"
|
||||||
|
sgml-exposed-tags:nil
|
||||||
|
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
||||||
|
sgml-local-ecat-files:nil
|
||||||
|
End:
|
||||||
|
-->
|
||||||
|
|
|
@ -34,9 +34,7 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">table</replaceable> IN SHARE ROW E
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><replaceable class="PARAMETER">table</replaceable></term>
|
||||||
<replaceable class="PARAMETER">table</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The name of an existing table to lock.
|
The name of an existing table to lock.
|
||||||
|
@ -45,17 +43,15 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">table</replaceable> IN SHARE ROW E
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>ACCESS SHARE MODE</term>
|
||||||
ACCESS SHARE MODE
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<note>
|
<note>
|
||||||
<para>
|
<para>
|
||||||
This lock mode is acquired automatically over tables being queried.
|
This lock mode is acquired automatically over tables being queried.
|
||||||
<productname>Postgres</productname> releases automatically acquired
|
<productname>Postgres</productname> releases automatically acquired
|
||||||
ACCESS SHARE locks after the statement is done.
|
ACCESS SHARE locks after the statement is done.
|
||||||
</para>
|
</para>
|
||||||
</note>
|
</note>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
This is the least restrictive lock mode which conflicts only with
|
This is the least restrictive lock mode which conflicts only with
|
||||||
|
@ -68,9 +64,7 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">table</replaceable> IN SHARE ROW E
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>ROW SHARE MODE</term>
|
||||||
ROW SHARE MODE
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<note>
|
<note>
|
||||||
<para>
|
<para>
|
||||||
|
@ -85,12 +79,10 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">table</replaceable> IN SHARE ROW E
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>ROW EXCLUSIVE MODE</term>
|
||||||
ROW EXCLUSIVE MODE
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<note>
|
<note>
|
||||||
<para>
|
<para>
|
||||||
Automatically acquired by any <command>UPDATE</command>,
|
Automatically acquired by any <command>UPDATE</command>,
|
||||||
<command>DELETE</command>, <command>INSERT</command> statement.
|
<command>DELETE</command>, <command>INSERT</command> statement.
|
||||||
</para>
|
</para>
|
||||||
|
@ -105,9 +97,7 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">table</replaceable> IN SHARE ROW E
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>SHARE MODE</term>
|
||||||
SHARE MODE
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<note>
|
<note>
|
||||||
<para>
|
<para>
|
||||||
|
@ -124,9 +114,7 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">table</replaceable> IN SHARE ROW E
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>SHARE ROW EXCLUSIVE MODE</term>
|
||||||
SHARE ROW EXCLUSIVE MODE
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
|
@ -139,9 +127,7 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">table</replaceable> IN SHARE ROW E
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>EXCLUSIVE MODE</term>
|
||||||
EXCLUSIVE MODE
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
|
@ -154,9 +140,7 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">table</replaceable> IN SHARE ROW E
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>ACCESS EXCLUSIVE MODE</term>
|
||||||
ACCESS EXCLUSIVE MODE
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<note>
|
<note>
|
||||||
<para>
|
<para>
|
||||||
|
@ -179,7 +163,6 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">table</replaceable> IN SHARE ROW E
|
||||||
</note>
|
</note>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
|
@ -195,9 +178,20 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">table</replaceable> IN SHARE ROW E
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><computeroutput>
|
||||||
ERROR <replaceable class="PARAMETER">table</replaceable>: Table does not exist.
|
LOCK TABLE
|
||||||
</term>
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The lock was successfully applied.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
ERROR <replaceable class="PARAMETER">table</replaceable>: Table does not exist.
|
||||||
|
</computeroutput></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Message returned if <replaceable class="PARAMETER">table</replaceable>
|
Message returned if <replaceable class="PARAMETER">table</replaceable>
|
||||||
|
@ -328,45 +322,42 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">table</replaceable> IN SHARE ROW E
|
||||||
</title>
|
</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
|
Illustrate a SHARE lock on a primary key table when going to perform
|
||||||
|
inserts into a foreign key table:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
--
|
BEGIN WORK;
|
||||||
-- SHARE lock primary key table when going to perform
|
LOCK TABLE films IN SHARE MODE;
|
||||||
-- insert into foreign key table.
|
SELECT id FROM films
|
||||||
--
|
WHERE name = 'Star Wars: Episode I - The Phantom Menace';
|
||||||
BEGIN WORK;
|
-- Do ROLLBACK if record was not returned
|
||||||
LOCK TABLE films IN SHARE MODE;
|
INSERT INTO films_user_comments VALUES
|
||||||
SELECT id FROM films
|
(_id_, 'GREAT! I was waiting for it for so long!');
|
||||||
WHERE name = 'Star Wars: Episode I - The Phantom Menace';
|
COMMIT WORK;
|
||||||
--
|
</programlisting>
|
||||||
-- Do ROLLBACK if record was not returned
|
|
||||||
--
|
|
||||||
INSERT INTO films_user_comments VALUES
|
|
||||||
(_id_, 'GREAT! I was waiting for it for so long!');
|
|
||||||
COMMIT WORK;
|
|
||||||
</programlisting>
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
<programlisting>
|
Take a SHARE ROW EXCLUSIVE lock on a primary key table when going to perform
|
||||||
--
|
a delete operation:
|
||||||
-- SHARE ROW EXCLUSIVE lock primary key table when going to perform
|
|
||||||
-- delete operation.
|
<programlisting>
|
||||||
--
|
BEGIN WORK;
|
||||||
BEGIN WORK;
|
LOCK TABLE films IN SHARE ROW EXCLUSIVE MODE;
|
||||||
LOCK TABLE films IN SHARE ROW EXCLUSIVE MODE;
|
DELETE FROM films_user_comments WHERE id IN
|
||||||
DELETE FROM films_user_comments WHERE id IN
|
(SELECT id FROM films WHERE rating < 5);
|
||||||
(SELECT id FROM films WHERE rating < 5);
|
DELETE FROM films WHERE rating < 5;
|
||||||
DELETE FROM films WHERE rating < 5;
|
COMMIT WORK;
|
||||||
COMMIT WORK;
|
</programlisting>
|
||||||
</programlisting>
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
<refsect1 id="R1-SQL-LOCK-3">
|
<refsect1 id="R1-SQL-LOCK-3">
|
||||||
<title>
|
<title>
|
||||||
Compatibility
|
Compatibility
|
||||||
</title>
|
</title>
|
||||||
|
<para>
|
||||||
|
</para>
|
||||||
|
|
||||||
<refsect2 id="R2-SQL-LOCK-4">
|
<refsect2 id="R2-SQL-LOCK-4">
|
||||||
<refsect2info>
|
<refsect2info>
|
||||||
|
@ -397,7 +388,7 @@ sgml-indent-data:t
|
||||||
sgml-parent-document:nil
|
sgml-parent-document:nil
|
||||||
sgml-default-dtd-file:"../reference.ced"
|
sgml-default-dtd-file:"../reference.ced"
|
||||||
sgml-exposed-tags:nil
|
sgml-exposed-tags:nil
|
||||||
sgml-local-catalogs:"/usr/lib/sgml/CATALOG"
|
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
||||||
sgml-local-ecat-files:nil
|
sgml-local-ecat-files:nil
|
||||||
End:
|
End:
|
||||||
-->
|
-->
|
||||||
|
|
|
@ -1,124 +1,138 @@
|
||||||
<REFENTRY ID="SQL-MOVE">
|
<refentry id="SQL-MOVE">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
|
MOVE
|
||||||
|
</refentrytitle>
|
||||||
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
|
</refmeta>
|
||||||
|
<refnamediv>
|
||||||
|
<refname>
|
||||||
|
MOVE
|
||||||
|
</refname>
|
||||||
|
<refpurpose>
|
||||||
|
Moves cursor position
|
||||||
|
</refpurpose>
|
||||||
|
</refnamediv>
|
||||||
|
<refsynopsisdiv>
|
||||||
|
<refsynopsisdivinfo>
|
||||||
|
<date>1998-09-24</date>
|
||||||
|
</refsynopsisdivinfo>
|
||||||
|
<synopsis>
|
||||||
|
MOVE [ <replaceable class="PARAMETER">selector</replaceable> ] [ <replaceable class="PARAMETER">count</replaceable> ]
|
||||||
|
{ IN | FROM } <replaceable class="PARAMETER">cursor</replaceable>
|
||||||
|
FETCH [ RELATIVE ] [ { [ <replaceable class="PARAMETER">#</replaceable> | ALL | NEXT | PRIOR ] } ] FROM ] <replaceable class="PARAMETER">cursor</replaceable>
|
||||||
|
</synopsis>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-MOVE-1">
|
||||||
|
<refsect1info>
|
||||||
|
<date>1998-09-24</date>
|
||||||
|
</refsect1info>
|
||||||
|
<title>
|
||||||
|
Description
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
<command>MOVE</command> allows a user to move cursor position a specified
|
||||||
|
number of rows.
|
||||||
|
<command>MOVE</command> works like the <command>FETCH</command> command,
|
||||||
|
but only positions the cursor and does
|
||||||
|
not return rows.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Refer to the <command>FETCH</command> command for details on syntax and usage.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<refsect2 id="R2-SQL-MOVE-3">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-09-24</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
Notes
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
<command>MOVE</command> is a <productname>Postgres</productname>
|
||||||
|
language extension.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Refer to <command>FETCH</command> for a description
|
||||||
|
of valid arguments.
|
||||||
|
Refer to <command>DECLARE</command> to declare a cursor.
|
||||||
|
Refer to <command>BEGIN WORK</command>, <command>COMMIT WORK</command>,
|
||||||
|
<command>ROLLBACK WORK</command> statements
|
||||||
|
for further information about transactions.
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1 id="R1-SQL-MOVE-2">
|
||||||
|
<title>
|
||||||
|
Usage
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
Set up and use a cursor:
|
||||||
|
|
||||||
|
<programlisting>
|
||||||
|
BEGIN WORK;
|
||||||
|
DECLARE liahona CURSOR FOR SELECT * FROM films;
|
||||||
|
--Skip first 5 rows:
|
||||||
|
MOVE FORWARD 5 IN liahona;
|
||||||
|
<computeroutput>
|
||||||
MOVE
|
MOVE
|
||||||
</REFENTRYTITLE>
|
</computeroutput>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
--Fetch 6th row in the cursor liahona:
|
||||||
</REFMETA>
|
FETCH 1 IN liahona;
|
||||||
<REFNAMEDIV>
|
<computeroutput>
|
||||||
<REFNAME>
|
FETCH
|
||||||
MOVE
|
|
||||||
</REFNAME>
|
|
||||||
<REFPURPOSE>
|
|
||||||
Moves cursor position
|
|
||||||
</REFPURPOSE>
|
|
||||||
</refnamediv>
|
|
||||||
<REFSYNOPSISDIV>
|
|
||||||
<REFSYNOPSISDIVINFO>
|
|
||||||
<DATE>1998-09-24</DATE>
|
|
||||||
</REFSYNOPSISDIVINFO>
|
|
||||||
<SYNOPSIS>
|
|
||||||
MOVE [ <REPLACEABLE CLASS="PARAMETER">selector</REPLACEABLE> ] [ <REPLACEABLE CLASS="PARAMETER">count</REPLACEABLE> ]
|
|
||||||
{ IN | FROM } <REPLACEABLE CLASS="PARAMETER">cursor</REPLACEABLE>
|
|
||||||
FETCH [ RELATIVE ] [ { [ <REPLACEABLE CLASS="PARAMETER">#</REPLACEABLE> | ALL | NEXT | PRIOR ] } ] FROM ] <REPLACEABLE CLASS="PARAMETER">cursor</REPLACEABLE>
|
|
||||||
</SYNOPSIS>
|
|
||||||
</refsynopsisdiv>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-MOVE-1">
|
code |title |did| date_prod|kind |len
|
||||||
<REFSECT1INFO>
|
-----+------+---+----------+----------+------
|
||||||
<DATE>1998-09-24</DATE>
|
P_303|48 Hrs|103|1982-10-22|Action | 01:37
|
||||||
</REFSECT1INFO>
|
(1 row)
|
||||||
<TITLE>
|
</computeroutput>
|
||||||
Description
|
-- close the cursor liahona and commit work:
|
||||||
</TITLE>
|
CLOSE liahona;
|
||||||
<PARA>
|
COMMIT WORK;
|
||||||
<command>MOVE</command> allows a user to move cursor position a specified
|
</programlisting>
|
||||||
number of rows.
|
</para>
|
||||||
<command>MOVE</command> works like the <command>FETCH</command> command,
|
</refsect1>
|
||||||
but only positions the cursor and does
|
|
||||||
not return rows.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
Refer to the <command>FETCH</command> command for details on syntax and usage.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-MOVE-3">
|
<refsect1 id="R1-SQL-MOVE-3">
|
||||||
<REFSECT2INFO>
|
<title>
|
||||||
<DATE>1998-09-24</DATE>
|
Compatibility
|
||||||
</REFSECT2INFO>
|
</title>
|
||||||
<TITLE>
|
<para>
|
||||||
Notes
|
</para>
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
<command>MOVE</command> is a <productname>Postgres</productname>
|
|
||||||
language extension.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
Refer to <command>FETCH</command> for a description
|
|
||||||
of valid arguments.
|
|
||||||
Refer to <command>DECLARE</command> to declare a cursor.
|
|
||||||
Refer to <command>BEGIN WORK</command>, <command>COMMIT WORK</command>,
|
|
||||||
<command>ROLLBACK WORK</command> statements
|
|
||||||
for further information about transactions.
|
|
||||||
</para>
|
|
||||||
</REFSECT2>
|
|
||||||
</refsect1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-MOVE-2">
|
|
||||||
<TITLE>
|
|
||||||
Usage
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
<ProgramListing>
|
|
||||||
--set up and use a cursor:
|
|
||||||
--
|
|
||||||
BEGIN WORK;
|
|
||||||
DECLARE liahona CURSOR FOR SELECT * FROM films;
|
|
||||||
|
|
||||||
--Skip first 5 rows:
|
|
||||||
--
|
|
||||||
MOVE FORWARD 5 IN liahona;
|
|
||||||
<computeroutput>
|
|
||||||
MOVE
|
|
||||||
</computeroutput>
|
|
||||||
--Fetch 6th row in the cursor liahona:
|
|
||||||
--
|
|
||||||
FETCH 1 IN liahona;
|
|
||||||
<computeroutput>
|
|
||||||
FETCH
|
|
||||||
code |title |did| date_prod|kind |len
|
|
||||||
-----+------+---+----------+----------+------
|
|
||||||
P_303|48 Hrs|103|1982-10-22|Action | 01:37
|
|
||||||
(1 row)
|
|
||||||
</computeroutput>
|
|
||||||
-- close the cursor liahona and commit work:
|
|
||||||
--
|
|
||||||
CLOSE liahona;
|
|
||||||
COMMIT WORK;
|
|
||||||
</ProgramListing>
|
|
||||||
</para>
|
|
||||||
</REFSECT1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-MOVE-3">
|
|
||||||
<TITLE>
|
|
||||||
Compatibility
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
</PARA>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-MOVE-4">
|
<refsect2 id="R2-SQL-MOVE-4">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-09-01</DATE>
|
<date>1998-09-01</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
SQL92
|
SQL92
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
There is no SQL92 <command>MOVE</command> statement.
|
There is no SQL92 <command>MOVE</command> statement.
|
||||||
Instead, <acronym>SQL92</acronym> allows
|
Instead, <acronym>SQL92</acronym> allows
|
||||||
one to <command>FETCH</command> rows from an absolute cursor position,
|
one to <command>FETCH</command> rows from an absolute cursor position,
|
||||||
implicitly moving the cursor to the correct place.
|
implicitly moving the cursor to the correct place.
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</REFENTRY>
|
</refentry>
|
||||||
|
|
||||||
|
<!-- Keep this comment at the end of the file
|
||||||
|
Local variables:
|
||||||
|
mode: sgml
|
||||||
|
sgml-omittag:nil
|
||||||
|
sgml-shorttag:t
|
||||||
|
sgml-minimize-attributes:nil
|
||||||
|
sgml-always-quote-attributes:t
|
||||||
|
sgml-indent-step:1
|
||||||
|
sgml-indent-data:t
|
||||||
|
sgml-parent-document:nil
|
||||||
|
sgml-default-dtd-file:"../reference.ced"
|
||||||
|
sgml-exposed-tags:nil
|
||||||
|
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
||||||
|
sgml-local-ecat-files:nil
|
||||||
|
End:
|
||||||
|
-->
|
||||||
|
|
|
@ -1,237 +1,251 @@
|
||||||
<REFENTRY ID="SQL-NOTIFY">
|
<refentry id="SQL-NOTIFY">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE id="sql-notify-ref">
|
<refentrytitle id="sql-notify-ref">
|
||||||
|
NOTIFY
|
||||||
|
</refentrytitle>
|
||||||
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
|
</refmeta>
|
||||||
|
<refnamediv>
|
||||||
|
<refname>
|
||||||
|
NOTIFY
|
||||||
|
</refname>
|
||||||
|
<refpurpose>
|
||||||
|
Signals all frontends and backends listening on a notify condition
|
||||||
|
</refpurpose>
|
||||||
|
</refnamediv>
|
||||||
|
<refsynopsisdiv>
|
||||||
|
<refsynopsisdivinfo>
|
||||||
|
<date>1998-10-07</date>
|
||||||
|
</refsynopsisdivinfo>
|
||||||
|
<synopsis>
|
||||||
|
NOTIFY <replaceable class="PARAMETER">name</replaceable>
|
||||||
|
</synopsis>
|
||||||
|
|
||||||
|
<refsect2 id="R2-SQL-NOTIFY-1">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-10-07</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
Inputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="PARAMETER">notifyname</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Notify condition to be signaled.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
|
||||||
|
<refsect2 id="R2-SQL-NOTIFY-2">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-10-07</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
Outputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
NOTIFY
|
NOTIFY
|
||||||
</REFENTRYTITLE>
|
</computeroutput></term>
|
||||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
<listitem>
|
||||||
</REFMETA>
|
<para>
|
||||||
<REFNAMEDIV>
|
Acknowledgement that notify command has executed.
|
||||||
<REFNAME>
|
</para>
|
||||||
NOTIFY
|
</listitem>
|
||||||
</REFNAME>
|
</varlistentry>
|
||||||
<REFPURPOSE>
|
<varlistentry>
|
||||||
Signals all frontends and backends listening on a notify condition
|
<term><replaceable>Notify events</replaceable></term>
|
||||||
</REFPURPOSE>
|
<listitem>
|
||||||
</refnamediv>
|
<para>
|
||||||
<REFSYNOPSISDIV>
|
Events are delivered to listening frontends; whether and how each frontend
|
||||||
<REFSYNOPSISDIVINFO>
|
application reacts depends on its programming.
|
||||||
<DATE>1998-10-07</DATE>
|
</para>
|
||||||
</REFSYNOPSISDIVINFO>
|
</listitem>
|
||||||
<SYNOPSIS>
|
</varlistentry>
|
||||||
<REPLACEABLE CLASS="PARAMETER">
|
</variablelist>
|
||||||
</REPLACEABLE>
|
</para>
|
||||||
NOTIFY <REPLACEABLE CLASS="PARAMETER">notifyname</REPLACEABLE>
|
</refsect2>
|
||||||
</SYNOPSIS>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-NOTIFY-1">
|
<refsect1 id="R1-SQL-NOTIFY-1">
|
||||||
<REFSECT2INFO>
|
<refsect1info>
|
||||||
<DATE>1998-10-07</DATE>
|
<date>1998-10-07</date>
|
||||||
</REFSECT2INFO>
|
</refsect1info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
|
The <command>NOTIFY</command> command sends a notify event to each
|
||||||
|
frontend application that has previously executed
|
||||||
|
<command>LISTEN <replaceable class="parameter">notifyname</replaceable></command>
|
||||||
|
for the specified notify condition in the current database.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
The information passed to the frontend for a notify event includes the notify
|
||||||
|
condition name and the notifying backend process's PID. It is up to the
|
||||||
|
database designer to define the condition names that will be used in a given
|
||||||
|
database and what each one means.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Commonly, the notify condition name is the same as the name of some table in
|
||||||
|
the database, and the notify event essentially means "I changed this table,
|
||||||
|
take a look at it to see what's new". But no such association is enforced by
|
||||||
|
the <command>NOTIFY</command> and <command>LISTEN</command> commands. For
|
||||||
|
example, a database designer could use several different condition names
|
||||||
|
to signal different sorts of changes to a single table.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
<command>NOTIFY</command> provides a simple form of signal or
|
||||||
|
IPC (interprocess communication) mechanism for a collection of processes
|
||||||
|
accessing the same <productname>Postgres</productname> database.
|
||||||
|
Higher-level mechanisms can be built by using tables in the database to
|
||||||
|
pass additional data (beyond a mere condition name) from notifier to
|
||||||
|
listener(s).
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
When <command>NOTIFY</command> is used to signal the occurrence of changes
|
||||||
|
to a particular table, a useful programming technique is to put the
|
||||||
|
<command>NOTIFY</command> in a rule that is triggered by table updates.
|
||||||
|
In this way, notification happens automatically when the table is changed,
|
||||||
|
and the application programmer can't accidentally forget to do it.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
<command>NOTIFY</command> interacts with SQL transactions in some important
|
||||||
|
ways. Firstly, if a <command>NOTIFY</command> is executed inside a
|
||||||
|
transaction, the notify events are not delivered until and unless the
|
||||||
|
transaction is committed. This is appropriate, since if the transaction
|
||||||
|
is aborted we would like all the commands within it to have had no
|
||||||
|
effect, including <command>NOTIFY</command>. But it can be disconcerting if one
|
||||||
|
is expecting the notify events to be delivered immediately. Secondly, if
|
||||||
|
a listening backend receives a notify signal while it is within a transaction,
|
||||||
|
the notify event will not be delivered to its connected frontend until just
|
||||||
|
after the transaction is completed (either committed or aborted). Again, the
|
||||||
|
reasoning is that if a notify were delivered within a transaction that was
|
||||||
|
later aborted, one would want the notification to be undone somehow --- but
|
||||||
|
the backend cannot "take back" a notify once it has sent it to the frontend.
|
||||||
|
So notify events are only delivered between transactions. The upshot of this
|
||||||
|
is that applications using <command>NOTIFY</command> for real-time signaling
|
||||||
|
should try to keep their transactions short.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
<command>NOTIFY</command> behaves like Unix signals in one important
|
||||||
|
respect: if the same condition name is signaled multiple times in quick
|
||||||
|
succession, recipients may get only one notify event for several executions
|
||||||
|
of <command>NOTIFY</command>. So it is a bad idea to depend on the number
|
||||||
|
of notifies received. Instead, use <command>NOTIFY</command> to wake up
|
||||||
|
applications that need to pay attention to something, and use a database
|
||||||
|
object (such as a sequence) to keep track of what happened or how many times
|
||||||
|
it happened.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
It is common for a frontend that sends <command>NOTIFY</command> to be
|
||||||
|
listening on the same notify name itself. In that case it will get back a
|
||||||
|
notify event, just like all the other listening frontends. Depending on the
|
||||||
|
application logic, this could result in useless work --- for example,
|
||||||
|
re-reading a database table to find the same updates that that frontend just
|
||||||
|
wrote out. In <productname>Postgres</productname> 6.4 and later, it is
|
||||||
|
possible to avoid such extra work by noticing whether the notifying backend
|
||||||
|
process's PID (supplied in the notify event message) is the same as one's own
|
||||||
|
backend's PID (available from libpq). When they are the same, the notify
|
||||||
|
event is one's own work bouncing back, and can be ignored. (Despite what was
|
||||||
|
said in the preceding paragraph, this is a safe technique.
|
||||||
|
<productname>Postgres</productname> keeps self-notifies separate from notifies
|
||||||
|
arriving from other backends, so you cannot miss an outside notify by ignoring
|
||||||
|
your own notifies.)
|
||||||
|
</para>
|
||||||
|
|
||||||
<VARIABLELIST>
|
<refsect2 id="R2-SQL-NOTIFY-3">
|
||||||
<VARLISTENTRY>
|
<refsect2info>
|
||||||
<TERM>
|
<date>1998-10-07</date>
|
||||||
<REPLACEABLE CLASS="PARAMETER">notifyname</REPLACEABLE>
|
</refsect2info>
|
||||||
</TERM>
|
<title>
|
||||||
<LISTITEM>
|
Notes
|
||||||
<PARA>
|
</title>
|
||||||
Notify condition to be signaled.
|
<para>
|
||||||
</para>
|
<replaceable class="PARAMETER">name</replaceable>
|
||||||
</listitem>
|
can be any string valid as a name;
|
||||||
</varlistentry>
|
it need not correspond to the name of any actual table. If
|
||||||
</VARIABLELIST>
|
<replaceable class="PARAMETER">name</replaceable>
|
||||||
</para>
|
is enclosed in double-quotes, it need not even be a syntactically
|
||||||
</REFSECT2>
|
valid name, but can be any string up to 31 characters long.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
In some previous releases of
|
||||||
|
<productname>Postgres</productname>,
|
||||||
|
<replaceable class="PARAMETER">name</replaceable>
|
||||||
|
had to be enclosed in double-quotes when it did not correspond to any existing
|
||||||
|
table name, even if syntactically valid as a name. That is no longer required.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
In <productname>Postgres</productname> releases prior to 6.4, the backend
|
||||||
|
PID delivered in a notify message was always the PID of the frontend's own
|
||||||
|
backend. So it was not possible to distinguish one's own notifies from other
|
||||||
|
clients' notifies in those earlier releases.
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-NOTIFY-2">
|
<refsect1 id="R1-SQL-NOTIFY-2">
|
||||||
<REFSECT2INFO>
|
<title>
|
||||||
<DATE>1998-10-07</DATE>
|
Usage
|
||||||
</REFSECT2INFO>
|
</title>
|
||||||
<TITLE>
|
<para>
|
||||||
Outputs
|
Configure and execute a listen/notify sequence from
|
||||||
</TITLE>
|
<application>psql</application>:
|
||||||
<PARA>
|
|
||||||
|
|
||||||
<VARIABLELIST>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
NOTIFY
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Acknowledgement that notify command has executed.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<VARLISTENTRY>
|
|
||||||
<TERM>
|
|
||||||
Notify events
|
|
||||||
</TERM>
|
|
||||||
<LISTITEM>
|
|
||||||
<PARA>
|
|
||||||
Events are delivered to listening frontends; whether and how each frontend
|
|
||||||
application reacts depends on its programming.
|
|
||||||
</PARA>
|
|
||||||
</LISTITEM>
|
|
||||||
</VARLISTENTRY>
|
|
||||||
</VARIABLELIST>
|
|
||||||
</para>
|
|
||||||
</REFSECT2>
|
|
||||||
</REFSYNOPSISDIV>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-NOTIFY-1">
|
|
||||||
<REFSECT1INFO>
|
|
||||||
<DATE>1998-10-07</DATE>
|
|
||||||
</REFSECT1INFO>
|
|
||||||
<TITLE>
|
|
||||||
Description
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
The <command>NOTIFY</command> command sends a notify event to each
|
|
||||||
frontend application that has previously executed
|
|
||||||
<command>LISTEN <replaceable class="parameter">notifyname</replaceable></command>
|
|
||||||
for the specified notify condition in the current database.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
The information passed to the frontend for a notify event includes the notify
|
|
||||||
condition name and the notifying backend process's PID. It is up to the
|
|
||||||
database designer to define the condition names that will be used in a given
|
|
||||||
database and what each one means.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
Commonly, the notify condition name is the same as the name of some table in
|
|
||||||
the database, and the notify event essentially means "I changed this table,
|
|
||||||
take a look at it to see what's new". But no such association is enforced by
|
|
||||||
the <command>NOTIFY</command> and <command>LISTEN</command> commands. For
|
|
||||||
example, a database designer could use several different condition names
|
|
||||||
to signal different sorts of changes to a single table.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
<command>NOTIFY</command> provides a simple form of signal or
|
|
||||||
IPC (interprocess communication) mechanism for a collection of processes
|
|
||||||
accessing the same <productname>Postgres</productname> database.
|
|
||||||
Higher-level mechanisms can be built by using tables in the database to
|
|
||||||
pass additional data (beyond a mere condition name) from notifier to
|
|
||||||
listener(s).
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
When <command>NOTIFY</command> is used to signal the occurrence of changes
|
|
||||||
to a particular table, a useful programming technique is to put the
|
|
||||||
<command>NOTIFY</command> in a rule that is triggered by table updates.
|
|
||||||
In this way, notification happens automatically when the table is changed,
|
|
||||||
and the application programmer can't accidentally forget to do it.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
<command>NOTIFY</command> interacts with SQL transactions in some important
|
|
||||||
ways. Firstly, if a <command>NOTIFY</command> is executed inside a
|
|
||||||
transaction, the notify events are not delivered until and unless the
|
|
||||||
transaction is committed. This is appropriate, since if the transaction
|
|
||||||
is aborted we would like all the commands within it to have had no effect
|
|
||||||
--- including <command>NOTIFY</command>. But it can be disconcerting if one
|
|
||||||
is expecting the notify events to be delivered immediately. Secondly, if
|
|
||||||
a listening backend receives a notify signal while it is within a transaction,
|
|
||||||
the notify event will not be delivered to its connected frontend until just
|
|
||||||
after the transaction is completed (either committed or aborted). Again, the
|
|
||||||
reasoning is that if a notify were delivered within a transaction that was
|
|
||||||
later aborted, one would want the notification to be undone somehow --- but
|
|
||||||
the backend cannot "take back" a notify once it has sent it to the frontend.
|
|
||||||
So notify events are only delivered between transactions. The upshot of this
|
|
||||||
is that applications using <command>NOTIFY</command> for real-time signaling
|
|
||||||
should try to keep their transactions short.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
<command>NOTIFY</command> behaves like Unix signals in one important
|
|
||||||
respect: if the same condition name is signaled multiple times in quick
|
|
||||||
succession, recipients may get only one notify event for several executions
|
|
||||||
of <command>NOTIFY</command>. So it is a bad idea to depend on the number
|
|
||||||
of notifies received. Instead, use <command>NOTIFY</command> to wake up
|
|
||||||
applications that need to pay attention to something, and use a database
|
|
||||||
object (such as a sequence) to keep track of what happened or how many times
|
|
||||||
it happened.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
It is common for a frontend that sends <command>NOTIFY</command> to be
|
|
||||||
listening on the same notify name itself. In that case it will get back a
|
|
||||||
notify event, just like all the other listening frontends. Depending on the
|
|
||||||
application logic, this could result in useless work --- for example,
|
|
||||||
re-reading a database table to find the same updates that that frontend just
|
|
||||||
wrote out. In <productname>Postgres</productname> 6.4 and later, it is
|
|
||||||
possible to avoid such extra work by noticing whether the notifying backend
|
|
||||||
process's PID (supplied in the notify event message) is the same as one's own
|
|
||||||
backend's PID (available from libpq). When they are the same, the notify
|
|
||||||
event is one's own work bouncing back, and can be ignored. (Despite what was
|
|
||||||
said in the preceding paragraph, this is a safe technique.
|
|
||||||
<productname>Postgres</productname> keeps self-notifies separate from notifies
|
|
||||||
arriving from other backends, so you cannot miss an outside notify by ignoring
|
|
||||||
your own notifies.)
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-SQL-NOTIFY-3">
|
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-10-07</DATE>
|
|
||||||
</REFSECT2INFO>
|
|
||||||
<TITLE>
|
|
||||||
Notes
|
|
||||||
</TITLE>
|
|
||||||
<para>
|
|
||||||
<REPLACEABLE CLASS="PARAMETER">notifyname</REPLACEABLE>
|
|
||||||
can be any string valid as a name;
|
|
||||||
it need not correspond to the name of any actual table. If
|
|
||||||
<REPLACEABLE CLASS="PARAMETER">notifyname</REPLACEABLE>
|
|
||||||
is enclosed in double-quotes, it need not even be a syntactically
|
|
||||||
valid name, but can be any string up to 31 characters long.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
In some previous releases of
|
|
||||||
<productname>Postgres</productname>,
|
|
||||||
<REPLACEABLE CLASS="PARAMETER">notifyname</REPLACEABLE>
|
|
||||||
had to be enclosed in double-quotes when it did not correspond to any existing
|
|
||||||
table name, even if syntactically valid as a name. That is no longer required.
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
In <productname>Postgres</productname> releases prior to 6.4, the backend
|
|
||||||
PID delivered in a notify message was always the PID of the frontend's own
|
|
||||||
backend. So it was not possible to distinguish one's own notifies from other
|
|
||||||
clients' notifies in those earlier releases.
|
|
||||||
</para>
|
|
||||||
</REFSECT2>
|
|
||||||
</refsect1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-NOTIFY-2">
|
<programlisting>
|
||||||
<TITLE>
|
LISTEN virtual;
|
||||||
Usage
|
NOTIFY virtual;
|
||||||
</TITLE>
|
ASYNC NOTIFY of 'virtual' from backend pid '11239' received
|
||||||
<PARA>
|
</programlisting>
|
||||||
<ProgramListing>
|
</para>
|
||||||
-- Configure and execute a listen/notify sequence from psql
|
</refsect1>
|
||||||
postgres=> listen virtual;
|
|
||||||
LISTEN
|
|
||||||
postgres=> notify virtual;
|
|
||||||
NOTIFY
|
|
||||||
ASYNC NOTIFY of 'virtual' from backend pid '11239' received
|
|
||||||
</ProgramListing>
|
|
||||||
</para>
|
|
||||||
</REFSECT1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-SQL-NOTIFY-3">
|
<refsect1 id="R1-SQL-NOTIFY-3">
|
||||||
<TITLE>
|
<title>
|
||||||
Compatibility
|
Compatibility
|
||||||
</TITLE>
|
</title>
|
||||||
|
<para>
|
||||||
<REFSECT2 ID="R2-SQL-NOTIFY-4">
|
</para>
|
||||||
<REFSECT2INFO>
|
|
||||||
<DATE>1998-09-24</DATE>
|
<refsect2 id="R2-SQL-NOTIFY-4">
|
||||||
</REFSECT2INFO>
|
<refsect2info>
|
||||||
<TITLE>
|
<date>1998-09-24</date>
|
||||||
SQL92
|
</refsect2info>
|
||||||
</TITLE>
|
<title>
|
||||||
<PARA>
|
SQL92
|
||||||
There is no <command>NOTIFY</command> statement in <acronym>SQL92</acronym>.
|
</title>
|
||||||
</para>
|
<para>
|
||||||
</refsect2>
|
There is no <command>NOTIFY</command> statement in
|
||||||
</refsect1>
|
<acronym>SQL92</acronym>.
|
||||||
</REFENTRY>
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
|
||||||
|
<!-- Keep this comment at the end of the file
|
||||||
|
Local variables:
|
||||||
|
mode: sgml
|
||||||
|
sgml-omittag:nil
|
||||||
|
sgml-shorttag:t
|
||||||
|
sgml-minimize-attributes:nil
|
||||||
|
sgml-always-quote-attributes:t
|
||||||
|
sgml-indent-step:1
|
||||||
|
sgml-indent-data:t
|
||||||
|
sgml-parent-document:nil
|
||||||
|
sgml-default-dtd-file:"../reference.ced"
|
||||||
|
sgml-exposed-tags:nil
|
||||||
|
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
||||||
|
sgml-local-ecat-files:nil
|
||||||
|
End:
|
||||||
|
-->
|
||||||
|
|
|
@ -1,423 +1,396 @@
|
||||||
<REFENTRY ID="APP-PG-DUMP">
|
<refentry id="APP-PG-DUMP">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE id="pg-dump">
|
<refentrytitle id="pg-dump">
|
||||||
<application>pg_dump</application>
|
<application>pg_dump</application>
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>Application</REFMISCINFO>
|
<refmiscinfo>Application</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
<application>pg_dump</application>
|
<application>pg_dump</application>
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Extract a <productname>Postgres</productname> database into a script file
|
Extract a <productname>Postgres</productname> database into a script file
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-11-05</DATE>
|
<date>1998-11-05</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
pg_dump [ <replaceable class="parameter">dbname</replaceable> ]
|
pg_dump [ <replaceable class="parameter">dbname</replaceable> ]
|
||||||
pg_dump [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
|
pg_dump [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
|
||||||
[ -t <replaceable class="parameter">table</replaceable> ]
|
[ -t <replaceable class="parameter">table</replaceable> ] [ -f <replaceable class="parameter">outputfile</replaceable> ]
|
||||||
[ -f <replaceable class="parameter">outputfile</replaceable> ]
|
|
||||||
[ -a ] [ -c ] [ -d ] [ -D ] [ -n ] [ -N ]
|
[ -a ] [ -c ] [ -d ] [ -D ] [ -n ] [ -N ]
|
||||||
[ -o ] [ -s ] [ -u ] [ -v ] [ -x ]
|
[ -o ] [ -s ] [ -u ] [ -v ] [ -x ]
|
||||||
[ <replaceable class="parameter">dbname</replaceable> ]
|
[ <replaceable class="parameter">dbname</replaceable> ]
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-APP-PG-DUMP-1">
|
<refsect2 id="R2-APP-PG-DUMP-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-11-05</DATE>
|
<date>1998-11-05</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<application>pg_dump</application> accepts the following command line arguments:
|
<application>pg_dump</application> accepts the following command
|
||||||
|
line arguments:
|
||||||
<variablelist>
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
<replaceable class="parameter">dbname</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Specifies the name of the database to be extracted.
|
|
||||||
<replaceable class="parameter">dbname</replaceable>
|
|
||||||
defaults to the value of the
|
|
||||||
<envar>USER</envar>
|
|
||||||
environment variable.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-a
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Dump out only the data, no schema (definitions).
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-c
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Clean(drop) schema prior to create.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-d
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Dump data as proper insert strings.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-D
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Dump data as inserts with attribute names
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-f <replaceable class="parameter">filename</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Specifies the output file. Defaults to <filename>stdout</filename>.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-n
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Suppress double quotes around identifiers unless absolutely necessary.
|
|
||||||
This may cause trouble loading this dumped data if there are reserved words
|
|
||||||
used for identifiers.
|
|
||||||
This was the default behavior in pre-v6.4 <application>pg_dump</application>.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-N
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Include double quotes around identifiers.
|
|
||||||
This is the default.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-o
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Dump object identifiers (<acronym>OID</acronym>s) for every table.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-s
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Dump out only the schema (definitions), no data.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-t <replaceable class="parameter">table</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Dump data for <replaceable class="parameter">table</replaceable> only.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-u
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Use password authentication. Prompts for username and password.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-v
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Specifies verbose mode
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-x
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Prevent dumping of ACLs (grant/revoke commands) and table ownership information.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
</variablelist>
|
<variablelist>
|
||||||
</para>
|
<varlistentry>
|
||||||
<para>
|
<term><replaceable class="parameter">dbname</replaceable></term>
|
||||||
<application>pg_dump</application> also accepts
|
<listitem>
|
||||||
the following command line arguments for connection parameters:
|
<para>
|
||||||
|
Specifies the name of the database to be extracted.
|
||||||
<variablelist>
|
<replaceable class="parameter">dbname</replaceable>
|
||||||
<varlistentry>
|
defaults to the value of the
|
||||||
<term>
|
<envar>USER</envar>
|
||||||
-h <replaceable class="parameter">host</replaceable>
|
environment variable.
|
||||||
</term>
|
</para>
|
||||||
<listitem>
|
</listitem>
|
||||||
<para>
|
</varlistentry>
|
||||||
Specifies the hostname of the machine on which the
|
|
||||||
<application>postmaster</application>
|
|
||||||
is running. Defaults to using a local Unix domain socket
|
|
||||||
rather than an IP connection..
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-p <replaceable class="parameter">port</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Specifies the Internet TCP/IP port or local Unix domain socket file
|
|
||||||
extension on which the <application>postmaster</application>
|
|
||||||
is listening for connections. The port number defaults to 5432,
|
|
||||||
or the value of the <envar>PGPORT</envar>
|
|
||||||
environment variable (if set).
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-a</term>
|
||||||
-u
|
<listitem>
|
||||||
</term>
|
<para>
|
||||||
<listitem>
|
Dump out only the data, no schema (definitions).
|
||||||
<para>
|
</para>
|
||||||
Use password authentication.
|
</listitem>
|
||||||
Prompts for
|
</varlistentry>
|
||||||
<replaceable class="parameter">username</replaceable>
|
|
||||||
and <replaceable class="parameter">password</replaceable>.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
</variablelist>
|
<varlistentry>
|
||||||
</para>
|
<term>-c</term>
|
||||||
</refsect2>
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Clean(drop) schema prior to create.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-APP-PG-DUMP-2">
|
<varlistentry>
|
||||||
<REFSECT2INFO>
|
<term>-d</term>
|
||||||
<DATE>1998-11-05</DATE>
|
<listitem>
|
||||||
</REFSECT2INFO>
|
<para>
|
||||||
<TITLE>
|
Dump data as proper insert strings.
|
||||||
Outputs
|
</para>
|
||||||
</TITLE>
|
</listitem>
|
||||||
<PARA>
|
</varlistentry>
|
||||||
<application>pg_dump</application> will create a file or
|
|
||||||
write to <filename>stdout</filename>.
|
|
||||||
|
|
||||||
<variablelist>
|
<varlistentry>
|
||||||
<varlistentry>
|
<term>-D</term>
|
||||||
<term>
|
<listitem>
|
||||||
Connection to database 'template1' failed.
|
<para>
|
||||||
connectDB() failed: Is the postmaster running and accepting connections
|
Dump data as inserts with attribute names
|
||||||
at 'UNIX Socket' on port '<replaceable class="parameter">port</replaceable>'?
|
</para>
|
||||||
</term>
|
</listitem>
|
||||||
<listitem>
|
</varlistentry>
|
||||||
<para>
|
|
||||||
<application>pg_dump</application> could not attach to the
|
<varlistentry>
|
||||||
<application>postmaster</application>
|
<term>-f <replaceable class="parameter">filename</replaceable></term>
|
||||||
process on the specified host and port. If you see this message,
|
<listitem>
|
||||||
ensure that the <application>postmaster</application>
|
<para>
|
||||||
is running on the proper host and that you have specified the proper
|
Specifies the output file. Defaults to <filename>stdout</filename>.
|
||||||
port. If your site uses an authentication system, ensure that you
|
</para>
|
||||||
have obtained the required authentication credentials.
|
</listitem>
|
||||||
</para>
|
</varlistentry>
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
<varlistentry>
|
||||||
|
<term>-n</term>
|
||||||
<varlistentry>
|
<listitem>
|
||||||
<term>
|
<para>
|
||||||
Connection to database '<replaceable class="parameter">dbname</replaceable>' failed.
|
Suppress double quotes around identifiers unless absolutely necessary.
|
||||||
FATAL 1: SetUserId: user '<replaceable class="parameter">username</replaceable>' is not in 'pg_shadow'
|
This may cause trouble loading this dumped data if there are reserved words
|
||||||
</term>
|
used for identifiers.
|
||||||
<listitem>
|
This was the default behavior in pre-v6.4 <application>pg_dump</application>.
|
||||||
<para>
|
</para>
|
||||||
You do not have a valid entry in the relation <literal>pg_shadow</literal>
|
</listitem>
|
||||||
and and will not be allowed to access <productname>Postgres</productname>.
|
</varlistentry>
|
||||||
Contact your <productname>Postgres</productname> administrator.
|
|
||||||
</para>
|
<varlistentry>
|
||||||
</listitem>
|
<term>-N</term>
|
||||||
</varlistentry>
|
<listitem>
|
||||||
|
<para>
|
||||||
<varlistentry>
|
Include double quotes around identifiers.
|
||||||
<term>
|
This is the default.
|
||||||
dumpSequence(<replaceable class="parameter">table</replaceable>): SELECT failed
|
</para>
|
||||||
</term>
|
</listitem>
|
||||||
<listitem>
|
</varlistentry>
|
||||||
<para>
|
|
||||||
You do not have permission to read the database.
|
<varlistentry>
|
||||||
Contact your <productname>Postgres</productname> site administrator.
|
<term>-o</term>
|
||||||
</para>
|
<listitem>
|
||||||
</listitem>
|
<para>
|
||||||
</varlistentry>
|
Dump object identifiers (<acronym>OID</acronym>s) for every table.
|
||||||
|
</para>
|
||||||
</variablelist>
|
</listitem>
|
||||||
</para>
|
</varlistentry>
|
||||||
<note>
|
|
||||||
<para>
|
<varlistentry>
|
||||||
<application>pg_dump</application> internally executes
|
<term>-s</term>
|
||||||
<command>SELECT</command> statements. If you have problems running
|
<listitem>
|
||||||
<application>pg_dump</application>,
|
<para>
|
||||||
make sure you are able to select information from the database using, for
|
Dump out only the schema (definitions), no data.
|
||||||
example, <application>psql</application>.
|
</para>
|
||||||
</para>
|
</listitem>
|
||||||
</note>
|
</varlistentry>
|
||||||
</refsect2>
|
|
||||||
</refsynopsisdiv>
|
<varlistentry>
|
||||||
|
<term>-t <replaceable class="parameter">table</replaceable></term>
|
||||||
<REFSECT1 ID="R1-APP-PG-DUMP-1">
|
<listitem>
|
||||||
<REFSECT1INFO>
|
<para>
|
||||||
<DATE>1998-11-05</DATE>
|
Dump data for <replaceable class="parameter">table</replaceable> only.
|
||||||
</REFSECT1INFO>
|
</para>
|
||||||
<TITLE>
|
</listitem>
|
||||||
Description
|
</varlistentry>
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
<varlistentry>
|
||||||
<application>pg_dump</application> is a utility for dumping out a
|
<term>-u</term>
|
||||||
<productname>Postgres</productname> database into a script file
|
<listitem>
|
||||||
containing query commands. The script
|
<para>
|
||||||
files are in text format and can be used to reconstruct the database,
|
Use password authentication. Prompts for username and password.
|
||||||
even on other machines and other architectures.
|
</para>
|
||||||
<application>pg_dump</application>
|
</listitem>
|
||||||
will produce the queries necessary to re-generate all
|
</varlistentry>
|
||||||
user-defined types, functions, tables, indices, aggregates, and
|
|
||||||
operators. In addition, all the data is copied out in text format so
|
<varlistentry>
|
||||||
that it can be readily copied in again, as well as imported into tools
|
<term>-v</term>
|
||||||
for editing.
|
<listitem>
|
||||||
</para>
|
<para>
|
||||||
|
Specifies verbose mode
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>-x</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Prevent dumping of ACLs (grant/revoke commands) and table ownership information.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
<application>pg_dump</application> also accepts
|
||||||
|
the following command line arguments for connection parameters:
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term>-h <replaceable class="parameter">host</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Specifies the hostname of the machine on which the
|
||||||
|
<application>postmaster</application>
|
||||||
|
is running. Defaults to using a local Unix domain socket
|
||||||
|
rather than an IP connection..
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>-p <replaceable class="parameter">port</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Specifies the Internet TCP/IP port or local Unix domain socket file
|
||||||
|
extension on which the <application>postmaster</application>
|
||||||
|
is listening for connections. The port number defaults to 5432,
|
||||||
|
or the value of the <envar>PGPORT</envar>
|
||||||
|
environment variable (if set).
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>-u</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Use password authentication.
|
||||||
|
Prompts for
|
||||||
|
<replaceable class="parameter">username</replaceable>
|
||||||
|
and <replaceable class="parameter">password</replaceable>.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
|
||||||
|
<refsect2 id="R2-APP-PG-DUMP-2">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-11-05</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
Outputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
<application>pg_dump</application> will create a file or
|
||||||
|
write to <filename>stdout</filename>.
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
Connection to database 'template1' failed.
|
||||||
|
connectDB() failed: Is the postmaster running and accepting connections
|
||||||
|
at 'UNIX Socket' on port '<replaceable class="parameter">port</replaceable>'?
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
<application>pg_dump</application> could not attach to the
|
||||||
|
<application>postmaster</application>
|
||||||
|
process on the specified host and port. If you see this message,
|
||||||
|
ensure that the <application>postmaster</application>
|
||||||
|
is running on the proper host and that you have specified the proper
|
||||||
|
port. If your site uses an authentication system, ensure that you
|
||||||
|
have obtained the required authentication credentials.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
Connection to database '<replaceable class="parameter">dbname</replaceable>' failed.
|
||||||
|
FATAL 1: SetUserId: user '<replaceable class="parameter">username</replaceable>' is not in 'pg_shadow'
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
You do not have a valid entry in the relation <literal>pg_shadow</literal>
|
||||||
|
and and will not be allowed to access <productname>Postgres</productname>.
|
||||||
|
Contact your <productname>Postgres</productname> administrator.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
dumpSequence(<replaceable class="parameter">table</replaceable>): SELECT failed
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
You do not have permission to read the database.
|
||||||
|
Contact your <productname>Postgres</productname> site administrator.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<note>
|
||||||
<para>
|
<para>
|
||||||
|
<application>pg_dump</application> internally executes
|
||||||
|
<command>SELECT</command> statements. If you have problems running
|
||||||
|
<application>pg_dump</application>,
|
||||||
|
make sure you are able to select information from the database using, for
|
||||||
|
example, <application>psql</application>.
|
||||||
|
</para>
|
||||||
|
</note>
|
||||||
|
</refsect2>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
|
<refsect1 id="R1-APP-PG-DUMP-1">
|
||||||
|
<refsect1info>
|
||||||
|
<date>1998-11-05</date>
|
||||||
|
</refsect1info>
|
||||||
|
<title>
|
||||||
|
Description
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
<application>pg_dump</application> is a utility for dumping out a
|
||||||
|
<productname>Postgres</productname> database into a script file
|
||||||
|
containing query commands. The script
|
||||||
|
files are in text format and can be used to reconstruct the database,
|
||||||
|
even on other machines and other architectures.
|
||||||
|
<application>pg_dump</application>
|
||||||
|
will produce the queries necessary to re-generate all
|
||||||
|
user-defined types, functions, tables, indices, aggregates, and
|
||||||
|
operators. In addition, all the data is copied out in text format so
|
||||||
|
that it can be readily copied in again, as well as imported into tools
|
||||||
|
for editing.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
<application>pg_dump</application>
|
||||||
|
is useful for dumping out the contents of a database to move from one
|
||||||
|
<productname>Postgres</productname> installation to another. After running
|
||||||
|
<application>pg_dump</application>,
|
||||||
|
one should examine the output script file for any warnings, especially
|
||||||
|
in light of the limitations listed below.
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1 id="R1-APP-PG-DUMP-2">
|
||||||
|
<refsect1info>
|
||||||
|
<date>1998-11-05</date>
|
||||||
|
</refsect1info>
|
||||||
|
<title>
|
||||||
|
Notes
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
<application>pg_dump</application> has a few limitations.
|
||||||
|
The limitations mostly stem from
|
||||||
|
difficulty in extracting certain meta-information from the system
|
||||||
|
catalogs.
|
||||||
|
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
<application>pg_dump</application>
|
<application>pg_dump</application>
|
||||||
is useful for dumping out the contents of a database to move from one
|
does not understand partial indices. The reason is
|
||||||
<productname>Postgres</productname> installation to another. After running
|
the same as above; partial index predicates are stored as plans.
|
||||||
<application>pg_dump</application>,
|
</para>
|
||||||
one should examine the output script file for any warnings, especially
|
</listitem>
|
||||||
in light of the limitations listed below.
|
|
||||||
</para>
|
|
||||||
</refsect1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-APP-PG-DUMP-2">
|
<listitem>
|
||||||
<REFSECT1INFO>
|
<para>
|
||||||
<DATE>1998-11-05</DATE>
|
<application>pg_dump</application> does not handle large objects.
|
||||||
</REFSECT1INFO>
|
Large objects are ignored and must be dealt with manually.
|
||||||
<TITLE>
|
</para>
|
||||||
Notes
|
</listitem>
|
||||||
</TITLE>
|
</itemizedlist>
|
||||||
<PARA>
|
</para>
|
||||||
<application>pg_dump</application> has a few limitations.
|
</refsect1>
|
||||||
The limitations mostly stem from
|
|
||||||
difficulty in extracting certain meta-information from the system
|
|
||||||
catalogs.
|
|
||||||
|
|
||||||
<variablelist>
|
<refsect1 id="R1-APP-PG-DUMP-3">
|
||||||
<varlistentry>
|
<refsect1info>
|
||||||
<term>
|
<date>1998-11-05</date>
|
||||||
partial indices
|
</refsect1info>
|
||||||
</term>
|
<title>
|
||||||
<listitem>
|
Usage
|
||||||
<para>
|
</title>
|
||||||
<application>pg_dump</application>
|
<para>
|
||||||
does not understand partial indices. The reason is
|
To dump a database of the same name as the user:
|
||||||
the same as above; partial index predicates are stored as plans.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<programlisting>
|
||||||
<term>
|
% pg_dump > db.out
|
||||||
large objects
|
</programlisting>
|
||||||
</term>
|
</para>
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
<application>pg_dump</application> does not handle large objects.
|
|
||||||
Large objects are ignored and must be dealt with manually.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
</variablelist>
|
|
||||||
</para>
|
|
||||||
</refsect1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-APP-PG-DUMP-3">
|
<para>
|
||||||
<REFSECT1INFO>
|
To reload this database:
|
||||||
<DATE>1998-11-05</DATE>
|
|
||||||
</REFSECT1INFO>
|
|
||||||
<TITLE>
|
|
||||||
Usage
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
To dump a database of the same name as the user:
|
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
% pg_dump > db.out
|
% psql -e database < db.out
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
<para>
|
</refsect1>
|
||||||
To reload this database:
|
</refentry>
|
||||||
|
|
||||||
<programlisting>
|
<!-- Keep this comment at the end of the file
|
||||||
psql -e database < db.out
|
Local variables:
|
||||||
</programlisting>
|
mode: sgml
|
||||||
</para>
|
sgml-omittag:nil
|
||||||
</refsect1>
|
sgml-shorttag:t
|
||||||
</REFENTRY>
|
sgml-minimize-attributes:nil
|
||||||
|
sgml-always-quote-attributes:t
|
||||||
|
sgml-indent-step:1
|
||||||
|
sgml-indent-data:t
|
||||||
|
sgml-parent-document:nil
|
||||||
|
sgml-default-dtd-file:"../reference.ced"
|
||||||
|
sgml-exposed-tags:nil
|
||||||
|
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
||||||
|
sgml-local-ecat-files:nil
|
||||||
|
End:
|
||||||
|
-->
|
||||||
|
|
|
@ -1,323 +1,316 @@
|
||||||
<REFENTRY ID="APP-PG-DUMPALL">
|
<refentry id="APP-PG-DUMPALL">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
<application>pg_dumpall</application>
|
<application>pg_dumpall</application>
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>Application</REFMISCINFO>
|
<refmiscinfo>Application</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
<application>pg_dumpall</application>
|
<application>pg_dumpall</application>
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Extract all <productname>Postgres</productname> databases into a script file
|
Extract all <productname>Postgres</productname> databases into a script file
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-10-04</DATE>
|
<date>1998-10-04</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
pg_dumpall
|
pg_dumpall
|
||||||
pg_dumpall [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
|
pg_dumpall [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ] [ -a ] [ -d ] [ -D ] [ -o ] [ -s ] [ -u ] [ -v ] [ -x ]
|
||||||
[ -a ] [ -d ] [ -D ] [ -o ] [ -s ] [ -u ] [ -v ] [ -x ]
|
</synopsis>
|
||||||
</SYNOPSIS>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-APP-PG-DUMPALL-1">
|
<refsect2 id="R2-APP-PG-DUMPALL-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1998-10-04</DATE>
|
<date>1998-10-04</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<application>pg_dumpall</application> accepts the following command line arguments:
|
<application>pg_dumpall</application> accepts the following command line arguments:
|
||||||
|
|
||||||
<variablelist>
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-a
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Dump out only the data, no schema (definitions).
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-d
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Dump data as proper insert strings.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-D
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Dump data as inserts with attribute names
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-n
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Suppress double quotes around identifiers unless absolutely necessary.
|
|
||||||
This may cause trouble loading this dumped data if there are reserved words
|
|
||||||
used for identifiers.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-o
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Dump object identifiers (<acronym>OID</acronym>s) for every table.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-s
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Dump out only the schema (definitions), no data.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<variablelist>
|
||||||
<term>
|
<varlistentry>
|
||||||
-u
|
<term>-a</term>
|
||||||
</term>
|
<listitem>
|
||||||
<listitem>
|
<para>
|
||||||
<para>
|
Dump out only the data, no schema (definitions).
|
||||||
Use password authentication. Prompts for username and password.
|
</para>
|
||||||
</para>
|
</listitem>
|
||||||
</listitem>
|
</varlistentry>
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-v
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Specifies verbose mode
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-x
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Prevent dumping ACLs (grant/revoke commands) and table ownership information.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
</variablelist>
|
|
||||||
</para>
|
|
||||||
<para>
|
|
||||||
<application>pg_dumpall</application> also accepts
|
|
||||||
the following command line arguments for connection parameters:
|
|
||||||
|
|
||||||
<variablelist>
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-h <replaceable class="parameter">host</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Specifies the hostname of the machine on which the
|
|
||||||
<application>postmaster</application>
|
|
||||||
is running. Defaults to using a local Unix domain socket
|
|
||||||
rather than an IP connection..
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-p <replaceable class="parameter">port</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Specifies the Internet TCP/IP port or local Unix domain socket file
|
|
||||||
extension on which the <application>postmaster</application>
|
|
||||||
is listening for connections. The port number defaults to 5432,
|
|
||||||
or the value of the <envar>PGPORT</envar>
|
|
||||||
environment variable (if set).
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
-u
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Use password authentication.
|
|
||||||
Prompts for
|
|
||||||
<replaceable class="parameter">username</replaceable>
|
|
||||||
and <replaceable class="parameter">password</replaceable>.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
</variablelist>
|
|
||||||
</para>
|
|
||||||
</refsect2>
|
|
||||||
|
|
||||||
<REFSECT2 ID="R2-APP-PG-DUMPALL-2">
|
<varlistentry>
|
||||||
<REFSECT2INFO>
|
<term>-d</term>
|
||||||
<DATE>1998-10-04</DATE>
|
<listitem>
|
||||||
</REFSECT2INFO>
|
<para>
|
||||||
<TITLE>
|
Dump data as proper insert strings.
|
||||||
Outputs
|
</para>
|
||||||
</TITLE>
|
</listitem>
|
||||||
<PARA>
|
</varlistentry>
|
||||||
<application>pg_dumpall</application> will create a file or
|
|
||||||
write to <filename>stdout</filename>.
|
|
||||||
|
|
||||||
<variablelist>
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
Connection to database 'template1' failed.
|
|
||||||
connectDB() failed: Is the postmaster running and accepting connections
|
|
||||||
at 'UNIX Socket' on port '<replaceable class="parameter">port</replaceable>'?
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
<application>pg_dumpall</application> could not attach to the
|
|
||||||
<application>postmaster</application>
|
|
||||||
process on the specified host and port. If you see this message,
|
|
||||||
ensure that the <application>postmaster</application>
|
|
||||||
is running on the proper host and that you have specified the proper
|
|
||||||
port. If your site uses an authentication system, ensure that you
|
|
||||||
have obtained the required authentication credentials.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
Connection to database '<replaceable class="parameter">dbname</replaceable>' failed.
|
|
||||||
FATAL 1: SetUserId: user '<replaceable class="parameter">username</replaceable>' is not in 'pg_shadow'
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
You do not have a valid entry in the relation <literal>pg_shadow</literal>
|
|
||||||
and and will not be allowed to access <productname>Postgres</productname>.
|
|
||||||
Contact your <productname>Postgres</productname> administrator.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-D</term>
|
||||||
dumpSequence(<replaceable class="parameter">table</replaceable>): SELECT failed
|
<listitem>
|
||||||
</term>
|
<para>
|
||||||
<listitem>
|
Dump data as inserts with attribute names
|
||||||
<para>
|
</para>
|
||||||
You do not have permission to read the database.
|
</listitem>
|
||||||
Contact your <productname>Postgres</productname> site administrator.
|
</varlistentry>
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
</variablelist>
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<note>
|
<varlistentry>
|
||||||
<para>
|
<term>-n</term>
|
||||||
<application>pg_dumpall</application> internally executes
|
<listitem>
|
||||||
<command>SELECT</command> statements. If you have problems running
|
<para>
|
||||||
<application>pg_dumpall</application>,
|
Suppress double quotes around identifiers unless absolutely necessary.
|
||||||
make sure you are able to select information from the database using, for
|
This may cause trouble loading this dumped data if there are reserved words
|
||||||
example, <application>psql</application>.
|
used for identifiers.
|
||||||
</para>
|
</para>
|
||||||
</note>
|
</listitem>
|
||||||
</refsect2>
|
</varlistentry>
|
||||||
</refsynopsisdiv>
|
|
||||||
|
<varlistentry>
|
||||||
<REFSECT1 ID="R1-APP-PG-DUMPALL-1">
|
<term>-o</term>
|
||||||
<REFSECT1INFO>
|
<listitem>
|
||||||
<DATE>1998-10-04</DATE>
|
<para>
|
||||||
</REFSECT1INFO>
|
Dump object identifiers (<acronym>OID</acronym>s) for every table.
|
||||||
<TITLE>
|
</para>
|
||||||
Description
|
</listitem>
|
||||||
</TITLE>
|
</varlistentry>
|
||||||
<PARA>
|
|
||||||
<application>pg_dumpall</application>
|
<varlistentry>
|
||||||
is a utility for dumping out all Postgres databases into one file.
|
<term>-s</term>
|
||||||
It also dumps the pg_shadow table, which is global to all databases.
|
<listitem>
|
||||||
<application>pg_dumpall</application> includes in this file the proper commands
|
<para>
|
||||||
to automatically create each dumped database before loading.
|
Dump out only the schema (definitions), no data.
|
||||||
</para>
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>-u</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Use password authentication. Prompts for username and password.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>-v</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Specifies verbose mode
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>-x</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Prevent dumping ACLs (grant/revoke commands) and table ownership information.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
<application>pg_dumpall</application> also accepts
|
||||||
|
the following command line arguments for connection parameters:
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term>-h <replaceable class="parameter">host</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Specifies the hostname of the machine on which the
|
||||||
|
<application>postmaster</application>
|
||||||
|
is running. Defaults to using a local Unix domain socket
|
||||||
|
rather than an IP connection..
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>-p <replaceable class="parameter">port</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Specifies the Internet TCP/IP port or local Unix domain socket file
|
||||||
|
extension on which the <application>postmaster</application>
|
||||||
|
is listening for connections. The port number defaults to 5432,
|
||||||
|
or the value of the <envar>PGPORT</envar>
|
||||||
|
environment variable (if set).
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>-u</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Use password authentication.
|
||||||
|
Prompts for
|
||||||
|
<replaceable class="parameter">username</replaceable>
|
||||||
|
and <replaceable class="parameter">password</replaceable>.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
</refsect2>
|
||||||
|
|
||||||
|
<refsect2 id="R2-APP-PG-DUMPALL-2">
|
||||||
|
<refsect2info>
|
||||||
|
<date>1998-10-04</date>
|
||||||
|
</refsect2info>
|
||||||
|
<title>
|
||||||
|
Outputs
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
<application>pg_dumpall</application> will create a file or
|
||||||
|
write to <filename>stdout</filename>.
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
Connection to database 'template1' failed.
|
||||||
|
connectDB() failed: Is the postmaster running and accepting connections at 'UNIX Socket' on port '<replaceable class="parameter">port</replaceable>'?
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
<application>pg_dumpall</application> could not attach to the
|
||||||
|
<application>postmaster</application>
|
||||||
|
process on the specified host and port. If you see this message,
|
||||||
|
ensure that the <application>postmaster</application>
|
||||||
|
is running on the proper host and that you have specified the proper
|
||||||
|
port. If your site uses an authentication system, ensure that you
|
||||||
|
have obtained the required authentication credentials.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
Connection to database '<replaceable class="parameter">dbname</replaceable>' failed.
|
||||||
|
FATAL 1: SetUserId: user '<replaceable class="parameter">username</replaceable>' is not in 'pg_shadow'
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
You do not have a valid entry in the relation <literal>pg_shadow</literal>
|
||||||
|
and and will not be allowed to access <productname>Postgres</productname>.
|
||||||
|
Contact your <productname>Postgres</productname> administrator.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term><computeroutput>
|
||||||
|
dumpSequence(<replaceable class="parameter">table</replaceable>): SELECT failed
|
||||||
|
</computeroutput></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
You do not have permission to read the database.
|
||||||
|
Contact your <productname>Postgres</productname> site administrator.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<note>
|
||||||
<para>
|
<para>
|
||||||
<application>pg_dumpall</application> takes all <application>pg_dump</application>
|
<application>pg_dumpall</application> internally executes
|
||||||
options, but <option>-f</option>, <option>-t</option> and
|
<command>SELECT</command> statements. If you have problems running
|
||||||
<replaceable class="parameter">dbname</replaceable>
|
<application>pg_dumpall</application>,
|
||||||
should be omitted.
|
make sure you are able to select information from the database using, for
|
||||||
|
example, <application>psql</application>.
|
||||||
</para>
|
</para>
|
||||||
|
</note>
|
||||||
|
</refsect2>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
|
<refsect1 id="R1-APP-PG-DUMPALL-1">
|
||||||
|
<refsect1info>
|
||||||
|
<date>1998-10-04</date>
|
||||||
|
</refsect1info>
|
||||||
|
<title>
|
||||||
|
Description
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
<application>pg_dumpall</application>
|
||||||
|
is a utility for dumping out all Postgres databases into one file.
|
||||||
|
It also dumps the pg_shadow table, which is global to all databases.
|
||||||
|
<application>pg_dumpall</application> includes in this file the proper commands
|
||||||
|
to automatically create each dumped database before loading.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
<application>pg_dumpall</application> takes all <application>pg_dump</application>
|
||||||
|
options, but <option>-f</option>, <option>-t</option> and
|
||||||
|
<replaceable class="parameter">dbname</replaceable>
|
||||||
|
should be omitted.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Refer to
|
||||||
|
<xref endterm="pg-dump" linkend="app-pg-dump">
|
||||||
|
for more information on this capability.
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
|
||||||
|
<refsect1 id="R1-APP-PG-DUMPALL-2">
|
||||||
|
<refsect1info>
|
||||||
|
<date>1998-10-04</date>
|
||||||
|
</refsect1info>
|
||||||
|
<title>
|
||||||
|
Usage
|
||||||
|
</title>
|
||||||
|
<para>
|
||||||
|
To dump all databases:
|
||||||
|
|
||||||
|
<programlisting>
|
||||||
|
% pg_dumpall -o > db.out
|
||||||
|
</programlisting>
|
||||||
|
|
||||||
|
<tip>
|
||||||
<para>
|
<para>
|
||||||
Refer to
|
You can use most <application>pg_dump</application> options
|
||||||
<xref linkend="app-pg-dump" endterm="pg-dump">
|
for <application>pg_dumpall</application>.
|
||||||
for more information on this capability.
|
|
||||||
</para
|
|
||||||
</refsect1>
|
|
||||||
|
|
||||||
<REFSECT1 ID="R1-APP-PG-DUMPALL-2">
|
|
||||||
<REFSECT1INFO>
|
|
||||||
<DATE>1998-10-04</DATE>
|
|
||||||
</REFSECT1INFO>
|
|
||||||
<TITLE>
|
|
||||||
Usage
|
|
||||||
</TITLE>
|
|
||||||
<PARA>
|
|
||||||
To dump all databases:
|
|
||||||
|
|
||||||
<programlisting>
|
|
||||||
% pg_dumpall -o > db.out
|
|
||||||
</programlisting>
|
|
||||||
|
|
||||||
<tip>
|
|
||||||
<para>
|
|
||||||
You can use most <application>pg_dump</application> options
|
|
||||||
for <application>pg_dumpall</application>.
|
|
||||||
</para>
|
|
||||||
</tip>
|
|
||||||
</para>
|
</para>
|
||||||
<para>
|
</tip>
|
||||||
To reload this database:
|
</para>
|
||||||
|
<para>
|
||||||
<programlisting>
|
To reload this database:
|
||||||
psql -e template1 < db.out
|
|
||||||
</programlisting>
|
<programlisting>
|
||||||
</para>
|
% psql -e template1 < db.out
|
||||||
<tip>
|
</programlisting>
|
||||||
<para>
|
</para>
|
||||||
You can use most <application>psql</application> options
|
<tip>
|
||||||
when reloading.
|
<para>
|
||||||
</para>
|
You can use most <application>psql</application> options
|
||||||
</tip>
|
when reloading.
|
||||||
</refsect1>
|
</para>
|
||||||
</REFENTRY>
|
</tip>
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
|
||||||
|
<!-- Keep this comment at the end of the file
|
||||||
|
Local variables:
|
||||||
|
mode: sgml
|
||||||
|
sgml-omittag:nil
|
||||||
|
sgml-shorttag:t
|
||||||
|
sgml-minimize-attributes:nil
|
||||||
|
sgml-always-quote-attributes:t
|
||||||
|
sgml-indent-step:1
|
||||||
|
sgml-indent-data:t
|
||||||
|
sgml-parent-document:nil
|
||||||
|
sgml-default-dtd-file:"../reference.ced"
|
||||||
|
sgml-exposed-tags:nil
|
||||||
|
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
||||||
|
sgml-local-ecat-files:nil
|
||||||
|
End:
|
||||||
|
-->
|
||||||
|
|
|
@ -1,59 +1,128 @@
|
||||||
<REFENTRY ID="APP-PG-UPGRADE">
|
<refentry id="APP-PG-UPGRADE">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE>
|
<refentrytitle>
|
||||||
<application>pg_upgrade</application>
|
<application>pg_upgrade</application>
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>Application</REFMISCINFO>
|
<refmiscinfo>Application</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
<application>pg_upgrade</application>
|
<application>pg_upgrade</application>
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
Allows upgrade from a previous release without reloading data
|
Allows upgrade from a previous release without reloading data
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1998-10-04</DATE>
|
<date>1998-10-04</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
pg_upgrade
|
pg_upgrade
|
||||||
pg_upgrade [-f <replaceable class="parameter">input_file</replaceable>] <replaceable class="parameter">old_data_dir</replaceable>
|
pg_upgrade [ -f <replaceable class="parameter">filename</replaceable> ] <replaceable class="parameter">old_data_dir</replaceable>
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
</refsynopsisdiv>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-APP-PG-UPGRADE-1">
|
<refsect1 id="R1-APP-PG-UPGRADE-1">
|
||||||
<REFSECT1INFO>
|
<refsect1info>
|
||||||
<DATE>1998-10-04</DATE>
|
<date>1998-10-04</date>
|
||||||
</REFSECT1INFO>
|
</refsect1info>
|
||||||
<TITLE>
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
<application>pg_upgrade</application>
|
<application>pg_upgrade</application>
|
||||||
is a utility for upgrading from a previous
|
is a utility for upgrading from a previous
|
||||||
PostgreSQL release without reloading all the data. First,
|
PostgreSQL release without reloading all the data.
|
||||||
to be safe, back up your data directory. Then, use:
|
|
||||||
<programlisting>
|
<procedure>
|
||||||
|
<title>Upgrading <productname>Postgres</productname></title>
|
||||||
|
|
||||||
|
<step performance="required">
|
||||||
|
<para>
|
||||||
|
Back up your data directory.
|
||||||
|
</para>
|
||||||
|
</step>
|
||||||
|
|
||||||
|
<step performance="required">
|
||||||
|
<para>
|
||||||
|
Use:
|
||||||
|
<programlisting>
|
||||||
% pg_dumpall -s >db.out
|
% pg_dumpall -s >db.out
|
||||||
</programlisting>
|
</programlisting>
|
||||||
to dump out your old database definitions without any
|
to dump out your old database definitions without any
|
||||||
data. Stop the postmaster and all backends.
|
data. Stop the postmaster and all backends.
|
||||||
</para>
|
</para>
|
||||||
|
</step>
|
||||||
|
|
||||||
<para>
|
<step performance="required">
|
||||||
Then rename (using mv) your old pgsql /data directory to
|
<para>
|
||||||
/data.old and do a make install to install the new binaries.
|
Rename (using mv) your old pgsql <filename>data/</filename> directory to
|
||||||
Run initdb to create a new template1 database containing the system
|
<filename>data.old/</filename>.
|
||||||
tables for the new release. Start the new postmaster, cd to the
|
</para>
|
||||||
pgsql main directory, and type:
|
</step>
|
||||||
<programlisting>
|
|
||||||
|
<step performance="required">
|
||||||
|
<para>
|
||||||
|
Do a
|
||||||
|
<command>make install</command> to install the new binaries.
|
||||||
|
</para>
|
||||||
|
</step>
|
||||||
|
|
||||||
|
<step performance="required">
|
||||||
|
<para>
|
||||||
|
Run <application>initdb</application> to create a new template1 database containing the system
|
||||||
|
tables for the new release.
|
||||||
|
</para>
|
||||||
|
</step>
|
||||||
|
|
||||||
|
<step performance="required">
|
||||||
|
<para>
|
||||||
|
Start the new postmaster.
|
||||||
|
</para>
|
||||||
|
</step>
|
||||||
|
|
||||||
|
<step performance="required">
|
||||||
|
<para>
|
||||||
|
Change your working directory to the
|
||||||
|
pgsql main directory, and type:
|
||||||
|
<programlisting>
|
||||||
% pg_upgrade -f db.out data.old
|
% pg_upgrade -f db.out data.old
|
||||||
</programlisting>
|
</programlisting>
|
||||||
The system will do some checking to make sure everything
|
The system will do some checking to make sure everything
|
||||||
is properly configured, and run your db.out script to create
|
is properly configured, and will run your db.out script to create
|
||||||
all the databases and tables you had, but with no
|
all the databases and tables you had, but with no
|
||||||
data. It will then move the data files from /data.old
|
data. It will then move the data files from <filename>data.old/</filename>
|
||||||
into the proper /data directory. You can then check out
|
into the proper <filename>data/</filename> directory.
|
||||||
the data. You can delete the /data.old directory when you
|
</para>
|
||||||
are finished.
|
</step>
|
||||||
</REFENTRY>
|
|
||||||
|
<step performance="required">
|
||||||
|
<para>
|
||||||
|
<emphasis>Carefully</emphasis> examine the contents of the upgraded database.
|
||||||
|
</para>
|
||||||
|
</step>
|
||||||
|
|
||||||
|
<step performance="required">
|
||||||
|
<para>
|
||||||
|
You can delete the <filename>data.old/</filename> directory when you
|
||||||
|
are finished.
|
||||||
|
</para>
|
||||||
|
</refsect1>
|
||||||
|
</refentry>
|
||||||
|
|
||||||
|
<!-- Keep this comment at the end of the file
|
||||||
|
Local variables:
|
||||||
|
mode: sgml
|
||||||
|
sgml-omittag:nil
|
||||||
|
sgml-shorttag:t
|
||||||
|
sgml-minimize-attributes:nil
|
||||||
|
sgml-always-quote-attributes:t
|
||||||
|
sgml-indent-step:1
|
||||||
|
sgml-indent-data:t
|
||||||
|
sgml-parent-document:nil
|
||||||
|
sgml-default-dtd-file:"../reference.ced"
|
||||||
|
sgml-exposed-tags:nil
|
||||||
|
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
||||||
|
sgml-local-ecat-files:nil
|
||||||
|
End:
|
||||||
|
-->
|
||||||
|
|
|
@ -1,57 +1,74 @@
|
||||||
<REFENTRY ID="APP-PGACCESS">
|
<refentry id="APP-PGACCESS">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE id="pgaccess-ref">
|
<refentrytitle id="pgaccess-ref">
|
||||||
<application>pgaccess</application>
|
<application>pgaccess</application>
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>Application</REFMISCINFO>
|
<refmiscinfo>Application</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
<application>pgaccess</application>
|
<application>pgaccess</application>
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
<productname>Postgres</productname> graphical interactive client
|
<productname>Postgres</productname> graphical interactive client
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1999-05-19</DATE>
|
<date>1999-05-19</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
pgaccess [ <replaceable class="parameter">dbname</replaceable> ]
|
pgaccess [ <replaceable class="parameter">dbname</replaceable> ]
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-APP-PGACCESS-1">
|
<refsect2 id="R2-APP-PGACCESS-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1999-05-19</DATE>
|
<date>1999-05-19</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="PARAMETER">dbname</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The name of an existing database to access.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-APP-PGACCESS-2">
|
<refsect2 id="R2-APP-PGACCESS-2">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1999-05-19</DATE>
|
<date>1999-05-19</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Outputs
|
Outputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-APP-PGACCESS-1">
|
<refsect1 id="R1-APP-PGACCESS-1">
|
||||||
<REFSECT1INFO>
|
<refsect1info>
|
||||||
<DATE>1999-05-19</DATE>
|
<date>1999-05-19</date>
|
||||||
</REFSECT1INFO>
|
</refsect1info>
|
||||||
<TITLE>
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
|
<note>
|
||||||
|
<title>Editor's Note</title>
|
||||||
|
<para>
|
||||||
|
This should be transcribed from other pgaccess info. Volunteers?
|
||||||
|
</para>
|
||||||
|
</note>
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@ -68,7 +85,7 @@ sgml-indent-data:t
|
||||||
sgml-parent-document:nil
|
sgml-parent-document:nil
|
||||||
sgml-default-dtd-file:"../reference.ced"
|
sgml-default-dtd-file:"../reference.ced"
|
||||||
sgml-exposed-tags:nil
|
sgml-exposed-tags:nil
|
||||||
sgml-local-catalogs:"/usr/lib/sgml/CATALOG"
|
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
||||||
sgml-local-ecat-files:nil
|
sgml-local-ecat-files:nil
|
||||||
End:
|
End:
|
||||||
-->
|
-->
|
||||||
|
|
|
@ -1,57 +1,74 @@
|
||||||
<REFENTRY ID="APP-PGADMIN">
|
<refentry id="APP-PGADMIN">
|
||||||
<REFMETA>
|
<refmeta>
|
||||||
<REFENTRYTITLE id="pgadmin-ref">
|
<refentrytitle id="pgadmin-ref">
|
||||||
<application>pgadmin</application>
|
<application>pgadmin</application>
|
||||||
</REFENTRYTITLE>
|
</refentrytitle>
|
||||||
<REFMISCINFO>Application</REFMISCINFO>
|
<refmiscinfo>Application</refmiscinfo>
|
||||||
</REFMETA>
|
</refmeta>
|
||||||
<REFNAMEDIV>
|
<refnamediv>
|
||||||
<REFNAME>
|
<refname>
|
||||||
<application>pgadmin</application>
|
<application>pgadmin</application>
|
||||||
</REFNAME>
|
</refname>
|
||||||
<REFPURPOSE>
|
<refpurpose>
|
||||||
<productname>Postgres</productname> graphical interactive client
|
<productname>Postgres</productname> graphical interactive client
|
||||||
</REFPURPOSE>
|
</refpurpose>
|
||||||
</refnamediv>
|
</refnamediv>
|
||||||
<REFSYNOPSISDIV>
|
<refsynopsisdiv>
|
||||||
<REFSYNOPSISDIVINFO>
|
<refsynopsisdivinfo>
|
||||||
<DATE>1999-05-19</DATE>
|
<date>1999-05-19</date>
|
||||||
</REFSYNOPSISDIVINFO>
|
</refsynopsisdivinfo>
|
||||||
<SYNOPSIS>
|
<synopsis>
|
||||||
pgadmin [ <replaceable class="parameter">dbname</replaceable> ]
|
pgadmin [ <replaceable class="parameter">dbname</replaceable> ]
|
||||||
</SYNOPSIS>
|
</synopsis>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-APP-PGADMIN-1">
|
<refsect2 id="R2-APP-PGADMIN-1">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1999-05-19</DATE>
|
<date>1999-05-19</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Inputs
|
Inputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term><replaceable class="PARAMETER">dbname</replaceable></term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The name of an existing database to access.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
|
|
||||||
<REFSECT2 ID="R2-APP-PGADMIN-2">
|
<refsect2 id="R2-APP-PGADMIN-2">
|
||||||
<REFSECT2INFO>
|
<refsect2info>
|
||||||
<DATE>1999-05-19</DATE>
|
<date>1999-05-19</date>
|
||||||
</REFSECT2INFO>
|
</refsect2info>
|
||||||
<TITLE>
|
<title>
|
||||||
Outputs
|
Outputs
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
<REFSECT1 ID="R1-APP-PGADMIN-1">
|
<refsect1 id="R1-APP-PGADMIN-1">
|
||||||
<REFSECT1INFO>
|
<refsect1info>
|
||||||
<DATE>1999-05-19</DATE>
|
<date>1999-05-19</date>
|
||||||
</REFSECT1INFO>
|
</refsect1info>
|
||||||
<TITLE>
|
<title>
|
||||||
Description
|
Description
|
||||||
</TITLE>
|
</title>
|
||||||
<PARA>
|
<para>
|
||||||
|
<note>
|
||||||
|
<title>Editor's Note</title>
|
||||||
|
<para>
|
||||||
|
This should be transcribed from other pgadmin info. Volunteers?
|
||||||
|
</para>
|
||||||
|
</note>
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
</refentry>
|
</refentry>
|
||||||
|
@ -68,7 +85,7 @@ sgml-indent-data:t
|
||||||
sgml-parent-document:nil
|
sgml-parent-document:nil
|
||||||
sgml-default-dtd-file:"../reference.ced"
|
sgml-default-dtd-file:"../reference.ced"
|
||||||
sgml-exposed-tags:nil
|
sgml-exposed-tags:nil
|
||||||
sgml-local-catalogs:"/usr/lib/sgml/CATALOG"
|
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
||||||
sgml-local-ecat-files:nil
|
sgml-local-ecat-files:nil
|
||||||
End:
|
End:
|
||||||
-->
|
-->
|
||||||
|
|
|
@ -36,9 +36,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><replaceable class="parameter">dbname</replaceable></term>
|
||||||
<replaceable class="parameter">dbname</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The optional argument
|
The optional argument
|
||||||
|
@ -53,9 +51,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-B <replaceable class="parameter">nBuffers</replaceable></term>
|
||||||
-B <replaceable class="parameter">nBuffers</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
If the backend is running under the
|
If the backend is running under the
|
||||||
|
@ -72,9 +68,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-C</term>
|
||||||
-C
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Do not show the server version number.
|
Do not show the server version number.
|
||||||
|
@ -83,9 +77,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-D <replaceable class="parameter">DataDir</replaceable></term>
|
||||||
-D <replaceable class="parameter">DataDir</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specifies the directory to use as the root of the tree of database
|
Specifies the directory to use as the root of the tree of database
|
||||||
|
@ -102,9 +94,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-E</term>
|
||||||
-E
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Echo all queries.
|
Echo all queries.
|
||||||
|
@ -113,9 +103,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-F</term>
|
||||||
-F
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Disable an automatic <function>fsync()</function> call after each transaction.
|
Disable an automatic <function>fsync()</function> call after each transaction.
|
||||||
|
@ -128,9 +116,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-O</term>
|
||||||
-O
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Override restrictions, so system table structures can be modified.
|
Override restrictions, so system table structures can be modified.
|
||||||
|
@ -140,9 +126,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-Q</term>
|
||||||
-Q
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specifies "quiet" mode.
|
Specifies "quiet" mode.
|
||||||
|
@ -151,9 +135,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-S <replaceable class="parameter">SortSize</replaceable></term>
|
||||||
-S <replaceable class="parameter">SortSize</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specifies the amount of memory to be used by internal sorts and hashes
|
Specifies the amount of memory to be used by internal sorts and hashes
|
||||||
|
@ -168,9 +150,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-d [ <replaceable class="parameter">DebugLevel</replaceable> ]</term>
|
||||||
-d [ <replaceable class="parameter">DebugLevel</replaceable> ]
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The optional argument <replaceable class="parameter">DebugLevel</replaceable>
|
The optional argument <replaceable class="parameter">DebugLevel</replaceable>
|
||||||
|
@ -191,9 +171,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-e</term>
|
||||||
-e
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
This option controls how dates are interpreted upon
|
This option controls how dates are interpreted upon
|
||||||
|
@ -214,9 +192,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-o <replaceable class="parameter">OutputFile</replaceable></term>
|
||||||
-o <replaceable class="parameter">OutputFile</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Sends all debugging and error output to
|
Sends all debugging and error output to
|
||||||
|
@ -232,9 +208,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-s</term>
|
||||||
-s
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Print time information and other statistics at the end of each query.
|
Print time information and other statistics at the end of each query.
|
||||||
|
@ -245,9 +219,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-v <replaceable class="parameter">protocol</replaceable></term>
|
||||||
-v <replaceable class="parameter">protocol</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specifies the number of the frontend/backend protocol to be used for this
|
Specifies the number of the frontend/backend protocol to be used for this
|
||||||
|
@ -271,9 +243,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-A n|r|b|Q\fIn\fP|X\fIn\fP</term>
|
||||||
-A n|r|b|Q\fIn\fP|X\fIn\fP
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
This option generates a tremendous amount of output.
|
This option generates a tremendous amount of output.
|
||||||
|
@ -282,9 +252,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-L</term>
|
||||||
-L
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Turns off the locking system.
|
Turns off the locking system.
|
||||||
|
@ -293,9 +261,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-N</term>
|
||||||
-N
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Disables use of newline as a query delimiter.
|
Disables use of newline as a query delimiter.
|
||||||
|
@ -304,9 +270,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-f [ s | i | m | n | h ]</term>
|
||||||
-f [ s | i | m | n | h ]
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Forbids the use of particular scan and join methods:
|
Forbids the use of particular scan and join methods:
|
||||||
|
@ -328,9 +292,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-i</term>
|
||||||
-i
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Prevents query execution, but shows the plan tree.
|
Prevents query execution, but shows the plan tree.
|
||||||
|
@ -339,9 +301,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-p <replaceable class="parameter">dbname</replaceable></term>
|
||||||
-p <replaceable class="parameter">dbname</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Indicates to the backend server that it has been started by a
|
Indicates to the backend server that it has been started by a
|
||||||
|
@ -354,9 +314,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-t pa[rser] | pl[anner] | e[xecutor]</term>
|
||||||
-t pa[rser] | pl[anner] | e[xecutor]
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Print timing statistics for each query relating to each of the major
|
Print timing statistics for each query relating to each of the major
|
||||||
|
@ -381,9 +339,9 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><computeroutput>
|
||||||
semget: No space left on device
|
semget: No space left on device
|
||||||
</term>
|
</computeroutput></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
If you see this message, you should run the
|
If you see this message, you should run the
|
||||||
|
|
|
@ -36,9 +36,7 @@ postmaster [ -n | -s ] ...
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-B <replaceable class="parameter">nBuffers</replaceable></term>
|
||||||
-B <replaceable class="parameter">nBuffers</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The number of shared-memory buffers for the
|
The number of shared-memory buffers for the
|
||||||
|
@ -51,9 +49,7 @@ postmaster [ -n | -s ] ...
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-D <replaceable class="parameter">DataDir</replaceable></term>
|
||||||
-D <replaceable class="parameter">DataDir</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specifies the directory to use as the root of the tree of database
|
Specifies the directory to use as the root of the tree of database
|
||||||
|
@ -70,9 +66,7 @@ postmaster [ -n | -s ] ...
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-N <replaceable class="parameter">nBackends</replaceable></term>
|
||||||
-N <replaceable class="parameter">nBackends</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The maximum number of backend server processes that this postmaster
|
The maximum number of backend server processes that this postmaster
|
||||||
|
@ -86,9 +80,7 @@ postmaster [ -n | -s ] ...
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-S</term>
|
||||||
-S
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specifies that the <application>postmaster</application>
|
Specifies that the <application>postmaster</application>
|
||||||
|
@ -102,9 +94,7 @@ postmaster [ -n | -s ] ...
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-d [ <replaceable class="parameter">DebugLevel</replaceable> ]</term>
|
||||||
-d [ <replaceable class="parameter">DebugLevel</replaceable> ]
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The optional argument <replaceable class="parameter">DebugLevel</replaceable>
|
The optional argument <replaceable class="parameter">DebugLevel</replaceable>
|
||||||
|
@ -125,9 +115,7 @@ postmaster [ -n | -s ] ...
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-i</term>
|
||||||
-i
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
This enables TCP/IP or Internet domain socket communication.
|
This enables TCP/IP or Internet domain socket communication.
|
||||||
|
@ -138,9 +126,7 @@ postmaster [ -n | -s ] ...
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-o <replaceable class="parameter">BackendOptions</replaceable></term>
|
||||||
-o <replaceable class="parameter">BackendOptions</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The
|
The
|
||||||
|
@ -156,9 +142,7 @@ postmaster [ -n | -s ] ...
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-p <replaceable class="parameter">port</replaceable></term>
|
||||||
-p <replaceable class="parameter">port</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specifies the TCP/IP port or local Unix domain socket file extension
|
Specifies the TCP/IP port or local Unix domain socket file extension
|
||||||
|
@ -200,9 +184,7 @@ postmaster [ -n | -s ] ...
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-n</term>
|
||||||
-n
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
<application>postmaster</application>
|
<application>postmaster</application>
|
||||||
|
@ -215,9 +197,7 @@ postmaster [ -n | -s ] ...
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-s</term>
|
||||||
-s
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
<application>postmaster</application>
|
<application>postmaster</application>
|
||||||
|
@ -259,9 +239,9 @@ postmaster [ -n | -s ] ...
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
-->
|
-->
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><computeroutput>
|
||||||
semget: No space left on device
|
semget: No space left on device
|
||||||
</term>
|
</computeroutput></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
If you see this message, you should run the
|
If you see this message, you should run the
|
||||||
|
@ -290,9 +270,9 @@ postmaster [ -n | -s ] ...
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><computeroutput>
|
||||||
StreamServerPort: cannot bind to port
|
StreamServerPort: cannot bind to port
|
||||||
</term>
|
</computeroutput></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
If you see this message, you should be certain that there is no other
|
If you see this message, you should be certain that there is no other
|
||||||
|
@ -330,9 +310,9 @@ on BSD-based systems, or
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><computeroutput>
|
||||||
IpcMemoryAttach: shmat() failed: Permission denied
|
IpcMemoryAttach: shmat() failed: Permission denied
|
||||||
</term>
|
</computeroutput></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
A likely explanation is that another user attempted to start a
|
A likely explanation is that another user attempted to start a
|
||||||
|
|
|
@ -20,11 +20,9 @@
|
||||||
<synopsis>
|
<synopsis>
|
||||||
psql [ <replaceable class="parameter">dbname</replaceable> ]
|
psql [ <replaceable class="parameter">dbname</replaceable> ]
|
||||||
psql -A [ -c <replaceable class="parameter">query</replaceable> ] [ -d <replaceable class="parameter">dbname</replaceable> ]
|
psql -A [ -c <replaceable class="parameter">query</replaceable> ] [ -d <replaceable class="parameter">dbname</replaceable> ]
|
||||||
-e -E [ -f <replaceable class="parameter">filename</replaceable> ]
|
-e -E [ -f <replaceable class="parameter">filename</replaceable> ] [ -F <replaceable class="parameter">separator</replaceable> ]
|
||||||
[ -F <replaceable class="parameter">separator</replaceable> ] [ -h <replaceable class="parameter">hostname</replaceable> ]
|
[ -h <replaceable class="parameter">hostname</replaceable> ] -Hln [ -o <replaceable class="parameter">filename</replaceable> ]
|
||||||
-Hln [ -o <replaceable class="parameter">filename</replaceable> ] [ -p
|
[ -p <replaceable class="parameter">port</replaceable> ] -qsSt [ -T <replaceable class="parameter">table_o</replaceable> ] -ux
|
||||||
<replaceable class="parameter">port</replaceable> ]
|
|
||||||
-qsSt [ -T <replaceable class="parameter">table_o</replaceable> ] -ux
|
|
||||||
[ <replaceable class="parameter">dbname</replaceable> ]
|
[ <replaceable class="parameter">dbname</replaceable> ]
|
||||||
</synopsis>
|
</synopsis>
|
||||||
|
|
||||||
|
@ -43,9 +41,7 @@ psql -A [ -c <replaceable class="parameter">query</replaceable> ] [ -d <replacea
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><replaceable class="PARAMETER">dbname</replaceable></term>
|
||||||
<replaceable class="PARAMETER">dbname</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The name of an existing database to access.
|
The name of an existing database to access.
|
||||||
|
@ -59,22 +55,21 @@ psql -A [ -c <replaceable class="parameter">query</replaceable> ] [ -d <replacea
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-c <replaceable class="parameter">query</replaceable></term>
|
||||||
-c <replaceable class="parameter">query</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
A single query to run. <application>psql</application> will exit on completion.
|
A single query to run. <application>psql</application> will exit on completion.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The full set of command-line arguments and meta-commands are described in a subsequent
|
The full set of command-line arguments and meta-commands are described in a subsequent
|
||||||
section.
|
section.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
There are some environment variables which can be used in liu of
|
There are some environment variables which can be used in liu of
|
||||||
command line arguments.
|
command line arguments.
|
||||||
|
@ -91,9 +86,7 @@ psql -A [ -c <replaceable class="parameter">query</replaceable> ] [ -d <replacea
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><envar>PGHOST</envar></term>
|
||||||
<envar>PGHOST</envar>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The <acronym>DNS</acronym> host name of the database server.
|
The <acronym>DNS</acronym> host name of the database server.
|
||||||
|
@ -105,9 +98,7 @@ psql -A [ -c <replaceable class="parameter">query</replaceable> ] [ -d <replacea
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><envar>PGPORT</envar></term>
|
||||||
<envar>PGPORT</envar>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The port number on which a <productname>Postgres</productname> server is listening.
|
The port number on which a <productname>Postgres</productname> server is listening.
|
||||||
|
@ -117,9 +108,7 @@ psql -A [ -c <replaceable class="parameter">query</replaceable> ] [ -d <replacea
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><envar>PGTTY</envar></term>
|
||||||
<envar>PGTTY</envar>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The target for display of messages from the client support library.
|
The target for display of messages from the client support library.
|
||||||
|
@ -129,9 +118,7 @@ psql -A [ -c <replaceable class="parameter">query</replaceable> ] [ -d <replacea
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><envar>PGOPTION</envar></term>
|
||||||
<envar>PGOPTION</envar>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
If <envar>PGOPTION</envar>
|
If <envar>PGOPTION</envar>
|
||||||
|
@ -143,9 +130,7 @@ psql -A [ -c <replaceable class="parameter">query</replaceable> ] [ -d <replacea
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><envar>PGREALM</envar></term>
|
||||||
<envar>PGREALM</envar>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
<envar>PGREALM</envar>
|
<envar>PGREALM</envar>
|
||||||
|
@ -176,11 +161,13 @@ psql -A [ -c <replaceable class="parameter">query</replaceable> ] [ -d <replacea
|
||||||
<application>psql</application>
|
<application>psql</application>
|
||||||
returns 0 to the shell on successful completion of all queries,
|
returns 0 to the shell on successful completion of all queries,
|
||||||
1 for errors, 2 for abrupt disconnection from the backend.
|
1 for errors, 2 for abrupt disconnection from the backend.
|
||||||
The default TAB delimiter is used.
|
|
||||||
<application>psql</application>
|
<application>psql</application>
|
||||||
will also return 1 if the connection to a database could not be made for
|
will also return 1 if the connection to a database could not be made for
|
||||||
any reason.
|
any reason.
|
||||||
</para>
|
</para>
|
||||||
|
<para>
|
||||||
|
The default TAB delimiter is used.
|
||||||
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
|
@ -337,9 +324,7 @@ testdb=>
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-A</term>
|
||||||
-A
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Turn off fill justification when printing out table elements.
|
Turn off fill justification when printing out table elements.
|
||||||
|
@ -348,9 +333,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-c <replaceable class="parameter">query</replaceable></term>
|
||||||
-c <replaceable class="parameter">query</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specifies that
|
Specifies that
|
||||||
|
@ -364,9 +347,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-d <replaceable class="parameter">dbname</replaceable></term>
|
||||||
-d <replaceable class="parameter">dbname</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specifies the name of the database to connect to. This is equivalent to specifying
|
Specifies the name of the database to connect to. This is equivalent to specifying
|
||||||
|
@ -377,9 +358,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-e</term>
|
||||||
-e
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Echo the query sent to the backend
|
Echo the query sent to the backend
|
||||||
|
@ -388,9 +367,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-E</term>
|
||||||
-E
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Echo the actual query generated by \d and other backslash commands
|
Echo the actual query generated by \d and other backslash commands
|
||||||
|
@ -399,9 +376,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-f <replaceable class="parameter">filename</replaceable></term>
|
||||||
-f <replaceable class="parameter">filename</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Use the file <replaceable class="parameter">filename</replaceable>
|
Use the file <replaceable class="parameter">filename</replaceable>
|
||||||
|
@ -412,9 +387,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-F <replaceable class="parameter">separator</replaceable></term>
|
||||||
-F <replaceable class="parameter">separator</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Use <replaceable class="parameter">separator</replaceable>
|
Use <replaceable class="parameter">separator</replaceable>
|
||||||
|
@ -425,9 +398,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-h <replaceable class="parameter">hostname</replaceable></term>
|
||||||
-h <replaceable class="parameter">hostname</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specifies the host name of the machine on which the
|
Specifies the host name of the machine on which the
|
||||||
|
@ -440,9 +411,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-H</term>
|
||||||
-H
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Turns on
|
Turns on
|
||||||
|
@ -453,9 +422,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-l</term>
|
||||||
-l
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Lists all available databases, then exit. Other non-connection options are ignored.
|
Lists all available databases, then exit. Other non-connection options are ignored.
|
||||||
|
@ -464,9 +431,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-n</term>
|
||||||
-n
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Do not use the readline library for input line editing and command history.
|
Do not use the readline library for input line editing and command history.
|
||||||
|
@ -475,9 +440,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-o <replaceable class="parameter">filename</replaceable></term>
|
||||||
-o <replaceable class="parameter">filename</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Put all output into file <replaceable class="parameter">filename</replaceable>.
|
Put all output into file <replaceable class="parameter">filename</replaceable>.
|
||||||
|
@ -487,9 +450,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-p <replaceable class="parameter">port</replaceable></term>
|
||||||
-p <replaceable class="parameter">port</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specifies the TCP/IP port or, by omission, the local Unix domain socket file
|
Specifies the TCP/IP port or, by omission, the local Unix domain socket file
|
||||||
|
@ -503,9 +464,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-q</term>
|
||||||
-q
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Specifies that
|
Specifies that
|
||||||
|
@ -520,9 +479,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-s</term>
|
||||||
-s
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Run in single-step mode where the user is prompted for each query before
|
Run in single-step mode where the user is prompted for each query before
|
||||||
|
@ -532,9 +489,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-S</term>
|
||||||
-S
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Runs in single-line mode where each query is terminated by a newline,
|
Runs in single-line mode where each query is terminated by a newline,
|
||||||
|
@ -544,9 +499,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-t</term>
|
||||||
-t
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Turn off printing of column names.
|
Turn off printing of column names.
|
||||||
|
@ -558,9 +511,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-T <replaceable class="parameter">table_options</replaceable></term>
|
||||||
-T <replaceable class="parameter">table_options</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Allows you to specify options to be placed within the
|
Allows you to specify options to be placed within the
|
||||||
|
@ -573,9 +524,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-u</term>
|
||||||
-u
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Asks the user for the user name and password before connecting to the database.
|
Asks the user for the user name and password before connecting to the database.
|
||||||
|
@ -588,9 +537,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>-x</term>
|
||||||
-x
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Turns on extended row format mode. When enabled each row will have its column
|
Turns on extended row format mode. When enabled each row will have its column
|
||||||
|
@ -640,9 +587,7 @@ testdb=>
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\a</literal></term>
|
||||||
<literal>\a</literal>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Toggle field alignment when printing out table elements.
|
Toggle field alignment when printing out table elements.
|
||||||
|
@ -651,9 +596,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\C</literal> <replaceable class="parameter">caption</replaceable></term>
|
||||||
<literal>\C</literal> <replaceable class="parameter">caption</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Set the HTML3.0 table caption to
|
Set the HTML3.0 table caption to
|
||||||
|
@ -663,10 +606,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\connect</literal> <replaceable class="parameter">meter"</replaceable>ceable> [ <replaceable class="parameter">username</replaceable> ]</term>
|
||||||
<literal>\connect</literal> <replaceable class="parameter">meter"</replaceable>ceable> [ <replaceable
|
|
||||||
class="parameter">username</replaceable> ]
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Establish a connection to a new database, using the default
|
Establish a connection to a new database, using the default
|
||||||
|
@ -677,9 +617,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\copy</literal> <replaceable class="parameter">meter"</replaceable>ceable> { FROM | TO } <replaceable class="parameter">filename</replaceable>
|
||||||
<literal>\copy</literal> <replaceable class="parameter">meter"</replaceable>ceable> { FROM | TO }
|
|
||||||
<replaceable class="parameter">filename</replaceable>
|
|
||||||
</term>
|
</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
|
@ -703,9 +641,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\d</literal> [ <replaceable class="parameter">table</replaceable> ]</term>
|
||||||
<literal>\d</literal> [ <replaceable class="parameter">table</replaceable> ]
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
List tables in the database, or if <replaceable
|
List tables in the database, or if <replaceable
|
||||||
|
@ -718,9 +654,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\da</literal></term>
|
||||||
<literal>\da</literal>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
List all available aggregates.
|
List all available aggregates.
|
||||||
|
@ -729,9 +663,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\dd</literal> <replaceable class="parameter">object</replaceable></term>
|
||||||
<literal>\dd</literal> <replaceable class="parameter">object</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
List the description from <literal>pg_description</literal>
|
List the description from <literal>pg_description</literal>
|
||||||
|
@ -749,9 +681,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\df</literal></term>
|
||||||
<literal>\df</literal>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
List functions.
|
List functions.
|
||||||
|
@ -760,9 +690,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\di</literal></term>
|
||||||
<literal>\di</literal>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
List only indexes.
|
List only indexes.
|
||||||
|
@ -771,9 +699,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\do</literal></term>
|
||||||
<literal>\do</literal>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
List only operators.
|
List only operators.
|
||||||
|
@ -782,9 +708,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\ds</literal></term>
|
||||||
<literal>\ds</literal>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
List only sequences.
|
List only sequences.
|
||||||
|
@ -793,9 +717,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\dS</literal></term>
|
||||||
<literal>\dS</literal>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
List system tables and indexes.
|
List system tables and indexes.
|
||||||
|
@ -804,9 +726,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\dt</literal></term>
|
||||||
<literal>\dt</literal>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
List only non-system tables.
|
List only non-system tables.
|
||||||
|
@ -815,9 +735,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\dT</literal></term>
|
||||||
<literal>\dT</literal>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
List types.
|
List types.
|
||||||
|
@ -825,10 +743,8 @@ testdb=>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry><term>
|
||||||
<term>
|
<literal>\e</literal> [ <replaceable class="parameter">filename</replaceable> ]</term>
|
||||||
<literal>\e</literal> [ <replaceable class="parameter">filename</replaceable> ]
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Edit the current query buffer or the contents of the file
|
Edit the current query buffer or the contents of the file
|
||||||
|
@ -838,9 +754,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\E</literal> [ <replaceable class="parameter">filename</replaceable> ]</term>
|
||||||
<literal>\E</literal> [ <replaceable class="parameter">filename</replaceable> ]
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Edit the current query buffer or the contents of the file
|
Edit the current query buffer or the contents of the file
|
||||||
|
@ -851,9 +765,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\f</literal> [ <replaceable class="parameter">separator</replaceable> ]</term>
|
||||||
<literal>\f</literal> [ <replaceable class="parameter">separator</replaceable> ]
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Set the field separator. Default is a single blank space.
|
Set the field separator. Default is a single blank space.
|
||||||
|
@ -862,9 +774,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\g</literal> [ { <replaceable class="parameter">filename</replaceable> | <literal>|</literal><replaceable class="parameter">command</replaceable> } ]</term>
|
||||||
<literal>\g</literal> [ { <replaceable class="parameter">filename</replaceable> | <literal>|</literal><replaceable class="parameter">command</replaceable> } ]
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Send the current query input buffer to the backend and optionally
|
Send the current query input buffer to the backend and optionally
|
||||||
|
@ -876,9 +786,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\h</literal> [ <replaceable class="parameter">command</replaceable> ]</term>
|
||||||
<literal>\h</literal> [ <replaceable class="parameter">command</replaceable> ]
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Give syntax help on the specified SQL command.
|
Give syntax help on the specified SQL command.
|
||||||
|
@ -895,9 +803,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\H</literal></term>
|
||||||
<literal>\H</literal>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Toggle <acronym>HTML3</acronym> output. This is equivalent to
|
Toggle <acronym>HTML3</acronym> output. This is equivalent to
|
||||||
|
@ -908,9 +814,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\i</literal> <replaceable class="parameter">filename</replaceable></term>
|
||||||
<literal>\i</literal> <replaceable class="parameter">filename</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Read queries from the file <replaceable class="parameter">filename</replaceable>
|
Read queries from the file <replaceable class="parameter">filename</replaceable>
|
||||||
|
@ -920,9 +824,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\l</literal></term>
|
||||||
<literal>\l</literal>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
List all the databases in the server.
|
List all the databases in the server.
|
||||||
|
@ -931,9 +833,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\m</literal></term>
|
||||||
<literal>\m</literal>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Toggle the old monitor-like table display, which includes border characters
|
Toggle the old monitor-like table display, which includes border characters
|
||||||
|
@ -946,9 +846,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\o</literal> [ { <replaceable class="parameter">filename</replaceable> | <literal>|</literal><replaceable class="parameter">command</replaceable> } ]</term>
|
||||||
<literal>\o</literal> [ { <replaceable class="parameter">filename</replaceable> | <literal>|</literal><replaceable class="parameter">command</replaceable> } ]
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Save future query results to the file
|
Save future query results to the file
|
||||||
|
@ -962,9 +860,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\p</literal></term>
|
||||||
<literal>\p</literal>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Print the current query buffer.
|
Print the current query buffer.
|
||||||
|
@ -973,9 +869,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\q</literal></term>
|
||||||
<literal>\q</literal>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Quit the <application>psql</application> program.
|
Quit the <application>psql</application> program.
|
||||||
|
@ -984,9 +878,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\r</literal></term>
|
||||||
<literal>\r</literal>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Reset(clear) the query buffer.
|
Reset(clear) the query buffer.
|
||||||
|
@ -995,9 +887,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\s</literal> [ <replaceable class="parameter">filename</replaceable> ]</term>
|
||||||
<literal>\s</literal> [ <replaceable class="parameter">filename</replaceable> ]
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Print or save the command line history to
|
Print or save the command line history to
|
||||||
|
@ -1011,9 +901,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\t</literal></term>
|
||||||
<literal>\t</literal>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Toggle display of output column name headings and row count footer (defaults to on).
|
Toggle display of output column name headings and row count footer (defaults to on).
|
||||||
|
@ -1022,9 +910,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\T</literal> <replaceable class="parameter">table_options</replaceable></term>
|
||||||
<literal>\T</literal> <replaceable class="parameter">table_options</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Allows you to specify options to be placed within the
|
Allows you to specify options to be placed within the
|
||||||
|
@ -1038,9 +924,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\x</literal></term>
|
||||||
<literal>\x</literal>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Toggles extended row format mode. When enabled each row will have its column
|
Toggles extended row format mode. When enabled each row will have its column
|
||||||
|
@ -1052,9 +936,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\w</literal> <replaceable class="parameter">filename</replaceable></term>
|
||||||
<literal>\w</literal> <replaceable class="parameter">filename</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Outputs the current query buffer to the file
|
Outputs the current query buffer to the file
|
||||||
|
@ -1064,9 +946,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\z</literal></term>
|
||||||
<literal>\z</literal>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Produces a list of all tables in the database with their appropriate ACLs
|
Produces a list of all tables in the database with their appropriate ACLs
|
||||||
|
@ -1076,9 +956,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\!</literal> [ <replaceable class="parameter">command</replaceable> ]</term>
|
||||||
<literal>\!</literal> [ <replaceable class="parameter">command</replaceable> ]
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Escape to a separate Unix shell or execute the Unix command
|
Escape to a separate Unix shell or execute the Unix command
|
||||||
|
@ -1088,9 +966,7 @@ testdb=>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><literal>\?</literal></term>
|
||||||
<literal>\?</literal>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Get help information about the slash (<quote>\</quote>) commands.
|
Get help information about the slash (<quote>\</quote>) commands.
|
||||||
|
@ -1114,7 +990,7 @@ sgml-indent-data:t
|
||||||
sgml-parent-document:nil
|
sgml-parent-document:nil
|
||||||
sgml-default-dtd-file:"../reference.ced"
|
sgml-default-dtd-file:"../reference.ced"
|
||||||
sgml-exposed-tags:nil
|
sgml-exposed-tags:nil
|
||||||
sgml-local-catalogs:"/usr/lib/sgml/CATALOG"
|
sgml-local-catalogs:"/usr/lib/sgml/catalog"
|
||||||
sgml-local-ecat-files:nil
|
sgml-local-ecat-files:nil
|
||||||
End:
|
End:
|
||||||
-->
|
-->
|
||||||
|
|
|
@ -31,9 +31,7 @@ RESET <replaceable class="PARAMETER">variable</replaceable>
|
||||||
<para>
|
<para>
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><replaceable class="PARAMETER">variable</replaceable></term>
|
||||||
<replaceable class="PARAMETER">variable</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Refer to the SET statement for more information on available
|
Refer to the SET statement for more information on available
|
||||||
|
@ -56,9 +54,9 @@ RESET <replaceable class="PARAMETER">variable</replaceable>
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><computeroutput>
|
||||||
RESET VARIABLE
|
RESET VARIABLE
|
||||||
</term>
|
</computeroutput></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Message returned if
|
Message returned if
|
||||||
|
@ -110,12 +108,17 @@ RESET <replaceable class="PARAMETER">variable</replaceable>
|
||||||
Usage
|
Usage
|
||||||
</title>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
|
Set DateStyle to its default value:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
-- reset DateStyle to its default;
|
|
||||||
RESET DateStyle;
|
RESET DateStyle;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Set Geqo to its default value:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
-- reset Geqo to its default;
|
|
||||||
RESET GEQO;
|
RESET GEQO;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
|
|
|
@ -34,93 +34,80 @@ REVOKE <replaceable class="PARAMETER">privilege</replaceable> [, ...]
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><replaceable class="PARAMETER">privilege</replaceable></term>
|
||||||
<replaceable class="PARAMETER">privilege</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The possible privileges are:
|
The possible privileges are:
|
||||||
|
|
||||||
|
<variablelist>
|
||||||
|
<varlistentry>
|
||||||
|
<term>SELECT</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Privilege to access all of the columns of a specific
|
||||||
|
table/view.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>INSERT</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Privilege to insert data into all columns of a
|
||||||
|
specific table.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>UPDATE</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Privilege to update all columns of a specific
|
||||||
|
table.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>DELETE</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Privilege to delete rows from a specific table.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>RULE</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Privilege to define rules on table/view.
|
||||||
|
(See <command>CREATE RULE</command>).
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
<varlistentry>
|
||||||
|
<term>ALL</term>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
Rescind all privileges.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><replaceable class="PARAMETER">object</replaceable></term>
|
||||||
SELECT
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Privilege to access all of the columns of a specific
|
|
||||||
table/view.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
INSERT
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Privilege to insert data into all columns of a
|
|
||||||
specific table.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
UPDATE
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Privilege to update all columns of a specific
|
|
||||||
table.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
DELETE
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Privilege to delete rows from a specific table.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
RULE
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Privilege to define rules on table/view.
|
|
||||||
(See <command>CREATE RULE</command>).
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
ALL
|
|
||||||
</term>
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Rescind all privileges.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
|
||||||
<term>
|
|
||||||
<replaceable class="PARAMETER">object</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The name of an object from which to revoke access.
|
The name of an object from which to revoke access.
|
||||||
|
|
||||||
The possible objects are:
|
The possible objects are:
|
||||||
<itemizedlist spacing="compact" mark="bullet">
|
<itemizedlist spacing="compact" mark="bullet">
|
||||||
<listitem>
|
<listitem>
|
||||||
|
@ -152,9 +139,7 @@ REVOKE <replaceable class="PARAMETER">privilege</replaceable> [, ...]
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><replaceable class="PARAMETER">group</replaceable></term>
|
||||||
<replaceable class="PARAMETER">group</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The name of a group from whom to revoke privileges.
|
The name of a group from whom to revoke privileges.
|
||||||
|
@ -163,9 +148,7 @@ REVOKE <replaceable class="PARAMETER">privilege</replaceable> [, ...]
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><replaceable class="PARAMETER">username</replaceable></term>
|
||||||
<replaceable class="PARAMETER">username</replaceable>
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The name of a user from whom revoke privileges. Use the PUBLIC keyword
|
The name of a user from whom revoke privileges. Use the PUBLIC keyword
|
||||||
|
@ -175,9 +158,7 @@ REVOKE <replaceable class="PARAMETER">privilege</replaceable> [, ...]
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term>PUBLIC</term>
|
||||||
PUBLIC
|
|
||||||
</term>
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Rescind the specified privilege(s) for all users.
|
Rescind the specified privilege(s) for all users.
|
||||||
|
@ -199,9 +180,9 @@ REVOKE <replaceable class="PARAMETER">privilege</replaceable> [, ...]
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><computeroutput>
|
||||||
CHANGE
|
CHANGE
|
||||||
</term>
|
</computeroutput></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Message returned if successfully.
|
Message returned if successfully.
|
||||||
|
@ -210,9 +191,9 @@ REVOKE <replaceable class="PARAMETER">privilege</replaceable> [, ...]
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><computeroutput>
|
||||||
ERROR
|
ERROR
|
||||||
</term>
|
</computeroutput></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Message returned if object is not available or impossible
|
Message returned if object is not available or impossible
|
||||||
|
@ -233,7 +214,7 @@ REVOKE <replaceable class="PARAMETER">privilege</replaceable> [, ...]
|
||||||
Description
|
Description
|
||||||
</title>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
REVOKE allows creator of an object to revoke permissions granted
|
<command>REVOKE</command> allows creator of an object to revoke permissions granted
|
||||||
before, from all users (via PUBLIC) or a certain user or group.
|
before, from all users (via PUBLIC) or a certain user or group.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
@ -271,7 +252,8 @@ Legend:
|
||||||
<para>
|
<para>
|
||||||
Currently, to create a GROUP you have to insert
|
Currently, to create a GROUP you have to insert
|
||||||
data manually into table pg_group as:
|
data manually into table pg_group as:
|
||||||
<programlisting>
|
|
||||||
|
<programlisting>
|
||||||
INSERT INTO pg_group VALUES ('todos');
|
INSERT INTO pg_group VALUES ('todos');
|
||||||
CREATE USER miriam IN GROUP todos;
|
CREATE USER miriam IN GROUP todos;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
@ -286,15 +268,18 @@ CREATE USER miriam IN GROUP todos;
|
||||||
Usage
|
Usage
|
||||||
</title>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
|
Revoke insert privilege from all users on table
|
||||||
|
<literal>films</literal>:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
-- revoke insert privilege from all users on table films:
|
|
||||||
--
|
|
||||||
REVOKE INSERT ON films FROM PUBLIC;
|
REVOKE INSERT ON films FROM PUBLIC;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
Revoke all privileges from user <literal>manuel</literal> on view <literal>kinds</literal>:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
-- revoke all privileges from user manuel on view kinds:
|
|
||||||
--
|
|
||||||
REVOKE ALL ON kinds FROM manuel;
|
REVOKE ALL ON kinds FROM manuel;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
|
@ -355,6 +340,7 @@ REVOKE GRANT OPTION FOR <replaceable class="parameter">privilege</replaceable> [
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The possible objects are:
|
The possible objects are:
|
||||||
<simplelist>
|
<simplelist>
|
||||||
|
@ -381,6 +367,7 @@ REVOKE GRANT OPTION FOR <replaceable class="parameter">privilege</replaceable> [
|
||||||
and user2 gives it to user3 then user1 can revoke
|
and user2 gives it to user3 then user1 can revoke
|
||||||
this privilege in cascade using the CASCADE keyword.
|
this privilege in cascade using the CASCADE keyword.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
If user1 gives a privilege WITH GRANT OPTION to user2,
|
If user1 gives a privilege WITH GRANT OPTION to user2,
|
||||||
and user2 gives it to user3 then if user1 try revoke
|
and user2 gives it to user3 then if user1 try revoke
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
<refentry id="SQL-ROLLBACK">
|
<refentry id="SQL-ROLLBACK">
|
||||||
<refmeta>
|
<refmeta>
|
||||||
<refentrytitle id="SQL-ROLLBACK-TITLE">
|
<refentrytitle id="SQL-ROLLBACK-TITLE">
|
||||||
ROLLBACK
|
ROLLBACK
|
||||||
</refentrytitle>
|
</refentrytitle>
|
||||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||||
</refmeta>
|
</refmeta>
|
||||||
<refnamediv>
|
<refnamediv>
|
||||||
<refname>
|
<refname>
|
||||||
ROLLBACK
|
ROLLBACK
|
||||||
</refname>
|
</refname>
|
||||||
<refpurpose>
|
<refpurpose>
|
||||||
Aborts the current transaction
|
Aborts the current transaction
|
||||||
|
@ -44,9 +44,9 @@ ROLLBACK [ WORK | TRANSACTION ]
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><computeroutput>
|
||||||
ABORT
|
ABORT
|
||||||
</term>
|
</computeroutput></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Message returned if successful.
|
Message returned if successful.
|
||||||
|
@ -55,10 +55,10 @@ ROLLBACK [ WORK | TRANSACTION ]
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term>
|
<term><computeroutput>
|
||||||
NOTICE: UserAbortTransactionBlock and not in in-progress state
|
NOTICE: UserAbortTransactionBlock and not in in-progress state
|
||||||
ABORT
|
ABORT
|
||||||
</term>
|
</computeroutput></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
If there is not any transaction currently in progress.
|
If there is not any transaction currently in progress.
|
||||||
|
@ -106,10 +106,10 @@ ROLLBACK [ WORK | TRANSACTION ]
|
||||||
Usage
|
Usage
|
||||||
</title>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
|
To abort all changes:
|
||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
--To abort all changes:
|
ROLLBACK WORK;
|
||||||
--
|
|
||||||
ROLLBACK WORK;
|
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
@ -129,7 +129,7 @@ ROLLBACK [ WORK | TRANSACTION ]
|
||||||
SQL92
|
SQL92
|
||||||
</title>
|
</title>
|
||||||
<para>
|
<para>
|
||||||
Full compatibility. TRANSACTION is a
|
Full compatibility. The TRANSACTION keyword is a
|
||||||
<productname>Postgres</productname> extension.
|
<productname>Postgres</productname> extension.
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
|
|
Loading…
Reference in New Issue