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">
|
||||
<REFMETA>
|
||||
<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>
|
||||
<refentry id="SQL-ABORT">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
ABORT
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</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 [ 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>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
NOTICE: UserAbortTransactionBlock and not in in-progress state
|
||||
ABORT
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
If there is not any transaction currently in progress.
|
||||
</para>
|
||||
</listitem>
|
||||
</VARLISTENTRY>
|
||||
</VARIABLELIST>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-ABORT-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-09-27</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
<refsect1 id="R1-SQL-ABORT-1">
|
||||
<refsect1info>
|
||||
<date>1998-09-27</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</title>
|
||||
<para>
|
||||
<command>ABORT</command> rolls back the current transaction and causes
|
||||
all the updates made by the transaction to be discarded.
|
||||
This command is identical
|
||||
in behavior to the <acronym>SQL92</acronym> command <command>ROLLBACK</command>,
|
||||
and is present only for historical reasons.
|
||||
</para>
|
||||
<REFSECT2 ID="R2-SQL-ABORT-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-27</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
Notes
|
||||
</TITLE>
|
||||
<para>
|
||||
Use the <command>COMMIT</command> statement to successfully
|
||||
This command is identical
|
||||
in behavior to the <acronym>SQL92</acronym> command <command>ROLLBACK</command>,
|
||||
and is present only for historical reasons.
|
||||
</para>
|
||||
<refsect2 id="R2-SQL-ABORT-3">
|
||||
<refsect2info>
|
||||
<date>1998-09-27</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</title>
|
||||
<para>
|
||||
Use <command>COMMIT</command> to successfully
|
||||
terminate a transaction.
|
||||
</para>
|
||||
</refsect2>
|
||||
</REFSECT1>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-ABORT-2">
|
||||
<TITLE>
|
||||
Usage
|
||||
</TITLE>
|
||||
<PARA>
|
||||
<ProgramListing>
|
||||
--To abort all changes
|
||||
--
|
||||
<refsect1 id="R1-SQL-ABORT-2">
|
||||
<title>
|
||||
Usage
|
||||
</title>
|
||||
<para>
|
||||
To abort all changes:
|
||||
<programlisting>
|
||||
ABORT WORK;
|
||||
</ProgramListing>
|
||||
</para>
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
</REFSECT1>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-ABORT-3">
|
||||
<TITLE>
|
||||
Compatibility
|
||||
</TITLE>
|
||||
<refsect1 id="R1-SQL-ABORT-3">
|
||||
<title>
|
||||
Compatibility
|
||||
</title>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-ABORT-4">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-27</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
SQL92
|
||||
</TITLE>
|
||||
<para>
|
||||
This command is a <productname>Postgres</productname> extension present
|
||||
for historical reasons. <command>ROLLBACK</command> is the <acronym>SQL92</acronym>
|
||||
equivalent command.
|
||||
</PARA>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
<refsect2 id="R2-SQL-ABORT-4">
|
||||
<refsect2info>
|
||||
<date>1998-09-27</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
SQL92
|
||||
</title>
|
||||
<para>
|
||||
This command is a <productname>Postgres</productname> extension present
|
||||
for historical reasons. <command>ROLLBACK</command> is the <acronym>SQL92</acronym>
|
||||
equivalent command.
|
||||
</para>
|
||||
</refsect2>
|
||||
</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">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
ALTER TABLE
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
ALTER TABLE
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
Modifies table properties
|
||||
</REFPURPOSE>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
ALTER TABLE <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>
|
||||
[ * ] ADD [ COLUMN ] <REPLACEABLE CLASS="PARAMETER">column</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">type</REPLACEABLE>
|
||||
ALTER TABLE <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>
|
||||
[ * ] RENAME [ COLUMN ] <REPLACEABLE CLASS="PARAMETER">column</REPLACEABLE> TO <REPLACEABLE CLASS="PARAMETER">newcolumn</REPLACEABLE>
|
||||
ALTER TABLE <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>
|
||||
RENAME TO <REPLACEABLE CLASS="PARAMETER">newtable</REPLACEABLE>
|
||||
</SYNOPSIS>
|
||||
<refentry id="SQL-ALTERTABLE">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
ALTER TABLE
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
ALTER TABLE
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Modifies table properties
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-04-15</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
|
||||
[ * ] ADD [ COLUMN ] <replaceable class="PARAMETER">ER">co</replaceable>BLE> <replaceable
|
||||
class="PARAMETER">type</replaceable>
|
||||
ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
|
||||
[ * ] RENAME [ COLUMN ] <replaceable class="PARAMETER">ER">co</replaceable>BLE> TO <replaceable
|
||||
class="PARAMETER">newcolumn</replaceable>
|
||||
ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
|
||||
RENAME TO <replaceable class="PARAMETER">newtable</replaceable>
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-ALTERTABLE-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<REPLACEABLE CLASS="PARAMETER"> table </REPLACEABLE>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<refsect2 id="R2-SQL-ALTERTABLE-1">
|
||||
<refsect2info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</title>
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><replaceable class="PARAMETER"> table </replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of an existing table to alter.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<REPLACEABLE CLASS="PARAMETER"> column </REPLACEABLE>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<varlistentry>
|
||||
<term><replaceable class="PARAMETER"> column </replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Name of a new or existing column.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<REPLACEABLE CLASS="PARAMETER"> type </REPLACEABLE>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<varlistentry>
|
||||
<term><replaceable class="PARAMETER"> type </replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Type of the new column.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<REPLACEABLE CLASS="PARAMETER"> newcolumn </REPLACEABLE>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<varlistentry>
|
||||
<term><replaceable class="PARAMETER"> newcolumn </replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
New name for an existing column.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<REPLACEABLE CLASS="PARAMETER"> newtable </REPLACEABLE>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<varlistentry>
|
||||
<term><replaceable class="PARAMETER"> newtable </replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
New name for an existing column.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</VARIABLELIST>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-ALTERTABLE-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
Outputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
<refsect2 id="R2-SQL-ALTERTABLE-2">
|
||||
<refsect2info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<returnvalue>ALTER</returnvalue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
ALTER
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Message returned from column or table renaming.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<returnvalue>NEW</returnvalue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
NEW
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Message returned from column addition.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<ReturnValue>ERROR</ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
ERROR
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Message returned if table or column is not available.
|
||||
</para>
|
||||
</listitem>
|
||||
</VARLISTENTRY>
|
||||
</VARIABLELIST>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-ALTERTABLE-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
<refsect1 id="R1-SQL-ALTERTABLE-1">
|
||||
<refsect1info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</title>
|
||||
<para>
|
||||
<command>ALTER TABLE</command> changes the definition of an existing table.
|
||||
The new columns and their types are specified in the same style
|
||||
and with the the same restrictions as in <command>CREATE TABLE</command>.
|
||||
|
@ -156,99 +148,102 @@ Description
|
|||
the affected table. Thus, the table or column will
|
||||
remain of the same type and size after this command is
|
||||
executed.
|
||||
</para>
|
||||
<PARA>
|
||||
You must own the table in order to change its schema.
|
||||
</PARA>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-ALTERTABLE-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
Notes
|
||||
</TITLE>
|
||||
<PARA>
|
||||
The keyword COLUMN is noise and can be omitted.
|
||||
</para>
|
||||
<PARA>
|
||||
<Quote>[*]</Quote> following a name of a table indicates that statement
|
||||
<para>
|
||||
You must own the table in order to change its schema.
|
||||
</para>
|
||||
|
||||
<refsect2 id="R2-SQL-ALTERTABLE-3">
|
||||
<refsect2info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</title>
|
||||
<para>
|
||||
The keyword <literal>COLUMN</literal> is noise and can be omitted.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<quote>[*]</quote> following a name of a table indicates that statement
|
||||
should be run over that table and all tables below it in the
|
||||
inheritance hierarchy.
|
||||
The <citetitle>PostgreSQL User's Guide</citetitle> has further
|
||||
information on inheritance.
|
||||
</para>
|
||||
</para>
|
||||
|
||||
<PARA>
|
||||
Refer to CREATE TABLE for a further description
|
||||
<para>
|
||||
Refer to <command>CREATE TABLE</command> for a further description
|
||||
of valid arguments.
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</REFSECT1>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-ALTERTABLE-2">
|
||||
<TITLE>
|
||||
Usage
|
||||
</TITLE>
|
||||
<PARA>
|
||||
<refsect1 id="R1-SQL-ALTERTABLE-2">
|
||||
<title>
|
||||
Usage
|
||||
</title>
|
||||
<para>
|
||||
To add a column of type VARCHAR to a table:
|
||||
<ProgramListing>
|
||||
ALTER TABLE distributors ADD COLUMN address VARCHAR(30);
|
||||
</ProgramListing>
|
||||
</para>
|
||||
<programlisting>
|
||||
ALTER TABLE distributors ADD COLUMN address VARCHAR(30);
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<PARA>
|
||||
<para>
|
||||
To rename an existing column:
|
||||
<ProgramListing>
|
||||
ALTER TABLE distributors RENAME COLUMN address TO city;
|
||||
</ProgramListing>
|
||||
</para>
|
||||
<programlisting>
|
||||
ALTER TABLE distributors RENAME COLUMN address TO city;
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<PARA>
|
||||
<para>
|
||||
To rename an existing table:
|
||||
<ProgramListing>
|
||||
ALTER TABLE distributors RENAME TO suppliers;
|
||||
</ProgramListing>
|
||||
</para>
|
||||
<programlisting>
|
||||
ALTER TABLE distributors RENAME TO suppliers;
|
||||
</programlisting>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</REFSECT1>
|
||||
<refsect1 id="R1-SQL-ALTERTABLE-3">
|
||||
<title>
|
||||
Compatibility
|
||||
</title>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-ALTERTABLE-3">
|
||||
<TITLE>
|
||||
Compatibility
|
||||
</TITLE>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-ALTERTABLE-4">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
SQL92
|
||||
</TITLE>
|
||||
<PARA>
|
||||
<command>ALTER TABLE/RENAME</command>
|
||||
<refsect2 id="R2-SQL-ALTERTABLE-4">
|
||||
<refsect2info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
SQL92
|
||||
</title>
|
||||
<para>
|
||||
<command>ALTER TABLE/RENAME</command>
|
||||
is a <productname>Postgres</productname> language extension.
|
||||
</para>
|
||||
</para>
|
||||
|
||||
<PARA>
|
||||
<para>
|
||||
SQL92 specifies some additional capabilities for <command>ALTER TABLE</command>
|
||||
statement which are not yet directly supported by
|
||||
<ProductName>Postgres</ProductName>:
|
||||
</para>
|
||||
<productname>Postgres</productname>:
|
||||
</para>
|
||||
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<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>
|
||||
ADD [ CONSTRAINT <REPLACEABLE CLASS="PARAMETER">constraint</REPLACEABLE> ] <REPLACEABLE CLASS="PARAMETER">table-constraint</REPLACEABLE>
|
||||
</Synopsis>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<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>
|
||||
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
|
||||
|
@ -257,13 +252,13 @@ ALTER TABLE <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> ALTER [ COLUMN ]
|
|||
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>
|
||||
|
||||
<PARA>
|
||||
Currently, to set new default constraints on an existing column
|
||||
<para>
|
||||
Currently, to set new default constraints on an existing column
|
||||
the table must be recreated and reloaded:
|
||||
|
||||
<ProgramListing>
|
||||
<programlisting>
|
||||
CREATE TABLE temp AS SELECT * FROM distributors;
|
||||
DROP TABLE distributors;
|
||||
CREATE TABLE distributors (
|
||||
|
@ -273,65 +268,65 @@ CREATE TABLE distributors (
|
|||
);
|
||||
INSERT INTO distributors SELECT * FROM temp;
|
||||
DROP TABLE temp;
|
||||
</ProgramListing>
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</programlisting>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<Synopsis>
|
||||
ALTER TABLE <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>
|
||||
DROP DEFAULT <REPLACEABLE CLASS="PARAMETER">default</REPLACEABLE>
|
||||
ALTER TABLE <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>
|
||||
DROP CONSTRAINT <REPLACEABLE CLASS="PARAMETER">constraint</REPLACEABLE> { RESTRICT | CASCADE }
|
||||
</Synopsis>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<synopsis>
|
||||
ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
|
||||
DROP DEFAULT <replaceable class="PARAMETER">default</replaceable>
|
||||
ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
|
||||
DROP CONSTRAINT <replaceable class="PARAMETER">constraint</replaceable> { RESTRICT | CASCADE }
|
||||
</synopsis>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Removes the default value specified by default or the rule
|
||||
specified by constraint from the definition of a table.
|
||||
If RESTRICT is specified only a constraint with no dependent
|
||||
constraints can be destroyed.
|
||||
If CASCADE is specified, Any constraints that are dependent on
|
||||
this constraint are also dropped.
|
||||
</para>
|
||||
</para>
|
||||
|
||||
<PARA>
|
||||
Currently, to remove a default value or constraints on an
|
||||
<para>
|
||||
Currently, to remove a default value or constraints on an
|
||||
existing column the table must be recreated and reloaded:
|
||||
|
||||
<ProgramListing>
|
||||
<programlisting>
|
||||
CREATE TABLE temp AS SELECT * FROM distributors;
|
||||
DROP TABLE distributors;
|
||||
CREATE TABLE distributors AS SELECT * FROM temp;
|
||||
DROP TABLE temp;
|
||||
</ProgramListing>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</programlisting>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<Synopsis>
|
||||
ALTER TABLE <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>
|
||||
DROP [ COLUMN ] <REPLACEABLE CLASS="PARAMETER">column</REPLACEABLE> { RESTRICT | CASCADE }
|
||||
</Synopsis>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<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>
|
||||
|
||||
<PARA>
|
||||
Currently, to remove an existing column the table must be
|
||||
<para>
|
||||
Currently, to remove an existing column the table must be
|
||||
recreated and reloaded:
|
||||
|
||||
<ProgramListing>
|
||||
<programlisting>
|
||||
CREATE TABLE temp AS SELECT did, city FROM distributors;
|
||||
DROP TABLE distributors;
|
||||
CREATE TABLE distributors (
|
||||
|
@ -340,11 +335,28 @@ CREATE TABLE distributors (
|
|||
);
|
||||
INSERT INTO distributors SELECT * FROM temp;
|
||||
DROP TABLE temp;
|
||||
</ProgramListing>
|
||||
</PARA>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</VARIABLELIST>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
</REFENTRY>
|
||||
</programlisting>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</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,4 +1,4 @@
|
|||
<refentry id="SQL-ALTERUSER">
|
||||
<refentry id="SQL-ALTERUSER">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
ALTER USER
|
||||
|
@ -18,10 +18,8 @@
|
|||
<date>1998-09-08</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
ALTER USER <replaceable class="PARAMETER">username</replaceable>
|
||||
[ WITH PASSWORD <replaceable class="PARAMETER">password</replaceable> ]
|
||||
[ CREATEDB | NOCREATEDB ]
|
||||
[ CREATEUSER | NOCREATEUSER ]
|
||||
ALTER USER <replaceable class="PARAMETER">username</replaceable> [ WITH PASSWORD <replaceable class="PARAMETER">password</replaceable> ]
|
||||
[ CREATEDB | NOCREATEDB ] [ CREATEUSER | NOCREATEUSER ]
|
||||
[ IN GROUP <replaceable class="PARAMETER">groupname</replaceable> [, ...] ]
|
||||
[ VALID UNTIL '<replaceable class="PARAMETER">abstime</replaceable>' ]
|
||||
</synopsis>
|
||||
|
@ -33,15 +31,16 @@ ALTER USER <replaceable class="PARAMETER">username</replaceable>
|
|||
<title>
|
||||
Inputs
|
||||
</title>
|
||||
|
||||
<para>
|
||||
Refer to <command>CREATE USER</command> for a detailed description of each
|
||||
clause.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<replaceable class="PARAMETER"> username </replaceable>
|
||||
</term>
|
||||
<term><replaceable class="PARAMETER"> username </replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The Postgres account name of the user whose details are to be altered.
|
||||
|
@ -50,9 +49,7 @@ ALTER USER <replaceable class="PARAMETER">username</replaceable>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<replaceable class="PARAMETER"> password </replaceable>
|
||||
</term>
|
||||
<term><replaceable class="PARAMETER"> password </replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The new password to be used for this account.
|
||||
|
@ -61,9 +58,7 @@ ALTER USER <replaceable class="PARAMETER">username</replaceable>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<replaceable class="PARAMETER"> groupname </replaceable>
|
||||
</term>
|
||||
<term><replaceable class="PARAMETER"> groupname </replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of an access group into which this account is to be put.
|
||||
|
@ -72,9 +67,7 @@ ALTER USER <replaceable class="PARAMETER">username</replaceable>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<replaceable class="PARAMETER"> abstime </replaceable>
|
||||
</term>
|
||||
<term><replaceable class="PARAMETER"> abstime </replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The date (and, optionally, the time)
|
||||
|
@ -83,6 +76,7 @@ ALTER USER <replaceable class="PARAMETER">username</replaceable>
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<refsect2 id="R2-SQL-ALTERUSER-2">
|
||||
|
@ -95,9 +89,9 @@ ALTER USER <replaceable class="PARAMETER">username</replaceable>
|
|||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<returnvalue>ALTER USER</returnvalue>
|
||||
</term>
|
||||
<term><computeroutput>
|
||||
ALTER USER
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Message returned if the alteration was successful.
|
||||
|
@ -106,13 +100,13 @@ ALTER USER <replaceable class="PARAMETER">username</replaceable>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<returnvalue>ERROR: alterUser: user "username" does not exist</returnvalue>
|
||||
</term>
|
||||
<term><computeroutput>
|
||||
ERROR: alterUser: user "username" does not exist
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Error message returned if the user specified doesn't
|
||||
exist.
|
||||
Error message returned if the specified user is not known to
|
||||
the database.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -136,8 +130,9 @@ ALTER USER <replaceable class="PARAMETER">username</replaceable>
|
|||
statement. Also, it is only possible for the
|
||||
<productname>Postgres</productname>
|
||||
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>
|
||||
If any of the clauses of the alter user statement are
|
||||
omitted, the corresponding value in the "pg_shadow" table
|
||||
|
@ -152,14 +147,13 @@ ALTER USER <replaceable class="PARAMETER">username</replaceable>
|
|||
Notes
|
||||
</title>
|
||||
<para>
|
||||
<command>ALTER USER</command> statement
|
||||
<command>ALTER USER</command>
|
||||
is a <productname>Postgres</productname>
|
||||
language extension.
|
||||
</para>
|
||||
<para>
|
||||
Refer to <command>CREATE/DROP USER</command>
|
||||
to create or remove a user
|
||||
account.
|
||||
to create or remove a user account.
|
||||
</para>
|
||||
<para>
|
||||
In the current release (v6.5), the IN GROUP clause is parsed
|
||||
|
@ -174,37 +168,37 @@ ALTER USER <replaceable class="PARAMETER">username</replaceable>
|
|||
Usage
|
||||
</title>
|
||||
<para>
|
||||
Change a user password
|
||||
</para>
|
||||
Change a user password:
|
||||
|
||||
<programlisting>
|
||||
ALTER USER davide WITH PASSWORD hu8jmn3;
|
||||
</programlisting>
|
||||
<para>
|
||||
|
||||
Change a user's valid until date
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
ALTER USER manuel VALID UNTIL 'Jan 31 2030';
|
||||
</programlisting>
|
||||
<para>
|
||||
|
||||
Change a user's valid until date, specifying that his
|
||||
authorisation should expire at midday on 4th May 1998 using
|
||||
the time zone which is one hour ahead of UTC
|
||||
</para>
|
||||
authorisation should expire at midday on 4th May 1998 using
|
||||
the time zone which is one hour ahead of UTC
|
||||
<programlisting>
|
||||
ALTER USER chris VALID UNTIL 'May 4 12:00:00 1998 +1';
|
||||
</programlisting>
|
||||
<para>
|
||||
|
||||
Give a user the ability to create other users and new databases.
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
ALTER USER miriam CREATEUSER CREATEDB;
|
||||
</programlisting>
|
||||
<para>
|
||||
|
||||
Place a user in two groups
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
ALTER USER miriam IN GROUP sales, payroll;
|
||||
</programlisting>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id="R1-SQL-ALTERUSER-3">
|
||||
|
@ -229,7 +223,7 @@ ALTER USER miriam IN GROUP sales, payroll;
|
|||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
|
|
@ -30,7 +30,7 @@ BEGIN [ WORK | TRANSACTION ]
|
|||
Inputs
|
||||
</title>
|
||||
<para>
|
||||
None
|
||||
None.
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
|
@ -45,9 +45,9 @@ BEGIN [ WORK | TRANSACTION ]
|
|||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<returnvalue>BEGIN</returnvalue>
|
||||
</term>
|
||||
<term><computeroutput>
|
||||
BEGIN
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
This signifies that a new transaction has been started.
|
||||
|
@ -55,9 +55,9 @@ BEGIN [ WORK | TRANSACTION ]
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<returnvalue>NOTICE: BeginTransactionBlock and not in default state</returnvalue>
|
||||
</term>
|
||||
<term><computeroutput>
|
||||
NOTICE: BeginTransactionBlock and not in default state
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
This indicates that a transaction was already in progress.
|
||||
|
|
|
@ -1,153 +1,152 @@
|
|||
<REFENTRY ID="SQL-CLOSE">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<refentry id="SQL-CLOSE">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
CLOSE
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
CLOSE
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Close a cursor
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-09-08</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
CLOSE <REPLACEABLE CLASS="PARAMETER">cursor</REPLACEABLE>
|
||||
</SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-09-08</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
CLOSE <replaceable class="PARAMETER">cursor</replaceable>
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CLOSE-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-08</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CLOSE-1">
|
||||
<refsect2info>
|
||||
<date>1998-09-08</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<REPLACEABLE CLASS="PARAMETER">cursor</REPLACEABLE>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><replaceable class="PARAMETER">cursor</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of an open cursor to close.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CLOSE-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-08</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<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>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
CLOSE
|
||||
</computeroutput></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>
|
||||
</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
|
||||
<replaceable class="PARAMETER">cursor</replaceable> is not
|
||||
declared or has already been closed.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</VARIABLELIST>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CLOSE-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-09-08</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CLOSE-1">
|
||||
<refsect1info>
|
||||
<date>1998-09-08</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<command>CLOSE</command> frees the resources associated with an open cursor.
|
||||
After the cursor is closed, no subsequent operations
|
||||
are allowed on it. A cursor should be closed when it is
|
||||
no longer needed.
|
||||
</PARA>
|
||||
<PARA>
|
||||
</para>
|
||||
<para>
|
||||
An implicit close is executed for every open cursor when a
|
||||
transaction is terminated by <command>COMMIT</command>
|
||||
or <command>ROLLBACK</command>.
|
||||
</PARA>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CLOSE-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-08</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CLOSE-3">
|
||||
<refsect2info>
|
||||
<date>1998-09-08</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
<PARA>
|
||||
<productname>Postgres</productname> does not have
|
||||
</title>
|
||||
<para>
|
||||
<productname>Postgres</productname> does not have
|
||||
an explicit <command>OPEN</command> cursor statement;
|
||||
a cursor is considered open when it is declared.
|
||||
Use the <command>DECLARE</command> statement to declare a cursor.
|
||||
</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>
|
||||
</para>
|
||||
</refsect2>
|
||||
</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
|
||||
Local variables:
|
||||
|
|
|
@ -1,128 +1,122 @@
|
|||
<REFENTRY ID="SQL-CLUSTER">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<refentry id="SQL-CLUSTER">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
CLUSTER
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
CLUSTER
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Gives storage clustering advice to the backend
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-09-08</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
CLUSTER <REPLACEABLE CLASS="PARAMETER">indexname</REPLACEABLE> ON <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>
|
||||
</SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-09-08</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
CLUSTER <replaceable class="PARAMETER">indexname</replaceable> ON <replaceable class="PARAMETER">table</replaceable>
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CLUSTER-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-08</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<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>
|
||||
</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>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><replaceable class="PARAMETER">table</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of a table.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</VARIABLELIST>
|
||||
</REFSECT2>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CLUSTER-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-08</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<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>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
CLUSTER
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The clustering was done successfully.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
ERROR: relation <<replaceable class="PARAMETER">tablerelation_number</replaceable>> inherits "invoice"
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<comment>
|
||||
This is not documented anywhere. It seems not to be possible to
|
||||
cluster a table that is inherited.
|
||||
</comment>
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<returnvalue>ERROR: Relation x does not exist!</returnvalue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
ERROR: Relation x does not exist!
|
||||
</computeroutput></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>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CLUSTER-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-09-08</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CLUSTER-1">
|
||||
<refsect1info>
|
||||
<date>1998-09-08</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<command>CLUSTER</command> instructs <productname>Postgres</productname>
|
||||
to cluster the class specified
|
||||
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>
|
||||
<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.
|
||||
|
@ -132,13 +126,13 @@ to cluster the class specified
|
|||
recluster manually by issuing the command again.
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CLUSTER-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-08</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CLUSTER-3">
|
||||
<refsect2info>
|
||||
<date>1998-09-08</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
</title>
|
||||
|
||||
<para>
|
||||
The table is actually copied to a temporary table in index
|
||||
|
@ -179,13 +173,13 @@ to cluster the class specified
|
|||
|
||||
<para>
|
||||
Another way to cluster data is to use
|
||||
<programlisting>
|
||||
<programlisting>
|
||||
SELECT ... INTO TABLE <replaceable class="parameter">temp</replaceable> FROM ... ORDER BY ...
|
||||
</programlisting>
|
||||
</programlisting>
|
||||
This uses the <productname>Postgres</productname> sorting code in
|
||||
ORDER BY to match the index, and is much faster for
|
||||
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
|
||||
recreate any indexes. The only problem is that <acronym>OID</acronym>s
|
||||
will not be preserved. From then on, <command>CLUSTER</command> should be
|
||||
|
@ -195,44 +189,43 @@ SELECT ... INTO TABLE <replaceable class="parameter">temp</replaceable> FROM ...
|
|||
</refsect2>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CLUSTER-2">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CLUSTER-2">
|
||||
<title>
|
||||
Usage
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
Cluster the employees relation on the basis of its salary attribute
|
||||
</PARA>
|
||||
<ProgramListing>
|
||||
CLUSTER emp_ind ON emp
|
||||
</ProgramListing>
|
||||
</REFSECT1>
|
||||
</para>
|
||||
<programlisting>
|
||||
CLUSTER emp_ind ON emp;
|
||||
</programlisting>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CLUSTER-3">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CLUSTER-3">
|
||||
<title>
|
||||
Compatibility
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
</title>
|
||||
<para>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CLUSTER-4">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-08</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CLUSTER-4">
|
||||
<refsect2info>
|
||||
<date>1998-09-08</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
SQL92
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
There is no <command>CLUSTER</command> statement in SQL92.
|
||||
</PARA>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
</REFENTRY>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
|
|
|
@ -30,7 +30,7 @@ COMMIT [ WORK | TRANSACTION ]
|
|||
Inputs
|
||||
</title>
|
||||
<para>
|
||||
None
|
||||
None.
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
|
@ -45,9 +45,9 @@ COMMIT [ WORK | TRANSACTION ]
|
|||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<returnvalue>END</returnvalue>
|
||||
</term>
|
||||
<term><computeroutput>
|
||||
END
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Message returned if the transaction is successfully committed.
|
||||
|
@ -55,9 +55,9 @@ COMMIT [ WORK | TRANSACTION ]
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<returnvalue>NOTICE EndTransactionBlock and not inprogress/abort state</returnvalue>
|
||||
</term>
|
||||
<term><computeroutput>
|
||||
NOTICE EndTransactionBlock and not inprogress/abort state
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
If there is no transaction in progress.
|
||||
|
|
|
@ -1,157 +1,146 @@
|
|||
<REFENTRY ID="SQL-COPY">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<refentry id="SQL-COPY">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
COPY
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
COPY
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Copies data between files and tables
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-09-08</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-09-08</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
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>' ]
|
||||
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>' ]
|
||||
</SYNOPSIS>
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-COPY-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-08</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-COPY-1">
|
||||
<refsect2info>
|
||||
<date>1998-09-08</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
BINARY
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>BINARY</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Changes the behavior of field formatting, forcing all data to be
|
||||
stored or read as binary objects rather than as text.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<replaceable class="parameter">table</replaceable>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
The name of an existing table.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
WITH OIDS
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
Copies the internal unique object id (OID) for each row.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<replaceable class="parameter">filename</replaceable>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
The absolute Unix pathname of the input or output file.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<filename>stdin</filename>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
Specifies that input comes from a pipe or terminal.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<filename>stdout</filename>
|
||||
</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>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><replaceable class="parameter">table</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of an existing table.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>WITH OIDS</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Copies the internal unique object id (OID) for each row.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><replaceable class="parameter">filename</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The absolute Unix pathname of the input or output file.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><filename>stdin</filename></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies that input comes from a pipe or terminal.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><filename>stdout</filename></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.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-COPY-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-08</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-COPY-2">
|
||||
<refsect2info>
|
||||
<date>1998-09-08</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<ReturnValue>COPY</ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
COPY
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The copy completed successfully.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<ReturnValue>ERROR: <replaceable>error message</replaceable></ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
ERROR: <replaceable>error message</replaceable>
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The copy failed for the reason stated in the error message.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</VARIABLELIST>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-COPY-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-09-08</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-COPY-1">
|
||||
<refsect1info>
|
||||
<date>1998-09-08</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
</title>
|
||||
<para>
|
||||
<command>COPY</command> moves data between
|
||||
<productname>Postgres</productname> tables and
|
||||
|
@ -161,16 +150,17 @@ Specifies that output goes to a pipe or terminal.
|
|||
the <productname>Postgres</productname> backend
|
||||
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.
|
||||
If <filename>stdin</filename> or <filename>stdout</filename> are specified, data flows through the client frontend to
|
||||
the backend.
|
||||
If <filename>stdin</filename> or <filename>stdout</filename> are
|
||||
specified, data flows through the client frontend to the backend.
|
||||
</para>
|
||||
<REFSECT2 ID="R2-SQL-COPY-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-08</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
|
||||
<refsect2 id="R2-SQL-COPY-3">
|
||||
<refsect2info>
|
||||
<date>1998-09-08</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
</title>
|
||||
<para>
|
||||
The BINARY keyword will force all data to be
|
||||
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
|
||||
or written by <command>COPY</command>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The keyword phrase USING DELIMITERS specifies a single character
|
||||
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>
|
||||
</tip>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 ID="R1-SQL-COPY-2">
|
||||
<refsect1 id="R1-SQL-COPY-2">
|
||||
<refsect1info>
|
||||
<date>1998-05-04</date>
|
||||
</refsect1info>
|
||||
|
@ -231,7 +222,7 @@ Specifies that output goes to a pipe or terminal.
|
|||
The actual format for each instance is
|
||||
<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>
|
||||
</programlisting>
|
||||
</programlisting>
|
||||
The oid is placed on the beginning of the line
|
||||
if WITH OIDS is specified.
|
||||
</para>
|
||||
|
@ -279,20 +270,20 @@ Specifies that output goes to a pipe or terminal.
|
|||
</para>
|
||||
<table frame="all">
|
||||
<title>Contents of a binary copy file</title>
|
||||
<tgroup cols="2"colsep="1" rowsep="1" align="center">
|
||||
<COLSPEC COLNAME="col1">
|
||||
<COLSPEC COLNAME="col2">
|
||||
<tgroup cols="2" colsep="1" rowsep="1" align="center">
|
||||
<colspec colname="col1">
|
||||
<colspec colname="col2">
|
||||
<spanspec namest="col1" nameend="col2" spanname="subhead">
|
||||
<tbody>
|
||||
<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>
|
||||
<entry>uint32</entry>
|
||||
<entry>number of tuples</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align="center" spanname="subhead">For each tuple</entry>
|
||||
<entry spanname="subhead" align="center">For each tuple</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>uint32</entry>
|
||||
|
@ -337,30 +328,30 @@ Specifies that output goes to a pipe or terminal.
|
|||
</refsect1>
|
||||
|
||||
|
||||
<REFSECT1 ID="R1-SQL-COPY-3">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-COPY-3">
|
||||
<title>
|
||||
Usage
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
The following example copies a table to standard output,
|
||||
using a vertical bar ("|") as the field
|
||||
delimiter:
|
||||
</PARA>
|
||||
<ProgramListing>
|
||||
</para>
|
||||
<programlisting>
|
||||
COPY country TO <filename>stdout</filename> USING DELIMITERS '|';
|
||||
</ProgramListing>
|
||||
<PARA>
|
||||
</programlisting>
|
||||
<para>
|
||||
To copy data from a Unix file into a table "country":
|
||||
</PARA>
|
||||
<ProgramListing>
|
||||
</para>
|
||||
<programlisting>
|
||||
COPY country FROM '/usr1/proj/bray/sql/country_data';
|
||||
</ProgramListing>
|
||||
<PARA>
|
||||
</programlisting>
|
||||
<para>
|
||||
Here is a sample of data suitable for copying into a table
|
||||
from <filename>stdin</filename> (so it
|
||||
has the termination sequence on the last line):
|
||||
</PARA>
|
||||
<ProgramListing>
|
||||
</para>
|
||||
<programlisting>
|
||||
AF AFGHANISTAN
|
||||
AL ALBANIA
|
||||
DZ ALGERIA
|
||||
|
@ -368,8 +359,8 @@ has the termination sequence on the last line):
|
|||
ZM ZAMBIA
|
||||
ZW ZIMBABWE
|
||||
\.
|
||||
</ProgramListing>
|
||||
<PARA>
|
||||
</programlisting>
|
||||
<para>
|
||||
The same data, output in binary format on a Linux/i586 machine.
|
||||
The data is shown after filtering through
|
||||
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>
|
||||
field is padded with nulls to four bytes and the text field is
|
||||
preceded by its length:
|
||||
</PARA>
|
||||
<ProgramListing>
|
||||
</para>
|
||||
<programlisting>
|
||||
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
|
||||
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
|
||||
\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
|
||||
</ProgramListing>
|
||||
</programlisting>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 ID="R1-SQL-COPY-5">
|
||||
<refsect1 id="R1-SQL-COPY-5">
|
||||
<title>Bugs and features</title>
|
||||
<para>
|
||||
<command>COPY</command> neither invokes rules nor acts on column defaults.
|
||||
|
@ -435,31 +426,31 @@ must reside on or be
|
|||
</para>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-COPY-6">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-COPY-6">
|
||||
<title>
|
||||
Compatibility
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
</title>
|
||||
<para>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-COPY-4">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-08</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-COPY-4">
|
||||
<refsect2info>
|
||||
<date>1998-09-08</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
SQL92
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
There is no <command>COPY</command> statement in SQL92.
|
||||
</PARA>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
</REFENTRY>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
|
|
|
@ -1,193 +1,175 @@
|
|||
<REFENTRY ID="SQL-CREATEAGGREGATE">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<refentry id="SQL-CREATEAGGREGATE">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
CREATE AGGREGATE
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
CREATE AGGREGATE
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Defines a new aggregate function
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-09-09</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
CREATE AGGREGATE <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE> [ AS ]
|
||||
( BASETYPE = <REPLACEABLE CLASS="PARAMETER">data_type</REPLACEABLE>
|
||||
[ , SFUNC1 = <REPLACEABLE CLASS="PARAMETER">sfunc1</REPLACEABLE>
|
||||
, STYPE1 = <REPLACEABLE CLASS="PARAMETER">sfunc1_return_type</REPLACEABLE> ]
|
||||
[ , SFUNC2 = <REPLACEABLE CLASS="PARAMETER">sfunc2</REPLACEABLE>
|
||||
, STYPE2 = <REPLACEABLE CLASS="PARAMETER">sfunc2_return_type</REPLACEABLE> ]
|
||||
[ , FINALFUNC = <REPLACEABLE CLASS="PARAMETER">ffunc</REPLACEABLE> ]
|
||||
[ , INITCOND1 = <REPLACEABLE CLASS="PARAMETER">initial_condition1</REPLACEABLE> ]
|
||||
[ , INITCOND2 = <REPLACEABLE CLASS="PARAMETER">initial_condition2</REPLACEABLE> ]
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-09-09</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
CREATE AGGREGATE <replaceable class="PARAMETER">name</replaceable> [ AS ]
|
||||
( BASETYPE = <replaceable class="PARAMETER">data_type</replaceable>
|
||||
[ , SFUNC1 = <replaceable class="PARAMETER">sfunc1</replaceable>
|
||||
, STYPE1 = <replaceable class="PARAMETER">sfunc1_return_type</replaceable> ]
|
||||
[ , SFUNC2 = <replaceable class="PARAMETER">sfunc2</replaceable>
|
||||
, STYPE2 = <replaceable class="PARAMETER">sfunc2_return_type</replaceable> ]
|
||||
[ , FINALFUNC = <replaceable class="PARAMETER">ffunc</replaceable> ]
|
||||
[ , INITCOND1 = <replaceable class="PARAMETER">initial_condition1</replaceable> ]
|
||||
[ , INITCOND2 = <replaceable class="PARAMETER">initial_condition2</replaceable> ]
|
||||
)
|
||||
</SYNOPSIS>
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATEAGGREGATE-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-09</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATEAGGREGATE-1">
|
||||
<refsect2info>
|
||||
<date>1998-09-09</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
</title>
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><replaceable class="PARAMETER">name</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of an aggregate function to create.
|
||||
</para>
|
||||
</LISTITEM>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<REPLACEABLE CLASS="PARAMETER">data_type</REPLACEABLE>
|
||||
</term>
|
||||
<term><replaceable class="PARAMETER">data_type</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The fundamental data type on which this aggregate function operates.
|
||||
The fundamental data type on which this aggregate function operates.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<REPLACEABLE CLASS="PARAMETER">sfunc1</REPLACEABLE>
|
||||
</term>
|
||||
<term><replaceable class="PARAMETER">sfunc1</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The state transition function
|
||||
The state transition function
|
||||
to be called for every non-NULL field from the source column.
|
||||
It takes a variable of
|
||||
type <REPLACEABLE CLASS="PARAMETER">sfunc1_return_type</REPLACEABLE> as
|
||||
the first argument and that field as the
|
||||
second argument.
|
||||
type <replaceable class="PARAMETER">sfunc1_return_type</replaceable> as
|
||||
the first argument and that field as the
|
||||
second argument.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<REPLACEABLE CLASS="PARAMETER">sfunc1_return_type</REPLACEABLE>
|
||||
</term>
|
||||
<term><replaceable class="PARAMETER">sfunc1_return_type</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The return type of the first transition function.
|
||||
The return type of the first transition function.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<REPLACEABLE CLASS="PARAMETER">sfunc2</REPLACEABLE>
|
||||
</term>
|
||||
<term><replaceable class="PARAMETER">sfunc2</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The state transition function
|
||||
The state transition function
|
||||
to be called for every non-NULL field from the source column.
|
||||
It takes a variable
|
||||
of type <REPLACEABLE CLASS="PARAMETER">sfunc2_return_type</REPLACEABLE>
|
||||
as the only argument and returns a variable of the same type.
|
||||
It takes a variable
|
||||
of type <replaceable class="PARAMETER">sfunc2_return_type</replaceable>
|
||||
as the only argument and returns a variable of the same type.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<REPLACEABLE CLASS="PARAMETER">sfunc2_return_type</REPLACEABLE>
|
||||
</term>
|
||||
<term><replaceable class="PARAMETER">sfunc2_return_type</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The return type of the second transition function.
|
||||
The return type of the second transition function.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<REPLACEABLE CLASS="PARAMETER">ffunc</REPLACEABLE>
|
||||
</term>
|
||||
<term><replaceable class="PARAMETER">ffunc</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The final function
|
||||
The final function
|
||||
called after traversing all input fields. This function must
|
||||
take two arguments of types
|
||||
<REPLACEABLE CLASS="PARAMETER">sfunc1_return_type</REPLACEABLE>
|
||||
and
|
||||
<REPLACEABLE CLASS="PARAMETER">sfunc2_return_type</REPLACEABLE>.
|
||||
take two arguments of types
|
||||
<replaceable class="PARAMETER">sfunc1_return_type</replaceable>
|
||||
and
|
||||
<replaceable class="PARAMETER">sfunc2_return_type</replaceable>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<REPLACEABLE CLASS="PARAMETER">initial_condition1</REPLACEABLE>
|
||||
</term>
|
||||
<term><replaceable class="PARAMETER">initial_condition1</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The initial value for the first transition function argument.
|
||||
The initial value for the first transition function argument.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<REPLACEABLE CLASS="PARAMETER">initial_condition2</REPLACEABLE>
|
||||
</term>
|
||||
<term><replaceable class="PARAMETER">initial_condition2</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The initial value for the second transition function argument.
|
||||
The initial value for the second transition function argument.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATEAGGREGATE-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-09</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATEAGGREGATE-2">
|
||||
<refsect2info>
|
||||
<date>1998-09-09</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<ReturnValue>CREATE</ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
CREATE
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Message returned if the command completes successfully.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</VARIABLELIST>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATEAGGREGATE-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-09-09</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATEAGGREGATE-1">
|
||||
<refsect1info>
|
||||
<date>1998-09-09</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
</title>
|
||||
<para>
|
||||
<command>CREATE AGGREGATE</command>
|
||||
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>
|
||||
can be used to provide the desired features.
|
||||
</para>
|
||||
<PARA>
|
||||
<para>
|
||||
An aggregate function can require up to three functions, two
|
||||
state transition functions,
|
||||
<REPLACEABLE CLASS="PARAMETER">sfunc1</REPLACEABLE>
|
||||
and <REPLACEABLE CLASS="PARAMETER">sfunc2</REPLACEABLE>:
|
||||
<replaceable class="PARAMETER">sfunc1</replaceable>
|
||||
and <replaceable class="PARAMETER">sfunc2</replaceable>:
|
||||
<programlisting>
|
||||
<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">sfunc1</replaceable>( internal-state1, next-data_item ) ---> next-internal-state1 <replaceable class="PARAMETER">sfunc2</replaceable>( internal-state2 ) ---> next-internal-state2
|
||||
</programlisting>
|
||||
and a final calculation function,
|
||||
<REPLACEABLE CLASS="PARAMETER">ffunc</REPLACEABLE>:
|
||||
<replaceable class="PARAMETER">ffunc</replaceable>:
|
||||
<programlisting>
|
||||
<REPLACEABLE CLASS="PARAMETER">ffunc</REPLACEABLE>(internal-state1, internal-state2) ---> aggregate-value
|
||||
<replaceable class="PARAMETER">ffunc</replaceable>(internal-state1, internal-state2) ---> aggregate-value
|
||||
</programlisting>
|
||||
</para>
|
||||
<para>
|
||||
<productname>Postgres</productname> creates up to two temporary variables
|
||||
(referred to here as <REPLACEABLE CLASS="PARAMETER">temp1</REPLACEABLE>
|
||||
and <REPLACEABLE CLASS="PARAMETER">temp2</REPLACEABLE>)
|
||||
(referred to here as <replaceable class="PARAMETER">temp1</replaceable>
|
||||
and <replaceable class="PARAMETER">temp2</replaceable>)
|
||||
to hold intermediate results used as arguments to the transition functions.
|
||||
</para>
|
||||
<para>
|
||||
|
@ -225,42 +206,42 @@ The initial value for the second transition function argument.
|
|||
<listitem>
|
||||
<para>
|
||||
The arguments to
|
||||
<REPLACEABLE CLASS="PARAMETER">sfunc1</REPLACEABLE>
|
||||
<replaceable class="PARAMETER">sfunc1</replaceable>
|
||||
must be
|
||||
<REPLACEABLE CLASS="PARAMETER">temp1</REPLACEABLE>
|
||||
<replaceable class="PARAMETER">temp1</replaceable>
|
||||
of type
|
||||
<REPLACEABLE CLASS="PARAMETER">sfunc1_return_type</REPLACEABLE>
|
||||
<replaceable class="PARAMETER">sfunc1_return_type</replaceable>
|
||||
and
|
||||
<REPLACEABLE CLASS="PARAMETER">column_value</REPLACEABLE>
|
||||
of type <REPLACEABLE CLASS="PARAMETER">data_type</REPLACEABLE>.
|
||||
<replaceable class="PARAMETER">column_value</replaceable>
|
||||
of type <replaceable class="PARAMETER">data_type</replaceable>.
|
||||
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
|
||||
<REPLACEABLE CLASS="PARAMETER">sfunc1</REPLACEABLE>.
|
||||
<replaceable class="PARAMETER">sfunc1</replaceable>.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
The argument and return value of
|
||||
<REPLACEABLE CLASS="PARAMETER">sfunc2</REPLACEABLE>
|
||||
<replaceable class="PARAMETER">sfunc2</replaceable>
|
||||
must be
|
||||
<REPLACEABLE CLASS="PARAMETER">temp2</REPLACEABLE>
|
||||
<replaceable class="PARAMETER">temp2</replaceable>
|
||||
of type
|
||||
<REPLACEABLE CLASS="PARAMETER">sfunc2_return_type</REPLACEABLE>.
|
||||
<replaceable class="PARAMETER">sfunc2_return_type</replaceable>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
The arguments to the final-calculation-function
|
||||
must be
|
||||
<REPLACEABLE CLASS="PARAMETER">temp1</REPLACEABLE>
|
||||
<replaceable class="PARAMETER">temp1</replaceable>
|
||||
and
|
||||
<REPLACEABLE CLASS="PARAMETER">temp2</REPLACEABLE>
|
||||
<replaceable class="PARAMETER">temp2</replaceable>
|
||||
and its return value must
|
||||
be a <productname>Postgres</productname>
|
||||
base type (not necessarily
|
||||
<REPLACEABLE CLASS="PARAMETER">data_type</REPLACEABLE>
|
||||
<replaceable class="PARAMETER">data_type</replaceable>
|
||||
which had been specified for BASETYPE).
|
||||
</para>
|
||||
</listitem>
|
||||
|
@ -269,10 +250,9 @@ The initial value for the second transition function argument.
|
|||
FINALFUNC should be specified
|
||||
if and only if both state-transition functions are
|
||||
specified.
|
||||
</para
|
||||
</listitem>
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
</PARA>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
An aggregate function may also require one or two initial conditions,
|
||||
|
@ -281,13 +261,13 @@ The initial value for the second transition function argument.
|
|||
in the database as fields of type <type>text</type>.
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATEAGGREGATE-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-09</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATEAGGREGATE-3">
|
||||
<refsect2info>
|
||||
<date>1998-09-09</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
</title>
|
||||
<para>
|
||||
Use <command>DROP AGGREGATE</command>
|
||||
to drop aggregate functions.
|
||||
|
@ -307,46 +287,46 @@ The initial value for the second transition function argument.
|
|||
defined, and any SFUNC2 must have a corresponding INITCOND2.
|
||||
</para>
|
||||
|
||||
</REFSECT2>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATEAGGREGATE-2">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATEAGGREGATE-2">
|
||||
<title>
|
||||
Usage
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
Refer to the chapter on aggregate functions
|
||||
in the <citetitle>PostgreSQL Programmer's Guide</citetitle>
|
||||
on aggregate functions for
|
||||
complete examples of usage.
|
||||
</para>
|
||||
</REFSECT1>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATEAGGREGATE-3">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATEAGGREGATE-3">
|
||||
<title>
|
||||
Compatibility
|
||||
</TITLE>
|
||||
</title>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATEAGGREGATE-4">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-09</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATEAGGREGATE-4">
|
||||
<refsect2info>
|
||||
<date>1998-09-09</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
SQL92
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<command>CREATE AGGREGATE</command>
|
||||
is a <productname>Postgres</productname> language extension.
|
||||
There is no <command>CREATE AGGREGATE</command> in SQL92.
|
||||
</PARA>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
</REFENTRY>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
|
|
|
@ -1,157 +1,155 @@
|
|||
<REFENTRY ID="SQL-CREATEDATABASE">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<refentry id="SQL-CREATEDATABASE">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
CREATE DATABASE
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
CREATE DATABASE
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Creates a new database
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
CREATE DATABASE <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE> [ WITH LOCATION = '<replaceable class="parameter">dbpath</replaceable>' ]
|
||||
</SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-04-15</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
CREATE DATABASE <replaceable class="PARAMETER">name</replaceable> [ WITH LOCATION = '<replaceable class="parameter">dbpath</replaceable>' ]
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATEDATABASE-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<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>
|
||||
</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>
|
||||
</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>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATEDATABASE-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATEDATABASE-2">
|
||||
<refsect2info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<ReturnValue>CREATEDB</ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
CREATEDB
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Message returned if the command completes successfully.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<ReturnValue>WARN: createdb: database "<replaceable class="parameter">name</replaceable>" already exists.</ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</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>
|
||||
<ReturnValue>ERROR: Unable to create database directory <replaceable class="parameter">directory</replaceable>
|
||||
</ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</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
|
||||
need permissions for the <literal>postgres</literal> user on the specified location.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</VARIABLELIST>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATEDATABASE-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATEDATABASE-1">
|
||||
<refsect1info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<command>CREATE DATABASE</command> creates a new Postgres database.
|
||||
The creator becomes the administrator of the new database.
|
||||
</PARA>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATEDATABASE-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATEDATABASE-3">
|
||||
<refsect2info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<command>CREATE DATABASE</command> is a <productname>Postgres</productname>
|
||||
language extension.
|
||||
</PARA>
|
||||
</para>
|
||||
<para>
|
||||
Use <command>DROP DATABASE</command> to remove a database.
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATEDATABASE-2">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATEDATABASE-2">
|
||||
<title>
|
||||
Usage
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
To create a new database:
|
||||
</PARA>
|
||||
<ProgramListing>
|
||||
<prompt>olly=></prompt> <userinput>create database lusiadas;</userinput>
|
||||
</ProgramListing>
|
||||
<PARA>
|
||||
|
||||
<programlisting>
|
||||
<prompt>olly=></prompt> <userinput>create database lusiadas;</userinput>
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To create a new database in an alternate area <filename>~/private_db</filename>:
|
||||
</PARA>
|
||||
<ProgramListing>
|
||||
<prompt>$</prompt> <userinput>mkdir private_db</userinput>
|
||||
<prompt>$</prompt> <userinput>initlocation ~/private_db</userinput>
|
||||
<computeroutput>Creating Postgres database system directory /home/olly/private_db/base</computeroutput>
|
||||
|
||||
<programlisting>
|
||||
<prompt>$</prompt> <userinput>mkdir private_db</userinput>
|
||||
<prompt>$</prompt> <userinput>initlocation ~/private_db</userinput>
|
||||
<computeroutput>Creating Postgres database system directory /home/olly/private_db/base</computeroutput>
|
||||
|
||||
<prompt>$</prompt> <userinput>psql olly</userinput>
|
||||
<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>
|
||||
<computeroutput>CREATEDB</computeroutput>
|
||||
</ProgramListing>
|
||||
</REFSECT1>
|
||||
</programlisting>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATEDATABASE-3">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATEDATABASE-3">
|
||||
<title>
|
||||
Bugs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
There are security and data integrity issues
|
||||
involved with using alternate database locations
|
||||
specified with absolute path names, and by default
|
||||
only an environment variable known to the backend may be
|
||||
specified for an alternate location.
|
||||
only an environment variable known to the backend may be
|
||||
specified for an alternate location.
|
||||
See the Administrator's Guide for more information.
|
||||
</PARA>
|
||||
</para>
|
||||
</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...
|
||||
-->
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATEDATABASE-4">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATEDATABASE-4">
|
||||
<title>
|
||||
Compatibility
|
||||
</TITLE>
|
||||
</title>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATEDATABASE-4">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATEDATABASE-4">
|
||||
<refsect2info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
SQL92
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
There is no <command>CREATE DATABASE</command> statement in SQL92.
|
||||
</PARA>
|
||||
</para>
|
||||
<para>
|
||||
The equivalent command in standard SQL is <command>CREATE SCHEMA</command>.
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
</REFENTRY>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
|
|
|
@ -32,11 +32,10 @@ CREATE FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceab
|
|||
Inputs
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<replaceable class="parameter">name</replaceable>
|
||||
</term>
|
||||
<term><replaceable class="parameter">name</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of a function to create.
|
||||
|
@ -44,9 +43,7 @@ CREATE FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceab
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<replaceable class="parameter">ftype</replaceable>
|
||||
</term>
|
||||
<term><replaceable class="parameter">ftype</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The data type of function arguments.
|
||||
|
@ -54,9 +51,7 @@ CREATE FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceab
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<replaceable class="parameter">rtype</replaceable>
|
||||
</term>
|
||||
<term><replaceable class="parameter">rtype</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The return data type.
|
||||
|
@ -64,9 +59,7 @@ CREATE FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceab
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<replaceable class="parameter">definition</replaceable>
|
||||
</term>
|
||||
<term><replaceable class="parameter">definition</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
A string defining the function; the meaning depends on the language.
|
||||
|
@ -76,9 +69,7 @@ CREATE FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceab
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<replaceable class="parameter">langname</replaceable>
|
||||
</term>
|
||||
<term><replaceable class="parameter">langname</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
may be '<literal>C</literal>', '<literal>sql</literal>',
|
||||
|
@ -105,9 +96,9 @@ CREATE FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceab
|
|||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<returnvalue>CREATE</returnvalue>
|
||||
</term>
|
||||
<term><computeroutput>
|
||||
CREATE
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
This is returned if the command completes successfully.
|
||||
|
@ -188,13 +179,12 @@ in the <citetitle>PostgreSQL Programmer's Guide</citetitle>
|
|||
</title>
|
||||
<para>
|
||||
To create a simple SQL function:
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
CREATE FUNCTION one() RETURNS int4
|
||||
CREATE FUNCTION one() RETURNS int4
|
||||
AS 'SELECT 1 AS RESULT'
|
||||
LANGUAGE 'sql';
|
||||
|
||||
SELECT one() AS answer;
|
||||
SELECT one() AS answer;
|
||||
|
||||
<computeroutput>
|
||||
answer
|
||||
|
@ -202,6 +192,8 @@ in the <citetitle>PostgreSQL Programmer's Guide</citetitle>
|
|||
1
|
||||
</computeroutput>
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To create a C function, calling a routine from a user-created
|
||||
shared library. This particular routine calculates a check
|
||||
|
@ -210,16 +202,16 @@ in the <citetitle>PostgreSQL Programmer's Guide</citetitle>
|
|||
</para>
|
||||
<programlisting>
|
||||
<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';
|
||||
|
||||
CREATE TABLE product (
|
||||
CREATE TABLE product (
|
||||
id char(8) PRIMARY KEY,
|
||||
eanprefix char(8) CHECK (eanprefix ~ '[0-9]{2}-[0-9]{5}')
|
||||
REFERENCES brandname(ean_prefix),
|
||||
eancode char(6) CHECK (eancode ~ '[0-9]{6}'),
|
||||
CONSTRAINT ean CHECK (ean_checkdigit(eanprefix, eancode))
|
||||
);
|
||||
);
|
||||
</userinput>
|
||||
</programlisting>
|
||||
</refsect1>
|
||||
|
@ -251,27 +243,26 @@ in the <citetitle>PostgreSQL Programmer's Guide</citetitle>
|
|||
</title>
|
||||
<para>
|
||||
|
||||
<note>
|
||||
<note>
|
||||
<para>
|
||||
PSM stands for Persistent Stored Modules. It is a procedural
|
||||
language and it was originally hoped that PSM would be ratified
|
||||
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.
|
||||
</para>
|
||||
</note>
|
||||
</note>
|
||||
|
||||
SQL/PSM <command>CREATE FUNCTION</command> has the following syntax:
|
||||
<synopsis>
|
||||
SQL/PSM <command>CREATE FUNCTION</command> has the following syntax:
|
||||
<synopsis>
|
||||
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> [, ...] ] )
|
||||
RETURNS <replaceable class="parameter">rtype</replaceable>
|
||||
LANGUAGE '<replaceable class="parameter">langname</replaceable>'
|
||||
ESPECIFIC <replaceable class="parameter">routine</replaceable>
|
||||
<replaceable class="parameter">SQL-statement</replaceable>
|
||||
</synopsis>
|
||||
|
||||
</synopsis>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
|
|
|
@ -1,80 +1,73 @@
|
|||
<REFENTRY ID="SQL-CREATEINDEX">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<refentry id="SQL-CREATEINDEX">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
CREATE INDEX
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
CREATE INDEX
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Constructs a secondary index
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-09-09</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-09-09</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
CREATE [ UNIQUE ] INDEX <replaceable class="parameter">index_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>] [, ...] )
|
||||
CREATE [ UNIQUE ] INDEX <replaceable class="parameter">index_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> )
|
||||
</SYNOPSIS>
|
||||
( <replaceable class="parameter">func_name</replaceable>( <replaceable class="parameter">r">col</replaceable>le> [, ... ]) <replaceable class="parameter">ops_name</replaceable> )
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATEINDEX-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-09</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATEINDEX-1">
|
||||
<refsect2info>
|
||||
<date>1998-09-09</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
UNIQUE
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>UNIQUE</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Causes the system to check for
|
||||
duplicate values in the table when the index is created (if data
|
||||
already exist) and each time data is added. Attempts to
|
||||
insert or update non-duplicate data will generate an
|
||||
error.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<replaceable class="parameter">index_name</replaceable>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><replaceable class="parameter">index_name</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of the index to be created.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<replaceable class="parameter">table</replaceable>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><replaceable class="parameter">table</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of the table to be indexed.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<replaceable class="parameter">acc_name</replaceable>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><replaceable class="parameter">acc_name</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
the name of the access method which is to be used for
|
||||
the index. The default access method is BTREE.
|
||||
Postgres provides three access methods for secondary indexes:
|
||||
|
@ -105,29 +98,27 @@ CREATE [ UNIQUE ] INDEX <replaceable class="parameter">index_name</replaceable>
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<replaceable class="parameter">column</replaceable>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><replaceable class="parameter">column</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of a column of the table.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<replaceable class="parameter">ops_name</replaceable>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><replaceable class="parameter">ops_name</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
An associated operator class.
|
||||
The following select list returns all ops_names:
|
||||
|
||||
<programlisting>
|
||||
<programlisting>
|
||||
SELECT am.amname AS acc_name,
|
||||
opc.opcname AS ops_name,
|
||||
opr.oprname AS ops_comp
|
||||
|
@ -137,70 +128,67 @@ SELECT am.amname AS acc_name,
|
|||
amop.amopclaid = opc.oid AND
|
||||
amop.amopopr = opr.oid
|
||||
ORDER BY acc_name, ops_name, ops_comp
|
||||
</programlisting>
|
||||
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<replaceable class="parameter">func_name</replaceable>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</programlisting>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><replaceable class="parameter">func_name</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
A user-defined function, which returns a value that can
|
||||
be indexed.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATEINDEX-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-09</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATEINDEX-2">
|
||||
<refsect2info>
|
||||
<date>1998-09-09</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<ReturnValue>CREATE</ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
CREATE
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The message returned if the index is successfully created.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<ReturnValue>ERROR: Cannot create index: 'index_name' already exists.</ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
ERROR: Cannot create index: 'index_name' already exists.
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
This error occurs if it is impossible to create the index.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATEINDEX-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-09-09</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATEINDEX-1">
|
||||
<refsect1info>
|
||||
<date>1998-09-09</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<command>CREATE INDEX</command> constructs an index
|
||||
<replaceable class="parameter">index_name</replaceable>.
|
||||
on the specified
|
||||
|
@ -235,35 +223,35 @@ SELECT am.amname AS acc_name,
|
|||
transformation to apply them to the base data.
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATEINDEX-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-09</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATEINDEX-3">
|
||||
<refsect2info>
|
||||
<date>1998-09-09</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
Currently, only the BTREE access method supports multi-column
|
||||
indexes. Up to 7 keys may be specified.
|
||||
</PARA>
|
||||
</para>
|
||||
<para>
|
||||
Use <command>DROP INDEX</command>
|
||||
to remove an index.
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATEINDEX-2">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATEINDEX-2">
|
||||
<title>
|
||||
Usage
|
||||
</TITLE>
|
||||
<PARA>To create a btree index on the field <literal>title</literal>
|
||||
</title>
|
||||
<para>To create a btree index on the field <literal>title</literal>
|
||||
in the table <literal>films</literal>:
|
||||
</PARA>
|
||||
<ProgramListing>
|
||||
</para>
|
||||
<programlisting>
|
||||
CREATE UNIQUE INDEX title_idx
|
||||
ON films (title);
|
||||
</ProgramListing>
|
||||
</programlisting>
|
||||
|
||||
<!--
|
||||
<comment>
|
||||
|
@ -282,37 +270,36 @@ SELECT * FROM points
|
|||
</programlisting>
|
||||
-->
|
||||
|
||||
</REFSECT1>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATEINDEX-3">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATEINDEX-3">
|
||||
<title>
|
||||
Compatibility
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
</title>
|
||||
<para>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATEINDEX-4">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-09</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATEINDEX-4">
|
||||
<refsect2info>
|
||||
<date>1998-09-09</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
SQL92
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
CREATE INDEX is a <productname>Postgres</productname> language extension.
|
||||
</PARA>
|
||||
</para>
|
||||
<para>
|
||||
There is no <command>CREATE INDEX</command> command in SQL92.
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
</REFENTRY>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
|
|
|
@ -1,87 +1,80 @@
|
|||
<REFENTRY ID="SQL-CREATELANGUAGE">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<refentry id="SQL-CREATELANGUAGE">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
CREATE LANGUAGE
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
CREATE LANGUAGE
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Defines a new language for functions
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-09-09</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-09-09</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
CREATE [ TRUSTED ] PROCEDURAL LANGUAGE '<replaceable class="parameter">langname</replaceable>'
|
||||
HANDLER <replaceable class="parameter">call_handler</replaceable>
|
||||
LANCOMPILER '<replaceable class="parameter">comment</replaceable>'
|
||||
</SYNOPSIS>
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATELANGUAGE-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-09</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATELANGUAGE-1">
|
||||
<refsect2info>
|
||||
<date>1998-09-09</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<function>TRUSTED</function>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>TRUSTED</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<function> TRUSTED</function> specifies that the call handler for
|
||||
the language is safe; that is, it offers an unprivileged user
|
||||
no functionality to bypass access restrictions. If
|
||||
this keyword is omitted when registering the language,
|
||||
only users with the <productname>Postgres</productname>
|
||||
superuser privilege can use
|
||||
superuser privilege can use
|
||||
this language to create new functions
|
||||
(like the 'C' language).
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<replaceable class="parameter">langname</replaceable>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<varlistentry>
|
||||
<term><replaceable class="parameter">langname</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of the new procedural language.
|
||||
The language name is case insensitive. A procedural
|
||||
language cannot override one of the built-in languages of
|
||||
<productname>Postgres</productname>.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
HANDLER <replaceable class="parameter">call_handler</replaceable>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>HANDLER <replaceable class="parameter">call_handler</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<replaceable class="parameter">call_handler</replaceable> is the name
|
||||
of a previously
|
||||
registered function that will be called to execute the PL
|
||||
procedures.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<replaceable class="parameter">comment</replaceable>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><replaceable class="parameter">comment</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The <function>LANCOMPILER</function> argument is the
|
||||
string that will be
|
||||
inserted in the <literal>LANCOMPILER</literal> attribute
|
||||
|
@ -89,77 +82,78 @@ superuser privilege can use
|
|||
<filename>pg_language</filename> entry. At present,
|
||||
<productname>Postgres</productname> does not use
|
||||
this attribute in any way.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
</REFSECT2>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATELANGUAGE-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-09</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATELANGUAGE-2">
|
||||
<refsect2info>
|
||||
<date>1998-09-09</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<ReturnValue>CREATE</ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
CREATE
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
This message is returned if the language is successfully
|
||||
created.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<ReturnValue>ERROR: PL handler function <replaceable class="parameter">funcname</replaceable>() doesn't exist</ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
ERROR: PL handler function <replaceable class="parameter">funcname</replaceable>() doesn't exist
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
This error is returned if the function
|
||||
<replaceable class="parameter">funcname</replaceable>()
|
||||
is not found.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</VARIABLELIST>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATELANGUAGE-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-09-09</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATELANGUAGE-1">
|
||||
<refsect1info>
|
||||
<date>1998-09-09</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
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>.
|
||||
Subsequently, functions and
|
||||
Subsequently, functions and
|
||||
trigger procedures can be defined in this new language.
|
||||
The user must have the <productname>Postgres</productname>
|
||||
superuser privilege to
|
||||
register a new language.
|
||||
</PARA>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATELANGUAGE-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-09</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATELANGUAGE-3">
|
||||
<refsect2info>
|
||||
<date>1998-09-09</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Writing PL handlers
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
The call handler for a procedural language must be written
|
||||
in a compiler language such as 'C' and registered with
|
||||
<productname>Postgres</productname> as a function taking
|
||||
|
@ -196,7 +190,7 @@ Subsequently, functions and
|
|||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</PARA>
|
||||
</para>
|
||||
<para>
|
||||
It's up to the call handler to fetch the
|
||||
<filename>pg_proc</filename> entry and
|
||||
|
@ -213,14 +207,14 @@ Subsequently, functions and
|
|||
</para>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATELANGUAGE-4">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-09</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATELANGUAGE-4">
|
||||
<refsect2info>
|
||||
<date>1998-09-09</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
Use <command>CREATE FUNCTION</command>
|
||||
to create a function.
|
||||
</para>
|
||||
|
@ -230,8 +224,8 @@ Subsequently, functions and
|
|||
<para>
|
||||
Refer to the table <filename>pg_language</filename>
|
||||
for further information:
|
||||
<programlisting>
|
||||
<computeroutput>
|
||||
<programlisting>
|
||||
<computeroutput>
|
||||
Table = pg_language
|
||||
+--------------------------+--------------------------+-------+
|
||||
| Field | Type | Length|
|
||||
|
@ -246,58 +240,57 @@ internal|n/a
|
|||
lisp |/usr/ucb/liszt
|
||||
C |/bin/cc
|
||||
sql |postgres
|
||||
</computeroutput>
|
||||
</programlisting>
|
||||
</computeroutput>
|
||||
</programlisting>
|
||||
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATELANGUAGE-4">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATELANGUAGE-4">
|
||||
<title>
|
||||
Restrictions
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
Since the call handler for a procedural language must be
|
||||
registered with <productname>Postgres</productname> in the 'C' language,
|
||||
it inherits
|
||||
all the capabilities and restrictions of 'C' functions.
|
||||
</para>
|
||||
</refsect1>
|
||||
<REFSECT1 ID="R1-SQL-CREATELANGUAGE-5">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATELANGUAGE-5">
|
||||
<title>
|
||||
Bugs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
At present, the definitions for a procedural language cannot be
|
||||
changed once they have been created.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATELANGUAGE-6">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATELANGUAGE-6">
|
||||
<title>
|
||||
Usage
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
This is a template for a PL handler written in 'C':
|
||||
</PARA>
|
||||
<ProgramListing>
|
||||
#include "executor/spi.h"
|
||||
#include "commands/trigger.h"
|
||||
#include "utils/elog.h"
|
||||
#include "fmgr.h" /* for FmgrValues struct */
|
||||
#include "access/heapam.h"
|
||||
#include "utils/syscache.h"
|
||||
#include "catalog/pg_proc.h"
|
||||
#include "catalog/pg_type.h"
|
||||
<programlisting>
|
||||
#include "executor/spi.h"
|
||||
#include "commands/trigger.h"
|
||||
#include "utils/elog.h"
|
||||
#include "fmgr.h" /* for FmgrValues struct */
|
||||
#include "access/heapam.h"
|
||||
#include "utils/syscache.h"
|
||||
#include "catalog/pg_proc.h"
|
||||
#include "catalog/pg_type.h"
|
||||
|
||||
Datum
|
||||
plsample_call_handler(
|
||||
Datum
|
||||
plsample_call_handler(
|
||||
Oid prooid,
|
||||
int pronargs,
|
||||
FmgrValues *proargs,
|
||||
bool *isNull)
|
||||
{
|
||||
{
|
||||
Datum retval;
|
||||
TriggerData *trigdata;
|
||||
|
||||
|
@ -319,57 +312,57 @@ sql |postgres
|
|||
|
||||
*isNull = false;
|
||||
return retval;
|
||||
}
|
||||
</ProgramListing>
|
||||
}
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Only a few thousand lines of code have to be added instead
|
||||
of the dots to complete the PL call handler.
|
||||
See <command>CREATE FUNCTION</command> for information on how to compile
|
||||
it into a loadable module
|
||||
.</para>
|
||||
See <command>CREATE FUNCTION</command> for information on how to compile
|
||||
it into a loadable module.
|
||||
</para>
|
||||
<para>
|
||||
The following commands then register the sample procedural
|
||||
language:
|
||||
<programlisting>
|
||||
CREATE FUNCTION plsample_call_handler () RETURNS opaque
|
||||
CREATE FUNCTION plsample_call_handler () RETURNS opaque
|
||||
AS '/usr/local/pgsql/lib/plsample.so'
|
||||
LANGUAGE 'C';
|
||||
|
||||
CREATE PROCEDURAL LANGUAGE 'plsample'
|
||||
CREATE PROCEDURAL LANGUAGE 'plsample'
|
||||
HANDLER plsample_call_handler
|
||||
LANCOMPILER 'PL/Sample';
|
||||
</programlisting>
|
||||
</para>
|
||||
</REFSECT1>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATELANGUAGE-7">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATELANGUAGE-7">
|
||||
<title>
|
||||
Compatibility
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
CREATE LANGUAGE is a <productname>Postgres</productname> extension.
|
||||
</PARA>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATELANGUAGE-5">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-09</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATELANGUAGE-5">
|
||||
<refsect2info>
|
||||
<date>1998-09-09</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
SQL92
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
There is no <command>CREATE LANGUAGE</command> statement in
|
||||
<acronym>SQL92</acronym>.
|
||||
</PARA>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
</REFENTRY>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
<REFENTRY ID="SQL-CREATEOPERATOR">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<refentry id="SQL-CREATEOPERATOR">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
CREATE OPERATOR
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
CREATE OPERATOR
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Defines a new user operator
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1999-04-14</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1999-04-14</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
CREATE OPERATOR <replaceable>name</replaceable> (
|
||||
PROCEDURE = <replaceable class="parameter">func_name</replaceable>
|
||||
[, LEFTARG = <replaceable class="parameter">type1</replaceable> ]
|
||||
|
@ -30,166 +30,144 @@ CREATE OPERATOR <replaceable>name</replaceable> (
|
|||
[, SORT1 = <replaceable class="parameter">left_sort_op</replaceable> ]
|
||||
[, SORT2 = <replaceable class="parameter">right_sort_op</replaceable> ]
|
||||
)
|
||||
</SYNOPSIS>
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATEOPERATOR-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1999-04-14</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATEOPERATOR-1">
|
||||
<refsect2info>
|
||||
<date>1999-04-14</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<replaceable class="parameter">name</replaceable>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</title>
|
||||
<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>
|
||||
</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>
|
||||
</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>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATEOPERATOR-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1999-04-14</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATEOPERATOR-2">
|
||||
<refsect2info>
|
||||
<date>1999-04-14</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<ReturnValue>CREATE</ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
CREATE
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Message returned if the operator is successfully created.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</VARIABLELIST>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATEOPERATOR-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1999-04-14</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATEOPERATOR-1">
|
||||
<refsect1info>
|
||||
<date>1999-04-14</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<command>CREATE OPERATOR</command> defines a new operator,
|
||||
<replaceable class="parameter">name</replaceable>.
|
||||
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
|
||||
from the following:
|
||||
<literallayout>
|
||||
+ - * / < > = ~ ! @ # % ^ & | ` ? $ :
|
||||
+ - * / < > = ~ ! @ # % ^ & | ` ? $ :
|
||||
</literallayout>
|
||||
<note>
|
||||
<para>
|
||||
|
@ -234,12 +212,16 @@ Operator that sorts the right-hand data type of this operator.
|
|||
would probably have a commutator
|
||||
operator, area-greater-than, >>>.
|
||||
Hence, the query optimizer could freely convert:
|
||||
|
||||
<programlisting>
|
||||
"0,0,1,1"::box >>> MYBOXES.description
|
||||
"0,0,1,1"::box >>> MYBOXES.description
|
||||
</programlisting>
|
||||
|
||||
to
|
||||
|
||||
<programlisting>
|
||||
MYBOXES.description <<< "0,0,1,1"::box</programlisting>
|
||||
MYBOXES.description <<< "0,0,1,1"::box
|
||||
</programlisting>
|
||||
</para>
|
||||
<para>
|
||||
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, !==.
|
||||
The negator link allows the query optimizer to simplify
|
||||
<programlisting>
|
||||
NOT MYBOXES.description === "0,0,1,1"::box
|
||||
NOT MYBOXES.description === "0,0,1,1"::box
|
||||
</programlisting>
|
||||
to
|
||||
<programlisting>
|
||||
MYBOXES.description !== "0,0,1,1"::box
|
||||
MYBOXES.description !== "0,0,1,1"::box
|
||||
</programlisting>
|
||||
</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
|
||||
clause of the form:
|
||||
<programlisting>
|
||||
MYBOXES.description <<< "0,0,1,1"::box
|
||||
MYBOXES.description <<< "0,0,1,1"::box
|
||||
</programlisting>
|
||||
is present in the qualification,
|
||||
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
|
||||
<replaceable class="parameter">res_proc</replaceable>
|
||||
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
|
||||
query optimizer simply calls this function, passing the
|
||||
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>
|
||||
The difference between the function
|
||||
<programlisting>
|
||||
my_procedure_1 (MYBOXES.description, "0,0,1,1"::box)
|
||||
my_procedure_1 (MYBOXES.description, "0,0,1,1"::box)
|
||||
</programlisting>
|
||||
and the operator
|
||||
<programlisting>
|
||||
MYBOXES.description === "0,0,1,1"::box
|
||||
MYBOXES.description === "0,0,1,1"::box
|
||||
</programlisting>
|
||||
is that <productname>Postgres</productname>
|
||||
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.
|
||||
Moreover, functions can have any number of arguments while
|
||||
operators are restricted to one or two.
|
||||
</PARA>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATEOPERATOR-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1999-04-14</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATEOPERATOR-3">
|
||||
<refsect2info>
|
||||
<date>1999-04-14</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
Refer to the chapter on operators in the
|
||||
<citetitle>PostgreSQL User's Guide</citetitle>
|
||||
for further information.
|
||||
Refer to <command>DROP OPERATOR</command> to delete
|
||||
user-defined operators from a database.
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATEOPERATOR-2">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATEOPERATOR-2">
|
||||
<title>
|
||||
Usage
|
||||
</TITLE>
|
||||
<PARA>The following command defines a new operator,
|
||||
</title>
|
||||
<para>The following command defines a new operator,
|
||||
area-equality, for the BOX data type.
|
||||
</PARA>
|
||||
<ProgramListing>
|
||||
CREATE OPERATOR === (
|
||||
</para>
|
||||
<programlisting>
|
||||
CREATE OPERATOR === (
|
||||
LEFTARG = box,
|
||||
RIGHTARG = box,
|
||||
PROCEDURE = area_equal_procedure,
|
||||
|
@ -393,36 +375,37 @@ Operator that sorts the right-hand data type of this operator.
|
|||
JOIN = area_join_procedure,
|
||||
HASHES,
|
||||
SORT1 = <<<,
|
||||
SORT2 = <<<)
|
||||
</ProgramListing>
|
||||
</REFSECT1>
|
||||
SORT2 = <<<
|
||||
);
|
||||
</programlisting>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATEOPERATOR-3">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATEOPERATOR-3">
|
||||
<title>
|
||||
Compatibility
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
CREATE OPERATOR is a <productname>Postgres</productname> extension.
|
||||
</PARA>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATEOPERATOR-4">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1999-04-14</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATEOPERATOR-4">
|
||||
<refsect2info>
|
||||
<date>1999-04-14</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
SQL92
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
There is no CREATE OPERATOR statement in <acronym>SQL92</acronym>.
|
||||
</PARA>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
</REFENTRY>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
|
|
|
@ -1,132 +1,123 @@
|
|||
<REFENTRY ID="SQL-CREATERULE">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<refentry id="SQL-CREATERULE">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
CREATE RULE
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
CREATE RULE
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Defines a new rule
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-09-11</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
CREATE RULE <replaceable class="parameter">name</replaceable>
|
||||
AS ON <replaceable class="parameter">event</replaceable>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-09-11</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
CREATE RULE <replaceable class="parameter">name</replaceable> AS ON <replaceable class="parameter">event</replaceable>
|
||||
TO <replaceable class="parameter">object</replaceable> [ WHERE <replaceable class="parameter">condition</replaceable> ]
|
||||
DO [ INSTEAD ] [ <replaceable class="parameter">action</replaceable> | NOTHING ]
|
||||
</SYNOPSIS>
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATERULE-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-11</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<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>
|
||||
</title>
|
||||
<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>
|
||||
</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>
|
||||
</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>
|
||||
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>
|
||||
</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>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
</REFSECT2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATERULE-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-11</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATERULE-2">
|
||||
<refsect2info>
|
||||
<date>1998-09-11</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<ReturnValue>CREATE</ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
CREATE
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Message returned if the rule is successfully created.
|
||||
</para>
|
||||
</listitem>
|
||||
</VARLISTENTRY>
|
||||
</VARIABLELIST>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATERULE-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-09-11</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATERULE-1">
|
||||
<refsect1info>
|
||||
<date>1998-09-11</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
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
|
||||
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.
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATERULE-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-11</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATERULE-3">
|
||||
<refsect2info>
|
||||
<date>1998-09-11</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
</title>
|
||||
<para>
|
||||
A caution about SQL rules is in order. If the same class name
|
||||
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
|
||||
two rules have the same semantics:
|
||||
<programlisting>
|
||||
on update to EMP.salary where EMP.name = "Joe"
|
||||
do update EMP ( ... ) where ...
|
||||
|
||||
on update to EMP-1.salary where EMP-2.name = "Joe"
|
||||
do update EMP-3 ( ... ) where ...
|
||||
ON UPDATE TO emp.salary WHERE emp.name = "Joe"
|
||||
DO UPDATE emp ( ... ) WHERE ...
|
||||
</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.
|
||||
Without
|
||||
Without
|
||||
this tag, <replaceable class="parameter">action</replaceable> will be
|
||||
performed in addition to the user command when the
|
||||
<replaceable class="parameter">event</replaceable> in the
|
||||
|
@ -180,7 +174,7 @@ Without
|
|||
<replaceable class="parameter">action</replaceable> part will be done
|
||||
instead of the user command. In this later case, the
|
||||
<replaceable class="parameter">action</replaceable> can be the keyword
|
||||
NOTHING.
|
||||
<literal>NOTHING</literal>.
|
||||
</para>
|
||||
<para>
|
||||
When choosing between the rewrite and instance rule systems for a
|
||||
|
@ -198,19 +192,21 @@ Without
|
|||
<example>
|
||||
<title>Example of a circular rewrite rule combination.</title>
|
||||
<programlisting>
|
||||
create rule bad_rule_combination_1 as
|
||||
on select to EMP
|
||||
do instead select to TOYEMP
|
||||
CREATE RULE bad_rule_combination_1 AS
|
||||
ON SELECT TO emp
|
||||
DO INSTEAD SELECT TO toyemp;
|
||||
</programlisting>
|
||||
|
||||
create rule bad_rule_combination_2 as
|
||||
on select to TOYEMP
|
||||
do instead select to EMP
|
||||
<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
|
||||
<productname>Postgres</productname> to crash.
|
||||
<programlisting>
|
||||
select * from EMP
|
||||
SELECT * FROM emp;
|
||||
</programlisting></para>
|
||||
</example>
|
||||
|
||||
|
@ -219,23 +215,22 @@ select * from EMP
|
|||
You must have rule definition access to a class in order
|
||||
to define a rule on it. Use <command>GRANT</command>
|
||||
and <command>REVOKE</command> to change permissions.
|
||||
|
||||
</PARA>
|
||||
</REFSECT2>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATERULE-2">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATERULE-2">
|
||||
<title>
|
||||
Usage
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
Make Sam get the same salary adjustment as Joe:
|
||||
|
||||
<programlisting>
|
||||
create rule example_1 as
|
||||
on update EMP.salary where current.name = "Joe"
|
||||
do update EMP (salary = new.salary)
|
||||
where EMP.name = "Sam"
|
||||
CREATE RULE example_1 AS
|
||||
ON UPDATE emp.salary WHERE current.name = "Joe"
|
||||
DO UPDATE emp (salary = new.salary)
|
||||
WHERE emp.name = "Sam";
|
||||
</programlisting>
|
||||
|
||||
At the time Joe receives a salary adjustment, the event
|
||||
|
@ -248,12 +243,12 @@ create rule example_1 as
|
|||
<para>
|
||||
Make Bill get Joe's salary when it is accessed:
|
||||
<programlisting>
|
||||
create rule example_2 as
|
||||
on select to EMP.salary
|
||||
where current.name = "Bill"
|
||||
do instead
|
||||
select (EMP.salary) from EMP
|
||||
where EMP.name = "Joe"
|
||||
CREATE RULE example_2 AS
|
||||
ON SELECT TO EMP.salary
|
||||
WHERE current.name = "Bill"
|
||||
DO INSTEAD
|
||||
SELECT (emp.salary) from emp
|
||||
WHERE emp.name = "Joe";
|
||||
</programlisting>
|
||||
</para>
|
||||
<para>
|
||||
|
@ -261,40 +256,40 @@ create rule example_2 as
|
|||
department (<function>current_user</function> returns the name of
|
||||
the current user):
|
||||
<programlisting>
|
||||
create rule example_3 as
|
||||
on select to EMP.salary
|
||||
where current.dept = "shoe" and current_user = "Joe"
|
||||
do instead nothing
|
||||
CREATE RULE example_3 AS
|
||||
ON SELECT TO emp.salary
|
||||
WHERE current.dept = "shoe" AND current_user = "Joe"
|
||||
DO INSTEAD NOTHING;
|
||||
</programlisting>
|
||||
</para>
|
||||
<para>
|
||||
Create a view of the employees working in the toy department.
|
||||
<programlisting>
|
||||
create TOYEMP(name = char16, salary = int4)
|
||||
CREATE toyemp(name = char16, salary = int4);
|
||||
|
||||
create rule example_4 as
|
||||
on select to TOYEMP
|
||||
do instead
|
||||
select (EMP.name, EMP.salary) from EMP
|
||||
where EMP.dept = "toy"
|
||||
CREATE RULE example_4 AS
|
||||
ON SELECT TO toyemp
|
||||
DO INSTEAD
|
||||
SELECT (emp.name, emp.salary) FROM emp
|
||||
WHERE emp.dept = "toy";
|
||||
</programlisting>
|
||||
</para>
|
||||
<para>
|
||||
All new employees must make 5,000 or less
|
||||
<programlisting>
|
||||
create rule example_5 as
|
||||
on insert to EMP where new.salary > 5000
|
||||
do update newset salary = 5000
|
||||
CREATE RULE example_5 AS
|
||||
ON INERT TO emp WHERE new.salary > 5000
|
||||
DO UPDATE NEWSET salary = 5000;
|
||||
</programlisting>
|
||||
</PARA>
|
||||
</REFSECT1>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATERULE-3">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATERULE-3">
|
||||
<title>
|
||||
Bugs
|
||||
</TITLE>
|
||||
</title>
|
||||
<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.
|
||||
</para>
|
||||
<para>
|
||||
|
@ -308,36 +303,36 @@ create rule example_5 as
|
|||
text attributes. This implies that creation of rules may
|
||||
fail if the rule plus its various internal representations
|
||||
exceed some value that is on the order of one page (8KB).
|
||||
</PARA>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATERULE-4">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATERULE-4">
|
||||
<title>
|
||||
Compatibility
|
||||
</TITLE>
|
||||
<PARA>
|
||||
CREATE RULE statement is a <productname>Postgres</productname>
|
||||
language extension.
|
||||
</PARA>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATERULE-4">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-11</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
SQL92
|
||||
</TITLE>
|
||||
</title>
|
||||
<para>
|
||||
There is no CREATE RULE statement in <acronym>SQL92</acronym>.
|
||||
<command>CREATE RULE</command> statement is a <productname>Postgres</productname>
|
||||
language extension.
|
||||
</para>
|
||||
|
||||
<refsect2 id="R2-SQL-CREATERULE-4">
|
||||
<refsect2info>
|
||||
<date>1998-09-11</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
SQL92
|
||||
</title>
|
||||
<para>
|
||||
There is no <command>CREATE RULE</command> statement in <acronym>SQL92</acronym>.
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
</REFENTRY>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
<REFENTRY ID="SQL-CREATESEQUENCE">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<refentry id="SQL-CREATESEQUENCE">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
CREATE SEQUENCE
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
CREATE SEQUENCE
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Creates a new sequence number generator
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-04-15</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
CREATE SEQUENCE <replaceable class="parameter">seqname</replaceable>
|
||||
[ INCREMENT <replaceable class="parameter">increment</replaceable> ]
|
||||
[ MINVALUE <replaceable class="parameter">minvalue</replaceable> ]
|
||||
|
@ -25,74 +25,66 @@ CREATE SEQUENCE <replaceable class="parameter">seqname</replaceable>
|
|||
[ START <replaceable class="parameter">start</replaceable> ]
|
||||
[ CACHE <replaceable class="parameter">cache</replaceable> ]
|
||||
[ CYCLE ]
|
||||
</SYNOPSIS>
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATESEQUENCE-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-11</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATESEQUENCE-1">
|
||||
<refsect2info>
|
||||
<date>1998-09-11</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<replaceable class="parameter">seqname</replaceable>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</title>
|
||||
<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
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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.
|
||||
|
@ -101,29 +93,25 @@ CREATE SEQUENCE <replaceable class="parameter">seqname</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>
|
||||
</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>
|
||||
</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
|
||||
|
@ -134,107 +122,108 @@ CREATE SEQUENCE <replaceable class="parameter">seqname</replaceable>
|
|||
<replaceable class="parameter">minvalue</replaceable> or
|
||||
<replaceable class="parameter">maxvalue</replaceable> is,
|
||||
as appropriate.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</REFSECT2>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATESEQUENCE-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-11</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATESEQUENCE-2">
|
||||
<refsect2info>
|
||||
<date>1998-09-11</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<ReturnValue>CREATE</ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
CREATE
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<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>
|
||||
</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>
|
||||
<ReturnValue>ERROR: DefineSequence: START value (<replaceable class="parameter">start</replaceable>) can't be > MAXVALUE (<replaceable class="parameter">maxvalue</replaceable>)</ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</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>
|
||||
<ReturnValue>ERROR: DefineSequence: START value (<replaceable class="parameter">start</replaceable>) can't be < MINVALUE (<replaceable class="parameter">minvalue</replaceable>)</ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</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>
|
||||
<ReturnValue>ERROR: DefineSequence: MINVALUE (<replaceable class="parameter">minvalue</replaceable>) can't be >= MAXVALUE (<replaceable class="parameter">maxvalue</replaceable>)</ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</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>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATESEQUENCE-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-09-11</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATESEQUENCE-1">
|
||||
<refsect1info>
|
||||
<date>1998-09-11</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
CREATE SEQUENCE will enter a new sequence number generator
|
||||
</title>
|
||||
<para>
|
||||
<command>CREATE SEQUENCE</command> will enter a new sequence number generator
|
||||
into the current data base. This involves creating and initialising a
|
||||
new single-row
|
||||
table with the name <replaceable class="parameter">seqname</replaceable>.
|
||||
The generator will be "owned" by the user issuing the command.
|
||||
</PARA>
|
||||
</para>
|
||||
<para>
|
||||
After a sequence is created, you may use the function
|
||||
<function>nextval(<replaceable class="parameter">seqname</replaceable>)</function>
|
||||
to get a new number from the sequence.
|
||||
The function
|
||||
<function>currval('<replaceable class="parameter">seqname</replaceable>')</function>
|
||||
<function>nextval(<replaceable class="parameter">seqname</replaceable>)</function>
|
||||
to get a new number from the sequence.
|
||||
The function
|
||||
<function>currval('<replaceable class="parameter">seqname</replaceable>')</function>
|
||||
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.
|
||||
The function
|
||||
<function>setval('<replaceable class="parameter">seqname</replaceable>',
|
||||
The function
|
||||
<function>setval('<replaceable class="parameter">seqname</replaceable>',
|
||||
<replaceable class="parameter">newvalue</replaceable>)</function>
|
||||
may be used to set the current value of the specified sequence.
|
||||
The next call to
|
||||
<function>nextval(<replaceable class="parameter">seqname</replaceable>)</function>
|
||||
will return the given value plus the sequence increment.
|
||||
may be used to set the current value of the specified sequence.
|
||||
The next call to
|
||||
<function>nextval(<replaceable class="parameter">seqname</replaceable>)</function>
|
||||
will return the given value plus the sequence increment.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
|
@ -256,7 +245,7 @@ SELECT last_value FROM sequence_name;
|
|||
calls to a generator.
|
||||
</para>
|
||||
|
||||
<caution>
|
||||
<caution>
|
||||
<para>
|
||||
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
|
||||
|
@ -280,34 +269,34 @@ SELECT last_value FROM sequence_name;
|
|||
</para>
|
||||
</caution>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATESEQUENCE-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-11</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATESEQUENCE-3">
|
||||
<refsect2info>
|
||||
<date>1998-09-11</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
<PARA>
|
||||
Refer to the DROP SEQUENCE statement to remove a sequence.
|
||||
</PARA>
|
||||
</title>
|
||||
<para>
|
||||
Refer to the <command>DROP SEQUENCE</command> statement to remove a sequence.
|
||||
</para>
|
||||
<para>
|
||||
Each backend uses its own cache to store allocated numbers.
|
||||
Numbers that are cached but not used in the current session will be
|
||||
lost, resulting in "holes" in the sequence.
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATESEQUENCE-2">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATESEQUENCE-2">
|
||||
<title>
|
||||
Usage
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
Create an ascending sequence called <literal>serial</literal>, starting at 101:
|
||||
</PARA>
|
||||
<ProgramListing>
|
||||
</para>
|
||||
<programlisting>
|
||||
CREATE SEQUENCE serial START 101;
|
||||
</ProgramListing>
|
||||
</programlisting>
|
||||
<para>
|
||||
Select the next number from this sequence
|
||||
<programlisting>
|
||||
|
@ -328,47 +317,45 @@ INSERT INTO distributors VALUES (NEXTVAL('serial'),'nothing');
|
|||
<para>
|
||||
Set the sequence value after a COPY FROM:
|
||||
<programlisting>
|
||||
CREATE FUNCTION distributors_id_max() RETURNS INT4
|
||||
CREATE FUNCTION distributors_id_max() RETURNS INT4
|
||||
AS 'SELECT max(id) FROM distributors'
|
||||
LANGUAGE 'sql';
|
||||
BEGIN;
|
||||
BEGIN;
|
||||
COPY distributors FROM 'input_file';
|
||||
SELECT setval('serial', distributors_id_max());
|
||||
END;
|
||||
END;
|
||||
</programlisting>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</REFSECT1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATESEQUENCE-3">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATESEQUENCE-3">
|
||||
<title>
|
||||
Compatibility
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<command>CREATE SEQUENCE</command> is a <productname>Postgres</productname>
|
||||
language extension.
|
||||
</PARA>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATESEQUENCE-4">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-11</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATESEQUENCE-4">
|
||||
<refsect2info>
|
||||
<date>1998-09-11</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
SQL92
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
There is no <command>CREATE SEQUENCE</command> statement
|
||||
in <acronym>SQL92</acronym>.
|
||||
</PARA>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
</REFENTRY>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
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>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<replaceable>table</replaceable>
|
||||
</term>
|
||||
<term><replaceable>table</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of a new table to be created.
|
||||
|
@ -44,25 +42,21 @@ CREATE TABLE <replaceable>table</replaceable> [ (<replaceable>column</replaceabl
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<replaceable>column</replaceable>
|
||||
</term>
|
||||
<term><replaceable>column</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of a column. Multiple column names can be specified using
|
||||
a comma-delimited list of column names.
|
||||
a comma-delimited list of column names.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<replaceable>select_clause</replaceable>
|
||||
</term>
|
||||
<term><replaceable>select_clause</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
A valid query statement. Refer to SELECT for a description of the
|
||||
allowed syntax.
|
||||
A valid query statement. Refer to SELECT for a description of the
|
||||
allowed syntax.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -78,7 +72,8 @@ allowed syntax.
|
|||
Outputs
|
||||
</title>
|
||||
<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.
|
||||
</para>
|
||||
</refsect2>
|
||||
|
@ -92,9 +87,9 @@ allowed syntax.
|
|||
Description
|
||||
</title>
|
||||
<para>
|
||||
CREATE TABLE AS enables a table to be created from the contents of
|
||||
an existing table. It has functionality equivalent to SELECT TABLE INTO,
|
||||
but with perhaps a more obvious syntax.
|
||||
<command>CREATE TABLE AS</command> enables a table to be created from the contents of
|
||||
an existing table. It has functionality equivalent to <command>SELECT TABLE INTO</command>,
|
||||
but with perhaps a more direct syntax.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,120 +1,113 @@
|
|||
<REFENTRY ID="SQL-CREATETRIGGER">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<refentry id="SQL-CREATETRIGGER">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
CREATE TRIGGER
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
CREATE TRIGGER
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Creates a new trigger
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-09-21</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
CREATE TRIGGER <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE> { BEFORE | AFTER }
|
||||
{ <REPLACEABLE CLASS="PARAMETER">event</REPLACEABLE> [OR ...] }
|
||||
ON <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> FOR EACH { ROW | STATEMENT }
|
||||
EXECUTE PROCEDURE <REPLACEABLE CLASS="PARAMETER">funcname</REPLACEABLE> ( <REPLACEABLE CLASS="PARAMETER">arguments</REPLACEABLE> )
|
||||
</SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-09-21</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
CREATE TRIGGER <replaceable class="PARAMETER">name</replaceable> { BEFORE | AFTER } { <replaceable class="PARAMETER">event</replaceable> [OR ...] }
|
||||
ON <replaceable class="PARAMETER">table</replaceable> FOR EACH { ROW | STATEMENT }
|
||||
EXECUTE PROCEDURE <replaceable class="PARAMETER">ER">func</replaceable>BLE> ( <replaceable class="PARAMETER">arguments</replaceable> )
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATETRIGGER-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-21</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATETRIGGER-1">
|
||||
<refsect2info>
|
||||
<date>1998-09-21</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 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>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATETRIGGER-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-21</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<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>
|
||||
<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>
|
||||
</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>
|
||||
</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>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATETRIGGER-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-09-21</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATETRIGGER-1">
|
||||
<refsect1info>
|
||||
<date>1998-09-21</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<command>CREATE TRIGGER</command> will enter a new trigger into the current
|
||||
data base. The trigger will be associated with the relation
|
||||
<replaceable class="parameter">relname</replaceable> and will execute
|
||||
the specified function <replaceable class="parameter">funcname</replaceable>.
|
||||
</PARA>
|
||||
<PARA>
|
||||
</para>
|
||||
<para>
|
||||
The trigger can be specified to fire either before the
|
||||
operation is attempted on a tuple (before constraints
|
||||
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
|
||||
the trigger fires after the event, all changes, including the
|
||||
last insertion, update, or deletion, are "visible" to the trigger.
|
||||
</PARA>
|
||||
<PARA>
|
||||
</para>
|
||||
<para>
|
||||
Refer to the chapters on SPI and Triggers in the
|
||||
<citetitle>PostgreSQL Programmer's Guide</citetitle> for more
|
||||
information.
|
||||
</PARA>
|
||||
<REFSECT2 ID="R2-SQL-CREATETRIGGER-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-21</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
</para>
|
||||
<refsect2 id="R2-SQL-CREATETRIGGER-3">
|
||||
<refsect2info>
|
||||
<date>1998-09-21</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<command>CREATE TRIGGER</command> is a <productname>Postgres</productname>
|
||||
language extension.
|
||||
</PARA>
|
||||
<PARA>
|
||||
</para>
|
||||
<para>
|
||||
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.
|
||||
</PARA>
|
||||
<PARA>
|
||||
</para>
|
||||
<para>
|
||||
Refer to <command>DROP TRIGGER</command> for information on how to
|
||||
remove triggers.
|
||||
</PARA>
|
||||
</REFSECT2>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATETRIGGER-2">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATETRIGGER-2">
|
||||
<title>
|
||||
Usage
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
Check if the specified distributor code exists in the distributors
|
||||
table before appending or updating a row in the table films:
|
||||
</PARA>
|
||||
<ProgramListing>
|
||||
CREATE TRIGGER if_dist_exists
|
||||
|
||||
<programlisting>
|
||||
CREATE TRIGGER if_dist_exists
|
||||
BEFORE INSERT OR UPDATE ON films FOR EACH ROW
|
||||
EXECUTE PROCEDURE check_primary_key ('did', 'distributors', 'did');
|
||||
</ProgramListing>
|
||||
<PARA>
|
||||
</programlisting>
|
||||
</para>
|
||||
<para>
|
||||
Before cancelling a distributor or updating its code, remove every
|
||||
reference to the table films:
|
||||
</PARA>
|
||||
<ProgramListing>
|
||||
CREATE TRIGGER if_film_exists
|
||||
<programlisting>
|
||||
CREATE TRIGGER if_film_exists
|
||||
BEFORE DELETE OR UPDATE ON distributors FOR EACH ROW
|
||||
EXECUTE PROCEDURE check_foreign_key (1, 'CASCADE', 'did', 'films', 'did');
|
||||
</ProgramListing>
|
||||
</REFSECT1>
|
||||
</programlisting>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATETRIGGER-3">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATETRIGGER-3">
|
||||
<title>
|
||||
Compatibility
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
</title>
|
||||
<para>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATETRIGGER-4">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-21</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATETRIGGER-4">
|
||||
<refsect2info>
|
||||
<date>1998-09-21</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
SQL92
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
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
|
||||
constraint as in:
|
||||
</PARA>
|
||||
<ProgramListing>
|
||||
CREATE TABLE distributors (
|
||||
|
||||
<programlisting>
|
||||
CREATE TABLE distributors (
|
||||
did DECIMAL(3),
|
||||
name VARCHAR(40),
|
||||
CONSTRAINT if_film_exists
|
||||
FOREIGN KEY(did) REFERENCES films
|
||||
ON UPDATE CASCADE ON DELETE CASCADE
|
||||
);
|
||||
</ProgramListing>
|
||||
<PARA>
|
||||
);
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
However, foreign keys are not yet implemented (as of version 6.4) in
|
||||
<productname>Postgres</productname>.
|
||||
</PARA>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
</REFENTRY>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
<REFENTRY ID="SQL-CREATETYPE">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<refentry id="SQL-CREATETYPE">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
CREATE TYPE
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
CREATE TYPE
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Defines a new base data type
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-09-21</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-09-21</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
CREATE TYPE <replaceable class="parameter">typename</replaceable> (
|
||||
INPUT = <replaceable class="parameter">input_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> ]
|
||||
[ , PASSEDBYVALUE ]
|
||||
)
|
||||
</SYNOPSIS>
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATETYPE-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-21</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATETYPE-1">
|
||||
<refsect2info>
|
||||
<date>1998-09-21</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<replaceable class="parameter">typename</replaceable>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</title>
|
||||
<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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
</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>
|
||||
<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>
|
||||
<comment>Is this right?</comment>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</REFSECT2>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATETYPE-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-21</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATETYPE-2">
|
||||
<refsect2info>
|
||||
<date>1998-09-21</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<ReturnValue>CREATE</ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
CREATE
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Message returned if the type is successfully created.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</VARIABLELIST>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATETYPE-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-09-21</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATETYPE-1">
|
||||
<refsect1info>
|
||||
<date>1998-09-21</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
CREATE TYPE allows the user to register a new user data
|
||||
</title>
|
||||
<para>
|
||||
<command>CREATE TYPE</command> allows the user to register a new user data
|
||||
type with Postgres for use in the current data base. The
|
||||
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
|
||||
types defined for this database.
|
||||
</para>
|
||||
<PARA>
|
||||
CREATE TYPE requires the registration of two functions
|
||||
<para>
|
||||
<command>CREATE TYPE</command> requires the registration of two functions
|
||||
(using create function) before defining the type. The
|
||||
representation of a new base type is determined by
|
||||
<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
|
||||
one or two arguments of type "<literal>opaque</literal>".
|
||||
</para>
|
||||
<PARA>
|
||||
<para>
|
||||
New base data types can be fixed length, in which case
|
||||
<replaceable class="parameter">internallength</replaceable> is a
|
||||
positive integer, or variable length,
|
||||
|
@ -221,33 +202,33 @@ EXTERNALLENGTH <replaceable class="parameter">externallength</replaceable>
|
|||
as the Postgres-supplied data type, "<literal>text</literal>".
|
||||
To indicate that a type is variable-length, set
|
||||
<replaceable class="parameter">internallength</replaceable>
|
||||
to VARIABLE.
|
||||
to <option>VARIABLE</option>.
|
||||
The external representation is similarly specified using the
|
||||
<replaceable class="parameter">externallength</replaceable>
|
||||
keyword.
|
||||
</para>
|
||||
<PARA>
|
||||
<para>
|
||||
To indicate that a type is an array and to indicate that a
|
||||
type has array elements, indicate the type of the array
|
||||
element using the element keyword. For example, to define
|
||||
an array of 4 byte integers ("int4"), specify
|
||||
<programlisting>ELEMENT = int4</programlisting>
|
||||
</para>
|
||||
<PARA>
|
||||
<para>
|
||||
To indicate the delimiter to be used on arrays of this
|
||||
type, <replaceable class="parameter">delimiter</replaceable>
|
||||
can be
|
||||
set to a specific character. The default delimiter is the comma
|
||||
("<literal>,</literal>").
|
||||
</para>
|
||||
<PARA>
|
||||
<para>
|
||||
A default value is optionally available in case a user
|
||||
wants some specific bit pattern to mean "data not present."
|
||||
Specify the default with the DEFAULT keyword.
|
||||
<comment>How does the user specify that bit pattern and associate
|
||||
it with the fact that the data is not present></comment>
|
||||
Specify the default with the <literal>DEFAULT</literal> keyword.
|
||||
<comment>How does the user specify that bit pattern and associate
|
||||
it with the fact that the data is not present></comment>
|
||||
</para>
|
||||
<PARA>
|
||||
<para>
|
||||
The optional functions
|
||||
<replaceable class="parameter">send_function</replaceable> and
|
||||
<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
|
||||
a Sun-4 to a DECstation, but many other types do.
|
||||
</para>
|
||||
<PARA>
|
||||
The optional flag, PASSEDBYVALUE, indicates that operators
|
||||
<para>
|
||||
The optional flag, <option>PASSEDBYVALUE</option>, indicates that operators
|
||||
and functions which use this data type should be passed an
|
||||
argument by value rather than by reference. Note that you
|
||||
may not pass by value types whose internal representation is
|
||||
more than four bytes.
|
||||
</para>
|
||||
<PARA>
|
||||
<para>
|
||||
For new base types, a user can define operators, functions
|
||||
and aggregates using the appropriate facilities described
|
||||
in this section.
|
||||
</para>
|
||||
|
||||
<refsect2>
|
||||
<title>Array Types</title>
|
||||
<para>
|
||||
Two generalized built-in functions, array_in and
|
||||
array_out, exist for quick creation of variable-length
|
||||
array types. These functions operate on arrays of any
|
||||
existing Postgres type.</para>
|
||||
existing Postgres type.
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<refsect2>
|
||||
|
@ -306,33 +289,31 @@ it with the fact that the data is not present></comment>
|
|||
type in a class definition:
|
||||
</para>
|
||||
<programlisting>
|
||||
CREATE TYPE box (INTERNALLENGTH = 8,
|
||||
INPUT = my_procedure_1, OUTPUT = my_procedure_2)
|
||||
|
||||
CREATE TABLE myboxes (id INT4, description box)
|
||||
CREATE TYPE box (INTERNALLENGTH = 8,
|
||||
INPUT = my_procedure_1, OUTPUT = my_procedure_2);
|
||||
CREATE TABLE myboxes (id INT4, description box);
|
||||
</programlisting>
|
||||
<para>
|
||||
This command creates a variable length array type with
|
||||
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>
|
||||
CREATE TYPE int4array (INPUT = array_in, OUTPUT = array_out,
|
||||
INTERNALLENGTH = VARIABLE, ELEMENT = int4);
|
||||
CREATE TABLE myarrays (id int4, numbers int4array);
|
||||
</programlisting>
|
||||
</para>
|
||||
<para>
|
||||
This command creates a large object type and uses it in
|
||||
a class definition.
|
||||
</para>
|
||||
<programlisting>
|
||||
CREATE TYPE bigobj
|
||||
(INPUT = lo_filein, OUTPUT = lo_fileout,
|
||||
INTERNALLENGTH = VARIABLE)
|
||||
a class definition:
|
||||
|
||||
CREATE TABLE big_objs (id int4, obj bigobj)
|
||||
<programlisting>
|
||||
CREATE TYPE bigobj (INPUT = lo_filein, OUTPUT = lo_fileout,
|
||||
INTERNALLENGTH = VARIABLE);
|
||||
CREATE TABLE big_objs (id int4, obj bigobj);
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<refsect2>
|
||||
<title>Restrictions</title>
|
||||
<para>
|
||||
|
@ -344,44 +325,43 @@ it with the fact that the data is not present></comment>
|
|||
</para>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATETYPE-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-21</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATETYPE-3">
|
||||
<refsect2info>
|
||||
<date>1998-09-21</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
Refer to <command>DROP TYPE</command> to remove an existing type.
|
||||
</PARA>
|
||||
<PARA>
|
||||
</para>
|
||||
<para>
|
||||
See also <command>CREATE FUNCTION</command>,
|
||||
<command>CREATE OPERATOR</command> and the chapter on Large Objects
|
||||
in the <citetitle>PostgreSQL Programmer's Guide</citetitle>.
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATETYPE-3">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATETYPE-3">
|
||||
<title>
|
||||
Compatibility
|
||||
</TITLE>
|
||||
</title>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATETYPE-4">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-21</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATETYPE-4">
|
||||
<refsect2info>
|
||||
<date>1998-09-21</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
SQL3
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<command>CREATE TYPE</command> is an <acronym>SQL3</acronym> statement.
|
||||
</PARA>
|
||||
|
||||
</REFSECT2>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
</REFENTRY>
|
||||
</refentry>
|
||||
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
|
|
@ -36,9 +36,7 @@ CREATE USER<replaceable class="PARAMETER"> username</replaceable>
|
|||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<returnvalue><replaceable class="parameter">username</replaceable></returnvalue>
|
||||
</term>
|
||||
<term><replaceable class="parameter">username</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of the user.
|
||||
|
@ -47,9 +45,7 @@ CREATE USER<replaceable class="PARAMETER"> username</replaceable>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<returnvalue><replaceable class="parameter">password</replaceable></returnvalue>
|
||||
</term>
|
||||
<term><replaceable class="parameter">password</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The WITH PASSWORD clause sets the user's password within
|
||||
|
@ -81,9 +77,8 @@ CREATE USER<replaceable class="PARAMETER"> username</replaceable>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<returnvalue> CREATEDB/NOCREATEDB</returnvalue>
|
||||
</term>
|
||||
<term>CREATEDB</term>
|
||||
<term>NOCREATEDB</term>
|
||||
<listitem>
|
||||
<para>
|
||||
These clauses define a user's ability to create databases.
|
||||
|
@ -96,9 +91,8 @@ CREATE USER<replaceable class="PARAMETER"> username</replaceable>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<returnvalue>CREATEUSER/NOCREATEUSER</returnvalue>
|
||||
</term>
|
||||
<term>CREATEUSER</term>
|
||||
<term>NOCREATEUSER</term>
|
||||
<listitem>
|
||||
<para>
|
||||
These clauses determine whether a user will be permitted to
|
||||
|
@ -111,9 +105,7 @@ CREATE USER<replaceable class="PARAMETER"> username</replaceable>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<returnvalue><replaceable class="parameter">groupname</replaceable></returnvalue>
|
||||
</term>
|
||||
<term><replaceable class="parameter">groupname</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
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>
|
||||
<term>
|
||||
<returnvalue><replaceable class="parameter">abstime</replaceable></returnvalue>
|
||||
</term>
|
||||
<term><replaceable class="parameter">abstime</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The VALID UNTIL clause sets an absolute time after which the
|
||||
|
@ -155,29 +145,15 @@ CREATE USER<replaceable class="PARAMETER"> username</replaceable>
|
|||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<returnvalue>CREATE USER</returnvalue>
|
||||
</term>
|
||||
<term><computeroutput>
|
||||
CREATE USER
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Message returned if the command completes successfully.
|
||||
</para>
|
||||
</listitem>
|
||||
</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>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
@ -192,23 +168,27 @@ CREATE USER<replaceable class="PARAMETER"> username</replaceable>
|
|||
</title>
|
||||
<para>
|
||||
CREATE USER will add a new user to an instance of
|
||||
<productname>Postgres</productname>.
|
||||
<productname>Postgres</productname>.
|
||||
</para>
|
||||
<para>
|
||||
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
|
||||
<productname>Postgres</productname> users' <filename>usesysid</filename>s will not
|
||||
correspond to their operating
|
||||
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
|
||||
<filename>usesysid</filename> during the initdb process.
|
||||
If you still want the
|
||||
OS user id and the <filename>usesysid</filename> to match
|
||||
for any given user,
|
||||
use the "createuser" script provided with the <productname>Postgres</productname>
|
||||
distribution.
|
||||
use the <application>createuser</application> script provided with
|
||||
the <productname>Postgres</productname> distribution.
|
||||
</para>
|
||||
|
||||
<refsect2 id="R2-SQL-CREATEUSER-3">
|
||||
|
@ -219,11 +199,13 @@ CREATE USER<replaceable class="PARAMETER"> username</replaceable>
|
|||
Notes
|
||||
</title>
|
||||
<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>
|
||||
Use DROP USER or ALTER USER statements to remove or modify a user
|
||||
account.</para>
|
||||
Use <command>DROP USER</command> or <command>ALTER USER</command>
|
||||
statements to remove or modify a user account.
|
||||
</para>
|
||||
<para>
|
||||
Refer to the <filename>pg_shadow</filename> table for further information.
|
||||
</para>
|
||||
|
@ -251,31 +233,37 @@ CREATE USER<replaceable class="PARAMETER"> username</replaceable>
|
|||
</title>
|
||||
<para>
|
||||
Create a user with no password:
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
CREATE USER jonathan
|
||||
CREATE USER jonathan
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Create a user with a password:
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
CREATE USER davide WITH PASSWORD jw8s0F4
|
||||
CREATE USER davide WITH PASSWORD jw8s0F4
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
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
|
||||
valid:
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
CREATE USER miriam WITH PASSWORD jw8s0F4 VALID UNTIL 'Jan 1 2002'
|
||||
CREATE USER miriam WITH PASSWORD jw8s0F4 VALID UNTIL 'Jan 1 2002'
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Create an account where the user can create databases:
|
||||
</para>
|
||||
<programlisting>
|
||||
CREATE USER manuel WITH PASSWORD jw8s0F4 CREATEDB
|
||||
</programlisting>
|
||||
|
||||
<programlisting>
|
||||
CREATE USER manuel WITH PASSWORD jw8s0F4 CREATEDB
|
||||
</programlisting>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id="R1-SQL-CREATEUSER-3">
|
||||
|
@ -293,7 +281,7 @@ CREATE USER<replaceable class="PARAMETER"> username</replaceable>
|
|||
SQL92
|
||||
</title>
|
||||
<para>
|
||||
There is no CREATE USER statement in SQL92.
|
||||
There is no <command>CREATE USER</command> statement in SQL92.
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
|
|
|
@ -1,166 +1,160 @@
|
|||
<REFENTRY ID="SQL-CREATEVIEW">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<refentry id="SQL-CREATEVIEW">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
CREATE VIEW
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
CREATE VIEW
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
Constructs a virtual table
|
||||
</REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Constructs a virtual table
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-09-21</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
CREATE VIEW <REPLACEABLE CLASS="PARAMETER">view</REPLACEABLE>
|
||||
AS SELECT <REPLACEABLE CLASS="PARAMETER">query</REPLACEABLE>
|
||||
</SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-09-21</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
CREATE VIEW <replaceable class="PARAMETER">view</replaceable>
|
||||
AS SELECT <replaceable class="PARAMETER">query</replaceable>
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATEVIEW-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-21</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATEVIEW-1">
|
||||
<refsect2info>
|
||||
<date>1998-09-21</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<ReturnValue><replaceable class="parameter">view</replaceable></ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><replaceable class="parameter">view</replaceable></term>
|
||||
<listitem>
|
||||
<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>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<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>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATEVIEW-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-21</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<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>
|
||||
</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>
|
||||
<ReturnValue>
|
||||
WARN amcreate: "<replaceable class="parameter">view</replaceable>" relation already exists
|
||||
</ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</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>
|
||||
<ReturnValue>NOTICE create: attribute named "<replaceable class="parameter">column</replaceable>" has an unknown type</ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</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'
|
||||
CREATE VIEW vista AS SELECT 'Hello World'
|
||||
</programlisting>
|
||||
whereas this command does not:
|
||||
<programlisting>
|
||||
CREATE VIEW vista AS SELECT 'Hello World'::text
|
||||
CREATE VIEW vista AS SELECT 'Hello World'::text
|
||||
</programlisting>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</VARIABLELIST>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATEVIEW-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-09-21</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATEVIEW-1">
|
||||
<refsect1info>
|
||||
<date>1998-09-21</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
CREATE VIEW will define a view of a table. This view is
|
||||
</title>
|
||||
<para>
|
||||
<command>CREATE VIEW</command> will define a view of a table. This view is
|
||||
not physically materialized. Specifically, a query
|
||||
rewrite retrieve rule is automatically generated
|
||||
to support retrieve operations on views.
|
||||
</PARA>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATEVIEW-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-21</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATEVIEW-3">
|
||||
<refsect2info>
|
||||
<date>1998-09-21</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
<PARA>
|
||||
Use the DROP VIEW statement to drop views.
|
||||
</PARA>
|
||||
</title>
|
||||
<para>
|
||||
Use the <command>DROP VIEW</command> statement to drop views.
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATEVIEW-4">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-21</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATEVIEW-4">
|
||||
<refsect2info>
|
||||
<date>1998-09-21</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Bugs
|
||||
</TITLE>
|
||||
</title>
|
||||
<para>
|
||||
Currently, views are read only.
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATEVIEW-2">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATEVIEW-2">
|
||||
<title>
|
||||
Usage
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
Create a view consisting of all Comedy films:
|
||||
</PARA>
|
||||
<ProgramListing>
|
||||
|
||||
<programlisting>
|
||||
CREATE VIEW kinds AS
|
||||
SELECT *
|
||||
FROM films
|
||||
|
@ -172,89 +166,77 @@ code |title |did| date_prod|kind |len
|
|||
-----+-------------------------+---+----------+----------+------
|
||||
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
|
||||
</ProgramListing>
|
||||
</programlisting>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</REFSECT1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-CREATEVIEW-3">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-CREATEVIEW-3">
|
||||
<title>
|
||||
Compatibility
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
</title>
|
||||
<para>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-CREATEVIEW-5">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-21</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-CREATEVIEW-5">
|
||||
<refsect2info>
|
||||
<date>1998-09-21</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
SQL92
|
||||
</TITLE>
|
||||
<PARA>
|
||||
SQL92 specifies some additional capabilities for the CREATE VIEW statement:
|
||||
</PARA>
|
||||
</title>
|
||||
<para>
|
||||
SQL92 specifies some additional capabilities for the
|
||||
<command>CREATE VIEW</command> statement:
|
||||
</para>
|
||||
<synopsis>
|
||||
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>] [, ...]
|
||||
FROM <replaceable class="parameter">table</replaceable>
|
||||
[ WHERE <replaceable class="parameter">condition</replaceable> ]
|
||||
AS SELECT <replaceable class="parameter">expression</replaceable> [ AS <replaceable class="parameter">colname</replaceable> ] [, ...]
|
||||
FROM <replaceable class="parameter">table</replaceable> [ WHERE <replaceable class="parameter">condition</replaceable> ]
|
||||
[ WITH [ CASCADE | LOCAL ] CHECK OPTION ]
|
||||
</synopsis>
|
||||
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
CHECK OPTION
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA> This option is to do with updatable views.
|
||||
<para>
|
||||
The optional clauses for the full SQL92 command are:
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>CHECK OPTION</term>
|
||||
<listitem>
|
||||
<para>
|
||||
This option is to do with updatable views.
|
||||
All INSERTs and UPDATEs on the view will be
|
||||
checked to ensure data satisfy the view-defining
|
||||
condition. If they do not, the update will be rejected.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
LOCAL
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>LOCAL</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Check for integrity on this view.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
CASCADE
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>CASCADE</term>
|
||||
<listitem>
|
||||
<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>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
</REFENTRY>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
|
|
|
@ -1,56 +1,51 @@
|
|||
<REFENTRY ID="APP-CREATEDB">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<refentry id="APP-CREATEDB">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
<application>createdb</application>
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>Application</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>Application</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
<application>createdb</application>
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Create a new <productname>Postgres</productname> database
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-10-02</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
createdb [ <replaceable class="parameter">dbname</replaceable> ]
|
||||
createdb [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
|
||||
[ -D <replaceable class="parameter">datadir</replaceable> ]
|
||||
[ -u ] [ <replaceable class="parameter">dbname</replaceable> ]
|
||||
</SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-10-02</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
createdb [ <replaceable class="parameter">dbname</replaceable> ]
|
||||
createdb [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
|
||||
[ -D <replaceable class="parameter">datadir</replaceable> ] [ -u ] [ <replaceable class="parameter">dbname</replaceable> ]
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-APP-CREATEDB-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-10-02</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-APP-CREATEDB-1">
|
||||
<refsect2info>
|
||||
<date>1998-10-02</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
-h <replaceable class="parameter">host</replaceable>
|
||||
</term>
|
||||
<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..
|
||||
rather than an IP connection.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
-p <replaceable class="parameter">port</replaceable>
|
||||
</term>
|
||||
<term>-p <replaceable class="parameter">port</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the Internet TCP/IP port or local Unix domain socket file
|
||||
|
@ -63,9 +58,7 @@
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-u
|
||||
</term>
|
||||
<term>-u</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Use password authentication.
|
||||
|
@ -77,9 +70,7 @@
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-D <replaceable class="parameter">datadir</replaceable>
|
||||
</term>
|
||||
<term>-D <replaceable class="parameter">datadir</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the alternate database location for this database installation.
|
||||
|
@ -90,9 +81,7 @@
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<replaceable class="parameter">dbname</replaceable>
|
||||
</term>
|
||||
<term><replaceable class="parameter">dbname</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the name of the database to be created. The name must be
|
||||
|
@ -109,26 +98,25 @@
|
|||
</para>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-APP-CREATEDB-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-10-02</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-APP-CREATEDB-2">
|
||||
<refsect2info>
|
||||
<date>1998-10-02</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<application>createdb</application> will create files in the
|
||||
<filename><envar>PGDATA</envar>/<replaceable class="parameter">dbname</replaceable>/</filename>
|
||||
data area for the new database.
|
||||
|
||||
<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>'?
|
||||
createdb: database creation failed on <replaceable class="parameter">dbname</replaceable>.
|
||||
</term>
|
||||
<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>'?
|
||||
createdb: database creation failed on <replaceable class="parameter">dbname</replaceable>.
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<application>createdb</application> could not attach to the
|
||||
|
@ -143,11 +131,11 @@
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
Connection to database 'template1' failed.
|
||||
FATAL 1: SetUserId: user '<replaceable class="parameter">username</replaceable>' is not in 'pg_shadow'
|
||||
createdb: database creation failed on <replaceable class="parameter">dbname</replaceable>.
|
||||
</term>
|
||||
<term><computeroutput>
|
||||
Connection to database 'template1' failed.
|
||||
FATAL 1: SetUserId: user '<replaceable class="parameter">username</replaceable>' is not in 'pg_shadow'
|
||||
createdb: database creation 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>
|
||||
|
@ -158,10 +146,10 @@
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
ERROR: user '<replaceable class="parameter">username</replaceable>' is not allowed to create/destroy databases
|
||||
createdb: database creation failed on <replaceable class="parameter">dbname</replaceable>.
|
||||
</term>
|
||||
<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.
|
||||
|
@ -171,10 +159,10 @@
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
ERROR: createdb: database '<replaceable class="parameter">dbname</replaceable>' already exists.
|
||||
createdb: database creation failed on <replaceable class="parameter">dbname</replaceable>.
|
||||
</term>
|
||||
<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.
|
||||
|
@ -183,9 +171,9 @@
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
createdb: database creation failed on <replaceable class="parameter">dbname</replaceable>.
|
||||
</term>
|
||||
<term><computeroutput>
|
||||
createdb: database creation failed on <replaceable class="parameter">dbname</replaceable>.
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
An internal error occurred in <application>psql</application>
|
||||
|
@ -201,21 +189,21 @@
|
|||
<note>
|
||||
<para>
|
||||
<application>createdb</application> internally runs
|
||||
CREATE DATABASE from <application>psql</application>
|
||||
<command>CREATE DATABASE</command> from <application>psql</application>
|
||||
while connected to the <literal>template1</literal> database.
|
||||
</para>
|
||||
</note>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-APP-CREATEDB-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-10-02</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-APP-CREATEDB-1">
|
||||
<refsect1info>
|
||||
<date>1998-10-02</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<application>createdb</application> creates a new
|
||||
<productname>Postgres</productname> database.
|
||||
The person who executes this command becomes
|
||||
|
@ -236,31 +224,51 @@
|
|||
<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">.
|
||||
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>
|
||||
<refsect1 id="R1-APP-CREATEDB-2">
|
||||
<refsect1info>
|
||||
<date>1998-10-02</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Usage
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
To create the database <literal>demo</literal>
|
||||
using the postmaster on the local host, port 5432:
|
||||
|
||||
<programlisting>
|
||||
createdb demo
|
||||
$ 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
|
||||
$ createdb -p 5000 -h eden demo
|
||||
</programlisting>
|
||||
</para>
|
||||
</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,57 +1,53 @@
|
|||
<REFENTRY ID="APP-CREATEUSER">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<application>createuser</application>
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>Application</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
<application>createuser</application>
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
Create a new <productname>Postgres</productname> user
|
||||
</REFPURPOSE>
|
||||
<refentry id="APP-CREATEUSER">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
<application>createuser</application>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>Application</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
<application>createuser</application>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Create a new <productname>Postgres</productname> user
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-10-02</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-10-02</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
createuser [ <replaceable class="parameter">username</replaceable> ]
|
||||
createuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
|
||||
[ -i <replaceable class="parameter">userid</replaceable> ]
|
||||
[ -d | -D ] [ -u | -U ] [ <replaceable class="parameter">username</replaceable> ]
|
||||
</SYNOPSIS>
|
||||
[ -i <replaceable class="parameter">userid</replaceable> ] [ -d | -D ] [ -u | -U ]
|
||||
[ <replaceable class="parameter">username</replaceable> ]
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-APP-CREATEUSER-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-10-02</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-APP-CREATEUSER-1">
|
||||
<refsect2info>
|
||||
<date>1998-10-02</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
-h <replaceable class="parameter">host</replaceable>
|
||||
</term>
|
||||
<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..
|
||||
rather than an IP connection.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-p <replaceable class="parameter">port</replaceable>
|
||||
</term>
|
||||
<term>-p <replaceable class="parameter">port</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the Internet TCP/IP port or local Unix domain socket file
|
||||
|
@ -64,9 +60,7 @@ createuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-d
|
||||
</term>
|
||||
<term>-d</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Allows the user to create databases.
|
||||
|
@ -75,9 +69,7 @@ createuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-D
|
||||
</term>
|
||||
<term>-D</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Forbids the user to create databases.
|
||||
|
@ -86,13 +78,12 @@ createuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-i <replaceable class="parameter">userid</replaceable>
|
||||
</term>
|
||||
<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
|
||||
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.
|
||||
|
@ -101,9 +92,7 @@ createuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-u
|
||||
</term>
|
||||
<term>-u</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Allows the user to create other users.
|
||||
|
@ -112,9 +101,7 @@ createuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-U
|
||||
</term>
|
||||
<term>-U</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Forbids the user to create other users.
|
||||
|
@ -123,9 +110,7 @@ createuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<replaceable class="parameter">username</replaceable>
|
||||
</term>
|
||||
<term><replaceable class="parameter">username</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the name of the <productname>Postgres</productname> user to be created.
|
||||
|
@ -134,30 +119,28 @@ createuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-APP-CREATEUSER-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-10-02</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-APP-CREATEUSER-2">
|
||||
<refsect2info>
|
||||
<date>1998-10-02</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</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>
|
||||
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.
|
||||
</term>
|
||||
<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
|
||||
|
@ -172,11 +155,11 @@ createuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
Connection to database 'template1' failed.
|
||||
FATAL 1: SetUserId: user '<replaceable class="parameter">username</replaceable>' is not in 'pg_shadow'
|
||||
createuser: database access failed.
|
||||
</term>
|
||||
<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>
|
||||
|
@ -187,9 +170,9 @@ createuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
createuser: <replaceable class="parameter">username</replaceable> cannot create users.
|
||||
</term>
|
||||
<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
|
||||
|
@ -199,21 +182,21 @@ createuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
createuser: user "<replaceable class="parameter">username</replaceable>" already exists
|
||||
</term>
|
||||
<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.
|
||||
The user to be added already has an entry in the
|
||||
<literal>pg_shadow</literal> class.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
database access failed
|
||||
</term>
|
||||
<term><computeroutput>
|
||||
database access failed
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
An internal error occurred in <application>psql</application>
|
||||
|
@ -223,28 +206,27 @@ createuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
<note>
|
||||
<para>
|
||||
<application>createuser</application> internally runs
|
||||
CREATE USER from <application>psql</application>
|
||||
<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">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-10-02</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-APP-CREATEUSER-1">
|
||||
<refsect1info>
|
||||
<date>1998-10-02</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<application>createuser</application> creates a
|
||||
new <productname>Postgres</productname> user.
|
||||
Only users with <literal>usesuper</literal> set in
|
||||
|
@ -264,13 +246,15 @@ createuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
|||
<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">.
|
||||
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.
|
||||
</para>
|
||||
|
||||
<note>
|
||||
<para>
|
||||
The <productname>Postgres</productname> user identifier
|
||||
|
@ -278,6 +262,7 @@ createuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
|||
they are assigned to be the same.
|
||||
</para>
|
||||
</note>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
You must also describe the privileges of the new user for security purposes.
|
||||
|
@ -287,4 +272,21 @@ createuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
|||
is allowed to create other new users.
|
||||
</para>
|
||||
</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,227 +1,215 @@
|
|||
<REFENTRY ID="SQL-DECLARE">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<refentry id="SQL-DECLARE">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
DECLARE
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
DECLARE
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Defines a cursor for table access
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-09-04</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-09-04</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
DECLARE <replaceable class="parameter">cursor</replaceable> [ BINARY ] [ INSENSITIVE ] [ SCROLL ]
|
||||
CURSOR FOR <replaceable class="parameter">query</replaceable>
|
||||
[ FOR { READ ONLY | UPDATE [ OF <replaceable class="parameter">column</replaceable> [, ...] ] ]
|
||||
</SYNOPSIS>
|
||||
<REFSECT2 ID="R2-SQL-DECLARE-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
</synopsis>
|
||||
<refsect2 id="R2-SQL-DECLARE-1">
|
||||
<refsect2info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<replaceable class="parameter">cursor</replaceable>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><replaceable class="parameter">cursor</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of the cursor to be used in subsequent FETCH operations..
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
BINARY
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<varlistentry>
|
||||
<term>BINARY</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Causes the cursor to fetch data in binary
|
||||
rather than in text format.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
INSENSITIVE
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<varlistentry>
|
||||
<term>INSENSITIVE</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<acronym>SQL92</acronym> keyword indicating that data retrieved
|
||||
from the cursor should be unaffected by updates from other processes or cursors.
|
||||
Since cursor operations occur within transactions
|
||||
from the cursor should be unaffected by updates from other processes or cursors.
|
||||
Since cursor operations occur within transactions
|
||||
in <productname>Postgres</productname> this is always the case.
|
||||
This keyword has no effect.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
This keyword has no effect.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
SCROLL
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<acronym>SQL92</acronym> keyword indicating that data may be retrieved
|
||||
in multiple rows per FETCH operation. Since this is allowed at all times
|
||||
by <productname>Postgres</productname> this keyword has no effect.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
<varlistentry>
|
||||
<term>SCROLL</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<acronym>SQL92</acronym> keyword indicating that data may be retrieved
|
||||
in multiple rows per FETCH operation. Since this is allowed at all times
|
||||
by <productname>Postgres</productname> this keyword has no effect.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<replaceable class="parameter">query</replaceable>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<varlistentry>
|
||||
<term><replaceable class="parameter">query</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
An SQL query which will provide the rows to be governed by the
|
||||
cursor.
|
||||
Refer to the SELECT statement for further information about
|
||||
valid arguments.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
READ ONLY
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<acronym>SQL92</acronym> keyword indicating that the cursor will be used
|
||||
in a readonly mode. Since this is the only cursor access mode
|
||||
available in <productname>Postgres</productname> this keyword has no effect.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
UPDATE
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<acronym>SQL92</acronym> keyword indicating that the cursor will be used
|
||||
to update tables. Since cursor updates are not currently
|
||||
supported in <productname>Postgres</productname> this keyword
|
||||
provokes an informational error message.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<replaceable class="parameter">column</replaceable>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
Column(s) to be updated.
|
||||
Since cursor updates are not currently
|
||||
supported in <productname>Postgres</productname> the UPDATE clause
|
||||
provokes an informational error message.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
|
||||
</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>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-DECLARE-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-09-04</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<varlistentry>
|
||||
<term>READ ONLY</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<acronym>SQL92</acronym> keyword indicating that the cursor will be used
|
||||
in a readonly mode. Since this is the only cursor access mode
|
||||
available in <productname>Postgres</productname> this keyword has no effect.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>UPDATE</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<acronym>SQL92</acronym> keyword indicating that the cursor will be used
|
||||
to update tables. Since cursor updates are not currently
|
||||
supported in <productname>Postgres</productname> this keyword
|
||||
provokes an informational error message.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><replaceable class="parameter">column</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Column(s) to be updated.
|
||||
Since cursor updates are not currently
|
||||
supported in <productname>Postgres</productname> the UPDATE clause
|
||||
provokes an informational error message.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<refsect2 id="R2-SQL-DECLARE-2">
|
||||
<refsect2info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect2info>
|
||||
<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
|
||||
</TITLE>
|
||||
<PARA>
|
||||
DECLARE allows a user to create cursors, which can be used to retrieve
|
||||
</title>
|
||||
<para>
|
||||
<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
|
||||
data either in text or in binary foramt.
|
||||
</PARA>
|
||||
<PARA>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Normal cursors return data in text format, either ASCII or another
|
||||
encoding scheme depending on how the <productname>Postgres</productname>
|
||||
backend was built. Since
|
||||
encoding scheme depending on how the <productname>Postgres</productname>
|
||||
backend was built. Since
|
||||
data is stored natively in binary format, the system must
|
||||
do a conversion to produce the text format. In addition,
|
||||
text formats are often larger in size than the corresponding binary format.
|
||||
Once the information comes back in text form, the client
|
||||
application may have to convert it to a binary format to
|
||||
manipulate it anyway.
|
||||
</PARA>
|
||||
<PARA>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
BINARY cursors give you back the data in the native binary
|
||||
representation. So binary cursors will tend to be a
|
||||
little faster since they suffer less conversion overhead.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
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
|
||||
whereas with a binary cursor you would get
|
||||
you would get a string of '1' with a default cursor
|
||||
whereas with a binary cursor you would get
|
||||
a 4-byte value equal to control-A ('^A').
|
||||
|
||||
<caution>
|
||||
<para>
|
||||
BINARY cursors should be used carefully. User applications such
|
||||
|
@ -230,7 +218,8 @@ whereas with a binary cursor you would get
|
|||
</para>
|
||||
</caution>
|
||||
</para>
|
||||
<PARA>
|
||||
|
||||
<para>
|
||||
However, string representation is architecture-neutral whereas binary
|
||||
representation can differ between different machine architectures.
|
||||
Therefore, if your client machine and server machine use different
|
||||
|
@ -245,19 +234,19 @@ whereas with a binary cursor you would get
|
|||
effort on the client side.
|
||||
</para>
|
||||
</tip>
|
||||
</PARA>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DECLARE-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-04</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DECLARE-3">
|
||||
<refsect2info>
|
||||
<date>1998-09-04</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
Cursors are only available in transactions.
|
||||
</PARA>
|
||||
<PARA>
|
||||
</para>
|
||||
<para>
|
||||
<productname>Postgres</productname>
|
||||
does not have an explicit <command>OPEN cursor</command>
|
||||
statement; a cursor is considered to be open when it is declared.
|
||||
|
@ -271,39 +260,39 @@ whereas with a binary cursor you would get
|
|||
involving DECLARE and OPEN statements.
|
||||
</para>
|
||||
</note>
|
||||
|
||||
</PARA>
|
||||
</REFSECT2>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-DECLARESTATEMENT-2">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-DECLARESTATEMENT-2">
|
||||
<title>
|
||||
Usage
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
To declare a cursor:
|
||||
</PARA>
|
||||
<ProgramListing>
|
||||
|
||||
<programlisting>
|
||||
DECLARE liahona CURSOR
|
||||
FOR SELECT * FROM films;
|
||||
</ProgramListing>
|
||||
</REFSECT1>
|
||||
</programlisting>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-DECLARESTATEMENT-3">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-DECLARESTATEMENT-3">
|
||||
<title>
|
||||
Compatibility
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
</title>
|
||||
<para>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DECLARESTATEMENT-4">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DECLARESTATEMENT-4">
|
||||
<refsect2info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
SQL92
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<acronym>SQL92</acronym> allows cursors only in embedded <acronym>SQL</acronym>
|
||||
and in modules. <productname>Postgres</productname> permits cursors to be used
|
||||
interactively.
|
||||
|
@ -314,12 +303,12 @@ DECLARE liahona CURSOR
|
|||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
</REFENTRY>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
|
|
|
@ -1,128 +1,122 @@
|
|||
<REFENTRY ID="SQL-DELETE">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<refentry id="SQL-DELETE">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
DELETE
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
DELETE
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Deletes rows from a table
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
DELETE FROM <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> [ WHERE <REPLACEABLE CLASS="PARAMETER">condition</REPLACEABLE> ]
|
||||
</SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-04-15</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
DELETE FROM <replaceable class="PARAMETER">table</replaceable> [ WHERE <replaceable class="PARAMETER">condition</replaceable> ]
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DELETE-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DELETE-1">
|
||||
<refsect2info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<replaceable class="parameter">table</replaceable>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</title>
|
||||
<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">condition</replaceable>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</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>
|
||||
</para>
|
||||
<para>
|
||||
Refer to the SELECT statement for further description
|
||||
of the WHERE clause.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</REFSECT2>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DELETE-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<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>
|
||||
</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>
|
||||
</para>
|
||||
<para>
|
||||
If <replaceable class="parameter">count</replaceable> is 0,
|
||||
no rows were deleted.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</VARIABLELIST>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-DELETE-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-DELETE-1">
|
||||
<refsect1info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
DELETE removes rows which satisfy the WHERE <replaceable class="parameter">condition</replaceable>,
|
||||
from the specified table.
|
||||
</PARA>
|
||||
<PARA>
|
||||
If the <replaceable class="parameter">condition</replaceable> is absent,
|
||||
</title>
|
||||
<para>
|
||||
<command>DELETE</command> removes rows which satisfy the WHERE
|
||||
clause from the specified table.
|
||||
</para>
|
||||
<para>
|
||||
If the <firstterm>condition</firstterm> (WHERE clause) is absent,
|
||||
the effect is to delete all rows in the 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
|
||||
it, as well as read access to any table whose values are
|
||||
read in the <replaceable class="parameter">condition</replaceable>.
|
||||
</PARA>
|
||||
</REFSECT1>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-DELETE-2">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-DELETE-2">
|
||||
<title>
|
||||
Usage
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
Remove all films but musicals:
|
||||
</PARA>
|
||||
<ProgramListing>
|
||||
DETETE FROM films WHERE kind <> 'Musical';
|
||||
|
||||
<programlisting>
|
||||
DELETE FROM films WHERE kind <> 'Musical';
|
||||
SELECT * FROM films;
|
||||
|
||||
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
|
||||
WD101|Bed Knobs and Broomsticks|111| |Musical | 01:57
|
||||
(3 rows)
|
||||
</ProgramListing>
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Clear the table <literal>films</literal>:
|
||||
</para>
|
||||
<programlisting>
|
||||
DELETE FROM films;
|
||||
|
||||
SELECT * FROM films;
|
||||
|
||||
code|title|did|date_prod|kind|len
|
||||
----+-----+---+---------+----+---
|
||||
(0 rows)
|
||||
</programlisting>
|
||||
</REFSECT1>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-DELETE-3">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-DELETE-3">
|
||||
<title>
|
||||
Compatibility
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
</title>
|
||||
<para>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DELETE-4">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DELETE-4">
|
||||
<refsect2info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
SQL92
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</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>
|
||||
DELETE FROM <replaceable class="parameter">table</replaceable> WHERE
|
||||
CURRENT OF <replaceable class="parameter">cursor</replaceable>
|
||||
</synopsis>
|
||||
<para>
|
||||
where <replaceable class="parameter">cursor</replaceable> identifies an open cursor. Interactive cursors in <productname>Postgres</productname> are read-only.
|
||||
|
||||
where <replaceable class="parameter">cursor</replaceable>
|
||||
identifies an open cursor.
|
||||
Interactive cursors in <productname>Postgres</productname> are read-only.
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
</REFENTRY>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
|
|
|
@ -1,56 +1,52 @@
|
|||
<REFENTRY ID="APP-DESTROYDB">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<application>destroydb</application>
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>Application</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
<application>destroydb</application>
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
Remove an existing <productname>Postgres</productname> database
|
||||
</REFPURPOSE>
|
||||
<refentry id="APP-DESTROYDB">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
<application>destroydb</application>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>Application</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
<application>destroydb</application>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Remove an existing <productname>Postgres</productname> database
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-10-02</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-10-02</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
destroydb [ <replaceable class="parameter">dbname</replaceable> ]
|
||||
destroydb [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
|
||||
[ -i ] [ <replaceable class="parameter">dbname</replaceable> ]
|
||||
</SYNOPSIS>
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-APP-DESTROYDB-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-10-02</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-APP-DESTROYDB-1">
|
||||
<refsect2info>
|
||||
<date>1998-10-02</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
-h <replaceable class="parameter">host</replaceable>
|
||||
</term>
|
||||
<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..
|
||||
rather than an IP connection.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-p <replaceable class="parameter">port</replaceable>
|
||||
</term>
|
||||
<term>-p <replaceable class="parameter">port</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the Internet TCP/IP port or local Unix domain socket file
|
||||
|
@ -63,9 +59,7 @@ destroydb [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replace
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-i
|
||||
</term>
|
||||
<term>-i</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Run in interactive mode.
|
||||
|
@ -75,9 +69,7 @@ destroydb [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replace
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<replaceable class="parameter">dbname</replaceable>
|
||||
</term>
|
||||
<term><replaceable class="parameter">dbname</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the name of the database to be destroyed. The database
|
||||
|
@ -90,31 +82,30 @@ destroydb [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replace
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-APP-DESTROYDB-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-10-02</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-APP-DESTROYDB-2">
|
||||
<refsect2info>
|
||||
<date>1998-10-02</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</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>
|
||||
Connection to database 'template1' failed.
|
||||
connectDB() failed: Is the postmaster running and accepting connections
|
||||
<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>.
|
||||
</term>
|
||||
destroydb: database destroy failed on <replaceable class="parameter">dbname</replaceable>.
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<application>destroydb</application> could not attach to the
|
||||
|
@ -129,11 +120,11 @@ destroydb [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replace
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
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>.
|
||||
</term>
|
||||
<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>
|
||||
|
@ -144,10 +135,10 @@ destroydb [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replace
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
ERROR: user '<replaceable class="parameter">username</replaceable>' is not allowed to create/destroy databases
|
||||
destroydb: database destroy failed on <replaceable class="parameter">dbname</replaceable>.
|
||||
</term>
|
||||
<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.
|
||||
|
@ -157,10 +148,10 @@ destroydb [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replace
|
|||
</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>
|
||||
<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
|
||||
|
@ -170,10 +161,10 @@ destroydb [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replace
|
|||
</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>
|
||||
<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.
|
||||
|
@ -182,9 +173,9 @@ destroydb [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replace
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
destroydb: database destroy failed on <replaceable class="parameter">dbname</replaceable>.
|
||||
</term>
|
||||
<term><computeroutput>
|
||||
destroydb: database destroy failed on <replaceable class="parameter">dbname</replaceable>.
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
An internal error occurred in <application>psql</application>
|
||||
|
@ -194,7 +185,6 @@ destroydb [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replace
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</para>
|
||||
<note>
|
||||
|
@ -207,14 +197,14 @@ destroydb [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replace
|
|||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-APP-DESTROYDB-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-10-02</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-APP-DESTROYDB-1">
|
||||
<refsect1info>
|
||||
<date>1998-10-02</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<application>destroydb</application> destroys an existing
|
||||
<productname>Postgres</productname> database.
|
||||
The person who executes this command must be
|
||||
|
@ -240,18 +230,19 @@ destroydb [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replace
|
|||
<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">.
|
||||
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>
|
||||
<refsect1 id="R1-APP-DESTROYDB-2">
|
||||
<refsect1info>
|
||||
<date>1998-10-02</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Usage
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
To destroy the database <literal>demo</literal>
|
||||
using the postmaster on the local host, port 5432:
|
||||
<programlisting>
|
||||
|
@ -266,4 +257,21 @@ destroydb [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replace
|
|||
</programlisting>
|
||||
</para>
|
||||
</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,56 +1,52 @@
|
|||
<REFENTRY ID="APP-DESTROYUSER">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<application>destroyuser</application>
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>Application</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
<application>destroyuser</application>
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
Destroy a <productname>Postgres</productname> user and associated databases
|
||||
</REFPURPOSE>
|
||||
<refentry id="APP-DESTROYUSER">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
<application>destroyuser</application>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>Application</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
<application>destroyuser</application>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Destroy a <productname>Postgres</productname> user and associated databases
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-10-02</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-10-02</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
destroyuser [ <replaceable class="parameter">username</replaceable> ]
|
||||
destroyuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
|
||||
[ <replaceable class="parameter">username</replaceable> ]
|
||||
</SYNOPSIS>
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-APP-DESTROYUSER-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-10-02</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-APP-DESTROYUSER-1">
|
||||
<refsect2info>
|
||||
<date>1998-10-02</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
-h <replaceable class="parameter">host</replaceable>
|
||||
</term>
|
||||
<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..
|
||||
rather than an IP connection.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-p <replaceable class="parameter">port</replaceable>
|
||||
</term>
|
||||
<term>-p <replaceable class="parameter">port</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the Internet TCP/IP port or local Unix domain socket file
|
||||
|
@ -63,9 +59,7 @@ destroyuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <repla
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<replaceable class="parameter">username</replaceable>
|
||||
</term>
|
||||
<term><replaceable class="parameter">username</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the name of the <productname>Postgres</productname> user to be removed.
|
||||
|
@ -74,19 +68,18 @@ destroyuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <repla
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-APP-DESTROYUSER-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-10-02</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-APP-DESTROYUSER-2">
|
||||
<refsect2info>
|
||||
<date>1998-10-02</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</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
|
||||
|
@ -94,12 +87,12 @@ destroyuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <repla
|
|||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
Connection to database 'template1' failed.
|
||||
connectDB() failed: Is the postmaster running and accepting connections
|
||||
<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.
|
||||
</term>
|
||||
destroyuser: database access failed.
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<application>destroyuser</application> could not attach to the
|
||||
|
@ -114,11 +107,11 @@ destroyuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <repla
|
|||
</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>
|
||||
<term><computeroutput>
|
||||
Connection to database 'template1' failed.
|
||||
FATAL 1: SetUserId: user '<replaceable class="parameter">username</replaceable>' is not in 'pg_shadow'
|
||||
destroyuser: database access failed.
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
You do not have a valid entry in the relation <literal>pg_shadow</literal>
|
||||
|
@ -129,9 +122,9 @@ destroyuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <repla
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
destroyuser: <replaceable class="parameter">username</replaceable> cannot delete users.
|
||||
</term>
|
||||
<term><computeroutput>
|
||||
destroyuser: <replaceable class="parameter">username</replaceable> cannot delete users.
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
You do not have permission to delete users; contact your
|
||||
|
@ -141,21 +134,21 @@ destroyuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <repla
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
destroyuser: user "<replaceable class="parameter">username</replaceable>" already exists
|
||||
</term>
|
||||
<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.
|
||||
The user to be added already has an entry in the
|
||||
<literal>pg_shadow</literal> class.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
database access failed
|
||||
</term>
|
||||
<term><computeroutput>
|
||||
database access failed
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
An internal error occurred in <application>psql</application>
|
||||
|
@ -167,9 +160,9 @@ destroyuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <repla
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
destroydb on <replaceable class="parameter">dbname</replaceable> failed - exiting
|
||||
</term>
|
||||
<term><computeroutput>
|
||||
destroydb on <replaceable class="parameter">dbname</replaceable> failed - exiting
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
An internal error occurred in <application>psql</application>
|
||||
|
@ -180,9 +173,9 @@ destroyuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <repla
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
delete of user <replaceable class="parameter">username</replaceable> was UNSUCCESSFUL
|
||||
</term>
|
||||
<term><computeroutput>
|
||||
delete of user <replaceable class="parameter">username</replaceable> was UNSUCCESSFUL
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
An internal error occurred in <application>psql</application>
|
||||
|
@ -190,28 +183,27 @@ destroyuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <repla
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
<note>
|
||||
<para>
|
||||
<application>destroyuser</application> internally runs
|
||||
DROP USER from <application>psql</application>
|
||||
<command>DROP USER</command> from <application>psql</application>
|
||||
while connected to the <literal>template1</literal> database.
|
||||
</para>
|
||||
</note>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-APP-DESTROYUSER-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-10-02</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-APP-DESTROYUSER-1">
|
||||
<refsect1info>
|
||||
<date>1998-10-02</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<application>destroyuser</application> removes an existing
|
||||
<productname>Postgres</productname> user
|
||||
and the databases for which that user
|
||||
|
@ -233,7 +225,8 @@ destroyuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <repla
|
|||
<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">.
|
||||
and processed as described in <xref endterm="psql-ref"
|
||||
linkend="app-psql">.
|
||||
</para>
|
||||
<para>
|
||||
Once invoked, <application>destroyuser</application>
|
||||
|
@ -241,4 +234,21 @@ destroyuser [ -h <replaceable class="parameter">host</replaceable> ] [ -p <repla
|
|||
process and permit you to abort the removal of the user if desired.
|
||||
</para>
|
||||
</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,168 +1,164 @@
|
|||
<REFENTRY ID="SQL-DROPAGGREGATE">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<refentry id="SQL-DROPAGGREGATE">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
DROP AGGREGATE
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
DROP AGGREGATE
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Removes the definition of an aggregate function
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
DROP AGGREGATE <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE> <REPLACEABLE CLASS="PARAMETER">type</REPLACEABLE>
|
||||
</SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-04-15</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
DROP AGGREGATE <replaceable class="PARAMETER">name</replaceable> <replaceable class="PARAMETER">type</replaceable>
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPAGGREGATE-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPAGGREGATE-1">
|
||||
<refsect2info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<replaceable class="parameter">name</replaceable>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><replaceable class="parameter">name</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of an existing aggregate function.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<replaceable class="parameter">type</replaceable>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</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>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</REFSECT2>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPAGGREGATE-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<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>
|
||||
</title>
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
DROP
|
||||
</computeroutput></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>
|
||||
</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>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-DROPAGGREGATE-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-DROPAGGREGATE-1">
|
||||
<refsect1info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<command>DROP AGGREGATE</command> will remove all references to an existing
|
||||
aggregate definition. To execute this command the current
|
||||
user must be the owner of the aggregate.
|
||||
</PARA>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPAGGREGATE-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPAGGREGATE-3">
|
||||
<refsect2info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
The <command>DROP AGGREGATE</command> statement is a
|
||||
<productname>Postgres</productname>
|
||||
<productname>Postgres</productname>
|
||||
language extension.
|
||||
</PARA>
|
||||
<PARA>
|
||||
</para>
|
||||
<para>
|
||||
Refer to the <command>CREATE AGGREGATE</command> statement to
|
||||
create aggregate functions.
|
||||
</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>
|
||||
</para>
|
||||
</refsect2>
|
||||
</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
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
|
|
|
@ -1,161 +1,159 @@
|
|||
<REFENTRY ID="SQL-DROPDATABASE">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<refentry id="SQL-DROPDATABASE">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
DROP DATABASE
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
DROP DATABASE
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Destroys an existing database
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
DROP DATABASE <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE>
|
||||
</SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-04-15</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
DROP DATABASE <replaceable class="PARAMETER">name</replaceable>
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPDATABASE-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<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>
|
||||
</title>
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><replaceable class="PARAMETER">name</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of an existing database to remove.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</REFSECT2>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPDATABASE-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPDATABASE-2">
|
||||
<refsect2info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<ReturnValue>DESTROYDB</ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
DESTROYDB
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
This message is returned if the command is successful.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<ReturnValue>WARN: destroydb: database "<replaceable class="parameter">name</replaceable>" does not exist.</ReturnValue>
|
||||
</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>
|
||||
</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>
|
||||
</VARIABLELIST>
|
||||
<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>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-DROPDATABASE-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-DROPDATABASE-1">
|
||||
<refsect1info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<command>DROP DATABASE</command> removes the catalog entries for an existing
|
||||
database and deletes the directory containing the data.
|
||||
It can only be executed by the database administrator
|
||||
(See the <command>CREATE DATABASE</command> command for details).
|
||||
</PARA>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPDATABASE-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPDATABASE-3">
|
||||
<refsect2info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
</title>
|
||||
|
||||
<para>
|
||||
DROP DATABASE statement is a <productname>Postgres</productname>
|
||||
<command>DROP DATABASE</command> statement is a <productname>Postgres</productname>
|
||||
language extension.
|
||||
|
||||
<tip>
|
||||
<para>
|
||||
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.
|
||||
</para>
|
||||
</tip>
|
||||
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Refer to the <command>CREATE DATABASE</command> statement for
|
||||
information on how to create a database.
|
||||
</para>
|
||||
</refsect2>
|
||||
</REFSECT1>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-DROPDATABASE-3">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-DROPDATABASE-3">
|
||||
<title>
|
||||
Compatibility
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
</title>
|
||||
<para>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPDATABASE-4">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPDATABASE-4">
|
||||
<refsect2info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
SQL92
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
There is no <command>DROP DATABASE</command> in <acronym>SQL92</acronym>.
|
||||
</PARA>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
</REFENTRY>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
|
|
|
@ -1,179 +1,173 @@
|
|||
<REFENTRY ID="SQL-DROPFUNCTION">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<refentry id="SQL-DROPFUNCTION">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
DROP FUNCTION
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
DROP FUNCTION
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Removes a user-defined C function
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-04-15</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
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>
|
||||
<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>
|
||||
</title>
|
||||
<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>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<ReturnValue>DROP</ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
Message returned if the command completes successfully.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<ReturnValue>WARN RemoveFunction: Function "<replaceable class="parameter">name</replaceable>" ("<replaceable class="parameter">types</replaceable>") does not exist</ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
This message is given if the function specified does not
|
||||
exist in the current database.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</VARIABLELIST>
|
||||
<varlistentry>
|
||||
<term><replaceable class="parameter">type</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The type of function parameters.
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-DROPFUNCTION-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPFUNCTION-2">
|
||||
<refsect2info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect2info>
|
||||
<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
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
DROP FUNCTION will remove references to an existing C
|
||||
function. To execute this command the user must be the
|
||||
owner of the function. The input argument types to the
|
||||
function must be specified, as only the function with the
|
||||
given name and argument types will be removed.
|
||||
</PARA>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPFUNCTION-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<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>
|
||||
</title>
|
||||
<para>
|
||||
Refer to <command>CREATE FUNCTION</command>
|
||||
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">
|
||||
<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>
|
||||
</para>
|
||||
</refsect2>
|
||||
</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
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
|
|
|
@ -1,157 +1,156 @@
|
|||
<REFENTRY ID="SQL-DROPINDEX">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<refentry id="SQL-DROPINDEX">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
DROP INDEX
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
DROP INDEX
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Removes an index from a database
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
DROP INDEX <REPLACEABLE CLASS="PARAMETER">index_name</REPLACEABLE>
|
||||
</SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-04-15</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
DROP INDEX <replaceable class="PARAMETER">index_name</replaceable>
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPINDEX-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPINDEX-1">
|
||||
<refsect2info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<ReturnValue><REPLACEABLE CLASS="PARAMETER">index_name</REPLACEABLE></ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><replaceable class="PARAMETER">index_name</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of the index to remove.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</REFSECT2>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPINDEX-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<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>
|
||||
</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>
|
||||
<ReturnValue>ERROR: index "<REPLACEABLE CLASS="PARAMETER">index_name</REPLACEABLE>" nonexistent</ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
This message occurs if <REPLACEABLE CLASS="PARAMETER">index_name</REPLACEABLE>
|
||||
</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>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-DROPINDEX-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-DROPINDEX-1">
|
||||
<refsect1info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<command>DROP INDEX</command> drops an existing index from the database
|
||||
system. To execute this command you must be the owner of
|
||||
the index.
|
||||
</PARA>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPINDEX-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPINDEX-3">
|
||||
<refsect2info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<command>DROP INDEX</command> is a <productname>Postgres</productname>
|
||||
language extension.
|
||||
</PARA>
|
||||
<PARA>
|
||||
</para>
|
||||
<para>
|
||||
Refer to the <command>CREATE INDEX</command> statement for
|
||||
information on how to create indexes.
|
||||
</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>
|
||||
</para>
|
||||
</refsect2>
|
||||
</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
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
|
|
|
@ -1,172 +1,170 @@
|
|||
<REFENTRY ID="SQL-DROPLANGUAGE">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<refentry id="SQL-DROPLANGUAGE">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
DROP LANGUAGE
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
DROP LANGUAGE
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Removes a user-defined procedural language
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
DROP PROCEDURAL LANGUAGE '<REPLACEABLE CLASS="PARAMETER">langname</REPLACEABLE>'
|
||||
</SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-04-15</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
DROP PROCEDURAL LANGUAGE '<replaceable class="PARAMETER">name</replaceable>'
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPLANGUAGE-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPLANGUAGE-1">
|
||||
<refsect2info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<REPLACEABLE CLASS="PARAMETER">langname</REPLACEABLE>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
The name of an existing language.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</variablelist>
|
||||
</REFSECT2>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<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.
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><replaceable class="PARAMETER">name</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of an existing procedural language.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</VARIABLELIST>
|
||||
</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 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 ID="R2-SQL-DROPLANGUAGE-4">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPLANGUAGE-2">
|
||||
<refsect2info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect2info>
|
||||
<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
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
No checks are made if functions or trigger procedures registered
|
||||
in this language still exist. To re-enable them without having
|
||||
to drop and recreate all the functions, the pg_proc's prolang
|
||||
attribute of the functions must be adjusted to the new object
|
||||
ID of the recreated pg_language entry for the PL.
|
||||
</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>
|
||||
</para>
|
||||
</refsect2>
|
||||
</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
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
|
|
|
@ -1,207 +1,204 @@
|
|||
<REFENTRY ID="SQL-DROPOPERATOR">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<refentry id="SQL-DROPOPERATOR">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
DROP OPERATOR
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
DROP OPERATOR
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Removes an operator from the database
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
DROP OPERATOR <REPLACEABLE CLASS="PARAMETER">id</REPLACEABLE> ( <REPLACEABLE CLASS="PARAMETER">type</REPLACEABLE> | NONE [,...] )
|
||||
</SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-09-22</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
DROP OPERATOR <replaceable class="PARAMETER">id</replaceable> ( <replaceable class="PARAMETER">type</replaceable> | NONE [,...] )
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPOPERATOR-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPOPERATOR-1">
|
||||
<refsect2info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<replaceable class="parameter">id</replaceable>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><replaceable class="parameter">id</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The identifier of an existing operator.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<replaceable class="parameter">type</replaceable>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><replaceable class="parameter">type</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The type of function parameters.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</REFSECT2>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPOPERATOR-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPOPERATOR-2">
|
||||
<refsect2info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<ReturnValue>DROP</ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
DROP
|
||||
</computeroutput></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>
|
||||
</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>
|
||||
<ReturnValue>ERROR: RemoveOperator: left unary operator '<REPLACEABLE CLASS="PARAMETER">id</REPLACEABLE>' taking '<REPLACEABLE CLASS="PARAMETER">type</REPLACEABLE>' does not exist</ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</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>
|
||||
<ReturnValue>ERROR: RemoveOperator: right unary operator '<REPLACEABLE CLASS="PARAMETER">id</REPLACEABLE>' taking '<REPLACEABLE CLASS="PARAMETER">type</REPLACEABLE>' does not exist</ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</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>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-DROPOPERATOR-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-DROPOPERATOR-1">
|
||||
<refsect1info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
The DROP OPERATOR statement drops an existing operator from the
|
||||
</title>
|
||||
<para>
|
||||
<command>DROP OPERATOR</command> drops an existing operator from the
|
||||
database.
|
||||
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
|
||||
operator, respectively, may be specified as NONE.
|
||||
</PARA>
|
||||
operator, respectively, may be specified as <literal>NONE</literal>.
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPOPERATOR-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPOPERATOR-3">
|
||||
<refsect2info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
The <command>DROP OPERATOR</command> statement is a
|
||||
<productname>Postgres</productname>
|
||||
<productname>Postgres</productname>
|
||||
language extension.
|
||||
</PARA>
|
||||
<PARA>
|
||||
</para>
|
||||
<para>
|
||||
Refer to <command>CREATE OPERATOR</command> for
|
||||
information on how to create operators.
|
||||
</PARA>
|
||||
<PARA>
|
||||
</para>
|
||||
<para>
|
||||
It is the user's responsibility to remove any access methods and
|
||||
operator classes that rely on the deleted operator.
|
||||
</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>
|
||||
</para>
|
||||
</refsect2>
|
||||
</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
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
|
|
|
@ -1,168 +1,166 @@
|
|||
<REFENTRY ID="SQL-DROPRULE">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<refentry id="SQL-DROPRULE">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
DROP RULE
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
DROP RULE
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Removes an existing rule from the database
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
DROP RULE <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE>
|
||||
</SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-09-22</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
DROP RULE <replaceable class="PARAMETER">name</replaceable>
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPRULE-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPRULE-1">
|
||||
<refsect2info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<replaceable class="parameter">name</replaceable>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><replaceable class="parameter">name</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of an existing rule to drop.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</REFSECT2>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPRULE-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<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>
|
||||
</title>
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
DROP
|
||||
</computeroutput></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>
|
||||
</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>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-DROPRULE-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-DROPRULE-1">
|
||||
<refsect1info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<command>DROP RULE</command> drops a rule from the specified
|
||||
<productname>Postgres</productname> rule
|
||||
system. <productname>Postgres</productname>
|
||||
will immediately cease enforcing it and
|
||||
will purge its definition from the system catalogs.
|
||||
</PARA>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPRULE-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPRULE-3">
|
||||
<refsect2info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
The <command>DROP RULE</command> statement is a
|
||||
<productname>Postgres</productname>
|
||||
language extension.
|
||||
</PARA>
|
||||
<PARA>
|
||||
</para>
|
||||
<para>
|
||||
Refer to <command>CREATE RULE</command> for
|
||||
information on how to create rules.
|
||||
</PARA>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPRULE-4">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPRULE-4">
|
||||
<refsect2info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Bugs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
Once a rule is dropped, access to historical information
|
||||
the rule has written may disappear.
|
||||
</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>
|
||||
</para>
|
||||
</refsect2>
|
||||
</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
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
|
|
|
@ -1,155 +1,153 @@
|
|||
<REFENTRY ID="SQL-DROPSEQUENCE">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<refentry id="SQL-DROPSEQUENCE">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
DROP SEQUENCE
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
DROP SEQUENCE
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Removes an existing sequence
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
DROP SEQUENCE <REPLACEABLE CLASS="PARAMETER">seqname</REPLACEABLE> [, ...]
|
||||
</SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-09-22</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
DROP SEQUENCE <replaceable class="PARAMETER">name</replaceable> [, ...]
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPSEQUENCE-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPSEQUENCE-1">
|
||||
<refsect2info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<REPLACEABLE CLASS="PARAMETER">seqname</REPLACEABLE>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><replaceable class="PARAMETER">name</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of a sequence.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</REFSECT2>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPSEQUENCE-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPSEQUENCE-2">
|
||||
<refsect2info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<ReturnValue>DROP</ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
DROP
|
||||
</computeroutput></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>
|
||||
</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>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-DROPSEQUENCE-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-DROPSEQUENCE-1">
|
||||
<refsect1info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<command>DROP SEQUENCE</command> removes sequence number generators from the
|
||||
data base. With the current implementation of sequences as
|
||||
special tables it works just like the <command>DROP TABLE</command>
|
||||
statement.
|
||||
</PARA>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPSEQUENCE-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPSEQUENCE-3">
|
||||
<refsect2info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
The <command>DROP SEQUENCE</command> statement is a
|
||||
<productname>Postgres</productname>
|
||||
language extension.
|
||||
</PARA>
|
||||
<PARA>
|
||||
</para>
|
||||
<para>
|
||||
Refer to the <command>CREATE SEQUENCE</command> statement for
|
||||
information on how to create a sequence.
|
||||
</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>
|
||||
</para>
|
||||
</refsect2>
|
||||
</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
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
|
|
|
@ -1,146 +1,145 @@
|
|||
<REFENTRY ID="SQL-DROPTABLE">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<refentry id="SQL-DROPTABLE">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
DROP TABLE
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
DROP TABLE
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Removes existing tables from a database
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
DROP TABLE <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> [, ...]
|
||||
</SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-09-22</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
DROP TABLE <replaceable class="PARAMETER">name</replaceable> [, ...]
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPTABLE-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPTABLE-1">
|
||||
<refsect2info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<ReturnValue><REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE></ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><replaceable class="PARAMETER">name</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of an existing table or view to drop.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</REFSECT2>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPTABLE-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<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>
|
||||
</title>
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
DROP
|
||||
</computeroutput></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>
|
||||
</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>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-DROPTABLE-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-DROPTABLE-1">
|
||||
<refsect1info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
<command>DROP TABLE</command> removes tables and views from the database.
|
||||
</title>
|
||||
<para>
|
||||
<command>DROP TABLE</command> removes tables and views from the database.
|
||||
Only its owner may destroy a table or view. A table
|
||||
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,
|
||||
they will be removed first. The removal of just a
|
||||
secondary index will not affect the contents of the underlying table.
|
||||
</PARA>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPTABLE-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPTABLE-3">
|
||||
<refsect2info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
Refer to <command>CREATE TABLE</command> and
|
||||
<command>ALTER TABLE</command> for information on
|
||||
how to create or modify tables.
|
||||
</PARA>
|
||||
</REFSECT2>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-DROPTABLE-2">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-DROPTABLE-2">
|
||||
<title>
|
||||
Usage
|
||||
</TITLE>
|
||||
<PARA>
|
||||
To destroy the <literal>films</literal> and
|
||||
<command>distributors</command> tables:
|
||||
</PARA>
|
||||
<ProgramListing>
|
||||
DROP TABLE films, distributors
|
||||
</ProgramListing>
|
||||
</REFSECT1>
|
||||
</title>
|
||||
<para>
|
||||
To destroy two tables, <literal>films</literal> and
|
||||
<command>distributors</command>:
|
||||
|
||||
<REFSECT1 ID="R1-SQL-DROPTABLE-3">
|
||||
<TITLE>
|
||||
<programlisting>
|
||||
DROP TABLE films, distributors;
|
||||
</programlisting>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id="R1-SQL-DROPTABLE-3">
|
||||
<title>
|
||||
Compatibility
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
</title>
|
||||
<para>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPTABLE-4">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPTABLE-4">
|
||||
<refsect2info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
SQL92
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
SQL92 specifies some additional capabilities for DROP TABLE:
|
||||
</PARA>
|
||||
</para>
|
||||
<synopsis>
|
||||
DROP TABLE <replaceable class="parameter">table</replaceable> { RESTRICT | CASCADE }
|
||||
</synopsis>
|
||||
|
@ -172,12 +171,12 @@ DROP TABLE <replaceable class="parameter">table</replaceable> { RESTRICT | CASCA
|
|||
</tip>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
</REFENTRY>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
|
|
|
@ -1,184 +1,162 @@
|
|||
<REFENTRY ID="SQL-DROPTRIGGER">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<refentry id="SQL-DROPTRIGGER">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
DROP TRIGGER
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
DROP TRIGGER
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Removes the definition of a trigger
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
DROP TRIGGER <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE> ON <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>
|
||||
</SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-09-22</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
DROP TRIGGER <replaceable class="PARAMETER">name</replaceable> ON <replaceable class="PARAMETER">table</replaceable>
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPTRIGGER-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<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>
|
||||
</title>
|
||||
<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>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><replaceable class="PARAMETER">table</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of a table.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</REFSECT2>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPTRIGGER-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPTRIGGER-2">
|
||||
<refsect2info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<ReturnValue>DROP</ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
DROP
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The message returned if the trigger is successfully dropped.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<ReturnValue>ERROR: DropTrigger: there is no trigger <REPLACEABLE CLASS="PARAMETER">name</REPLACEABLE> on relation "<replaceable class="parameter">table</replaceable>"</ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</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>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-DROPTRIGGER-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-DROPTRIGGER-1">
|
||||
<refsect1info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<command>DROP TRIGGER</command> will remove all references to an existing
|
||||
trigger definition. To execute this command the current
|
||||
user must be the owner of the trigger.
|
||||
</PARA>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPTRIGGER-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPTRIGGER-3">
|
||||
<refsect2info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<command>DROP TRIGGER</command> is a <productname>Postgres</productname>
|
||||
language extension.
|
||||
</PARA>
|
||||
<PARA>
|
||||
</para>
|
||||
<para>
|
||||
Refer to <command>CREATE TRIGGER</command> for
|
||||
information on how to create triggers.
|
||||
</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>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
</REFENTRY>
|
||||
|
||||
<!--
|
||||
<REPLACEABLE CLASS="PARAMETER">
|
||||
</REPLACEABLE>
|
||||
<ReturnValue></ReturnValue>
|
||||
<PARA>
|
||||
</PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>•
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</VARIABLELIST>
|
||||
<PARA>
|
||||
</PARA>
|
||||
-->
|
||||
<refsect1 id="R1-SQL-DROPTRIGGER-2">
|
||||
<title>
|
||||
Usage
|
||||
</title>
|
||||
<para>
|
||||
Destroy the <literal>if_dist_exists</literal> trigger
|
||||
on table <literal>films</literal>:
|
||||
|
||||
<programlisting>
|
||||
DROP TRIGGER if_dist_exists ON films;
|
||||
</programlisting>
|
||||
</para>
|
||||
</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>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
|
|
|
@ -1,172 +1,170 @@
|
|||
<REFENTRY ID="SQL-DROPTYPE">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<refentry id="SQL-DROPTYPE">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
DROP TYPE
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
DROP TYPE
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Removes a user-defined type from the system catalogs
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
DROP TYPE <REPLACEABLE CLASS="PARAMETER">typename</REPLACEABLE>
|
||||
</SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-09-22</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
DROP TYPE <replaceable class="PARAMETER">typename</replaceable>
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPTYPE-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPTYPE-1">
|
||||
<refsect2info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<REPLACEABLE CLASS="PARAMETER">typename</REPLACEABLE>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><replaceable class="PARAMETER">typename</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of an existing type.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</REFSECT2>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPTYPE-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<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>
|
||||
</title>
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
DROP
|
||||
</computeroutput></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>
|
||||
</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>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-DROPTYPE-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-DROPTYPE-1">
|
||||
<refsect1info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<command>DROP TYPE</command> will remove a user type from the
|
||||
system catalogs.
|
||||
</PARA>
|
||||
<PARA>
|
||||
</para>
|
||||
<para>
|
||||
Only the owner of a type can remove it.
|
||||
</PARA>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPTYPE-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPTYPE-3">
|
||||
<refsect2info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
DROP TYPE statement is a <productname>Postgres</productname>
|
||||
language extension.
|
||||
</PARA>
|
||||
<PARA>
|
||||
</para>
|
||||
<para>
|
||||
Refer to <command>CREATE TYPE</command> for
|
||||
inforamation on how to create types.
|
||||
</PARA>
|
||||
<PARA>
|
||||
</para>
|
||||
<para>
|
||||
It is the user's responsibility to remove any operators,
|
||||
functions, aggregates, access methods, subtypes, and classes
|
||||
that use a deleted type.
|
||||
</PARA>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPTYPE-4">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPTYPE-4">
|
||||
<refsect2info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Bugs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
If a built-in type is removed, the behavior of the backend
|
||||
is unpredictable.
|
||||
</PARA>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-DROPTYPE-2">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-DROPTYPE-2">
|
||||
<title>
|
||||
Usage
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
To remove the <literal>box</literal> type:
|
||||
</PARA>
|
||||
<ProgramListing>
|
||||
DROP TYPE box
|
||||
</ProgramListing>
|
||||
</REFSECT1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-DROPTYPE-3">
|
||||
<TITLE>
|
||||
<programlisting>
|
||||
DROP TYPE box;
|
||||
</programlisting>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id="R1-SQL-DROPTYPE-3">
|
||||
<title>
|
||||
Compatibility
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
</title>
|
||||
<para>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPTYPE-5">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPTYPE-5">
|
||||
<refsect2info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
SQL3
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
DROP TYPE is a <acronym>SQL3</acronym> statement.
|
||||
</PARA>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
</REFENTRY>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
|
|
|
@ -1,91 +1,90 @@
|
|||
<REFENTRY ID="SQL-DROPUSER">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<refentry id="SQL-DROPUSER">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
DROP USER
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
DROP USER
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Removes an user account information
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
DROP USER <REPLACEABLE CLASS="PARAMETER">username</REPLACEABLE>
|
||||
</SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-09-22</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
DROP USER <replaceable class="PARAMETER">name</replaceable>
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPUSER-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPUSER-1">
|
||||
<refsect2info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<REPLACEABLE CLASS="PARAMETER">username</REPLACEABLE>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><replaceable class="PARAMETER">name</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of an existing user.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</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>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-DROPUSER-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPUSER-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 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
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<command>DROP USER</command> removes the specified
|
||||
user from the database,
|
||||
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
|
||||
can be used in place of the <application>destroyuser</application>
|
||||
script, regardless of how the user was created.
|
||||
</PARA>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPUSER-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPUSER-3">
|
||||
<refsect2info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<command>DROP USER</command> is a <productname>Postgres</productname>
|
||||
language extension.
|
||||
</PARA>
|
||||
<PARA>
|
||||
</para>
|
||||
<para>
|
||||
Refer to <command>CREATE USER</command> and
|
||||
<command>ALTER USER</command> for information on
|
||||
how to create or modify user accounts.
|
||||
</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>
|
||||
</para>
|
||||
</refsect2>
|
||||
</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
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
|
|
|
@ -1,76 +1,74 @@
|
|||
<REFENTRY ID="SQL-DROPVIEW">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<refentry id="SQL-DROPVIEW">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
DROP VIEW
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
DROP VIEW
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Removes an existing view from a database
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
DROP VIEW <REPLACEABLE CLASS="PARAMETER">view</REPLACEABLE>
|
||||
</SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-09-22</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
DROP VIEW <replaceable class="PARAMETER">name</replaceable>
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPVIEW-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPVIEW-1">
|
||||
<refsect2info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<REPLACEABLE CLASS="PARAMETER">view</REPLACEABLE>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><replaceable class="PARAMETER">name</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of an existing view.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</REFSECT2>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPVIEW-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPVIEW-2">
|
||||
<refsect2info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<ReturnValue>DROP</ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
DROP
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The message returned if the command is successful.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<ReturnValue>
|
||||
ERROR: RewriteGetRuleEventRel: rule "_RET<REPLACEABLE CLASS="PARAMETER">view</REPLACEABLE>" not found</ReturnValue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<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
|
||||
the database.
|
||||
</para>
|
||||
|
@ -78,83 +76,83 @@ DROP VIEW <REPLACEABLE CLASS="PARAMETER">view</REPLACEABLE>
|
|||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-DROPVIEW-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-DROPVIEW-1">
|
||||
<refsect1info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<command>DROP VIEW</command> drops an existing view from the database.
|
||||
To execute this command you must be the owner of the
|
||||
view.
|
||||
</PARA>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPVIEW-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPVIEW-3">
|
||||
<refsect2info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
The <productname>Postgres</productname>
|
||||
<command>DROP TABLE</command> statement also drops views.
|
||||
</PARA>
|
||||
<PARA>
|
||||
</para>
|
||||
<para>
|
||||
Refer to <command>CREATE VIEW</command>
|
||||
for information on how to create views.
|
||||
</PARA>
|
||||
</REFSECT2>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-DROPVIEW-2">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-DROPVIEW-2">
|
||||
<title>
|
||||
Usage
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
This command will remove the view called <literal>kinds</literal>:
|
||||
</PARA>
|
||||
<ProgramListing>
|
||||
</para>
|
||||
<programlisting>
|
||||
DROP VIEW kinds;
|
||||
</ProgramListing>
|
||||
</REFSECT1>
|
||||
</programlisting>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-DROPVIEW-3">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-DROPVIEW-3">
|
||||
<title>
|
||||
Compatibility
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
</title>
|
||||
<para>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-DROPVIEW-4">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-DROPVIEW-4">
|
||||
<refsect2info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
SQL92
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<acronym>SQL92</acronym> specifies some additional capabilities for
|
||||
<command>DROP VIEW</command>:
|
||||
</PARA>
|
||||
|
||||
<synopsis>
|
||||
DROP VIEW <replaceable class="parameter">view</replaceable> { RESTRICT | CASCADE }
|
||||
</synopsis>
|
||||
</para>
|
||||
|
||||
<REFSECT3 ID="R3-SQL-DROPVIEW-1">
|
||||
<REFSECT3INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT3INFO>
|
||||
<TITLE>
|
||||
<refsect3 id="R3-SQL-DROPVIEW-1">
|
||||
<refsect3info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect3info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>RESTRICT</term>
|
||||
|
@ -178,31 +176,27 @@ DROP VIEW <replaceable class="parameter">view</replaceable> { RESTRICT | CASCADE
|
|||
</para>
|
||||
</refsect3>
|
||||
|
||||
<REFSECT3 ID="R3-SQL-DROPVIEW-2">
|
||||
<REFSECT3INFO>
|
||||
<DATE>1998-09-22</DATE>
|
||||
</REFSECT3INFO>
|
||||
<TITLE>
|
||||
<refsect3 id="R3-SQL-DROPVIEW-2">
|
||||
<refsect3info>
|
||||
<date>1998-09-22</date>
|
||||
</refsect3info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
<para>
|
||||
<tip>
|
||||
</title>
|
||||
<para>
|
||||
At present, to remove a referenced view from a
|
||||
<productname>Postgres</productname> database,
|
||||
you must drop it explicitly.
|
||||
</para>
|
||||
</tip>
|
||||
</para>
|
||||
</refsect3>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
</REFENTRY>
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-omittag:nil
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
|
|
|
@ -1,186 +1,180 @@
|
|||
<REFENTRY ID="SQL-EXPLAIN">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
EXPLAIN
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
EXPLAIN
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
Shows statement execution details
|
||||
</REFPURPOSE>
|
||||
</refnamediv>
|
||||
<refentry id="SQL-EXPLAIN">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
EXPLAIN
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
EXPLAIN
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Shows statement execution details
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-09-01</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
EXPLAIN [ VERBOSE ] <REPLACEABLE CLASS="PARAMETER">query</REPLACEABLE>
|
||||
</SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-09-01</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
EXPLAIN [ VERBOSE ] <replaceable class="PARAMETER">query</replaceable>
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-EXPLAIN-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-01</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
<refsect2 id="R2-SQL-EXPLAIN-1">
|
||||
<refsect2info>
|
||||
<date>1998-09-01</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
VERBOSE
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
Flag to show detailed query plan.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<REPLACEABLE CLASS="PARAMETER">query</REPLACEABLE>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
Any <REPLACEABLE CLASS="PARAMETER">query</REPLACEABLE>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</VARIABLELIST>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>VERBOSE</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Flag to show detailed query plan.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><replaceable class="PARAMETER">query</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Any <replaceable class="PARAMETER">query</replaceable>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-EXPLAIN-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
Outputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
<refsect2 id="R2-SQL-EXPLAIN-2">
|
||||
<refsect2info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
NOTICE: QUERY PLAN:
|
||||
<replaceable>plan</replaceable>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
Explicit query plan from the <productname>Postgres</productname> backend.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Explicit query plan from the <productname>Postgres</productname> backend.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
EXPLAIN
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
Flag sent after query plan is shown.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</VARIABLELIST>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Flag sent after query plan is shown.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-EXPLAIN-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
<refsect1 id="R1-SQL-EXPLAIN-1">
|
||||
<refsect1info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</title>
|
||||
<para>
|
||||
This command outputs details about the supplied query.
|
||||
The default output is the computed query cost.
|
||||
The cost value is only meaningful to the optimizer in comparing
|
||||
various query plans.
|
||||
VERBOSE displays the full query plan and cost to your screen,
|
||||
and pretty-prints the plan to the postmaster log file.
|
||||
</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>
|
||||
</para>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-EXPLAIN-2">
|
||||
<TITLE>
|
||||
Usage
|
||||
</TITLE>
|
||||
<PARA>
|
||||
To show a query plan for a simple query:
|
||||
<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>
|
||||
|
||||
<ProgramListing>
|
||||
postgres=> explain select * from foo;
|
||||
<refsect1 id="R1-SQL-EXPLAIN-2">
|
||||
<title>
|
||||
Usage
|
||||
</title>
|
||||
<para>
|
||||
To show a query plan for a simple query:
|
||||
|
||||
<programlisting>
|
||||
EXPLAIN select * from foo;
|
||||
NOTICE: QUERY PLAN:
|
||||
|
||||
Seq Scan on foo (cost=0.00 rows=0 width=4)
|
||||
|
||||
EXPLAIN
|
||||
</ProgramListing>
|
||||
</para>
|
||||
</REFSECT1>
|
||||
</programlisting>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-EXPLAIN-3">
|
||||
<TITLE>
|
||||
Compatibility
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
<refsect1 id="R1-SQL-EXPLAIN-3">
|
||||
<title>
|
||||
Compatibility
|
||||
</title>
|
||||
<para>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-EXPLAIN-4">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-01</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
SQL92
|
||||
</TITLE>
|
||||
<PARA>
|
||||
There is no EXPLAIN statement defined in SQL92.
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
</REFENTRY>
|
||||
<refsect2 id="R2-SQL-EXPLAIN-4">
|
||||
<refsect2info>
|
||||
<date>1998-09-01</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
SQL92
|
||||
</title>
|
||||
<para>
|
||||
There is no <command>EXPLAIN</command> statement defined in SQL92.
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!--
|
||||
<REPLACEABLE CLASS="PARAMETER">
|
||||
</REPLACEABLE>
|
||||
<ReturnValue></ReturnValue>
|
||||
<PARA>
|
||||
</PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>•
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</VARIABLELIST>
|
||||
<PARA>
|
||||
</PARA>
|
||||
<!-- 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,300 +1,287 @@
|
|||
<REFENTRY ID="SQL-FETCH">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
FETCH
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
FETCH
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
Gets rows using a cursor
|
||||
</REFPURPOSE>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-09-01</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
FETCH [ <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>
|
||||
<refentry id="SQL-FETCH">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
FETCH
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
FETCH
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Gets rows using a cursor
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-09-01</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
FETCH [ <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>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-FETCH-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-01</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
<refsect2 id="R2-SQL-FETCH-1">
|
||||
<refsect2info>
|
||||
<date>1998-09-01</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<REPLACEABLE CLASS="PARAMETER">selector</REPLACEABLE>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<REPLACEABLE CLASS="PARAMETER">selector</REPLACEABLE>
|
||||
defines the fetch direction. It can be one
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><replaceable class="PARAMETER">selector</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<replaceable class="PARAMETER">selector</replaceable>
|
||||
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>
|
||||
<TERM>
|
||||
<REPLACEABLE CLASS="PARAMETER">count</REPLACEABLE>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<REPLACEABLE CLASS="PARAMETER">count</REPLACEABLE>
|
||||
determines how many rows to fetch. It can be one of the following:
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><replaceable class="PARAMETER">count</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<replaceable class="PARAMETER">count</replaceable>
|
||||
determines how many rows to fetch. It can be one of the following:
|
||||
|
||||
<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>
|
||||
<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>
|
||||
<term>
|
||||
ALL
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Retrieve all remaining rows.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
ALL
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
Retrieve all remaining rows.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
NEXT
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Equivalent to specifying a count of <command>1</command>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
NEXT
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
Equivalent to specifying a count of <command>1</command>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
PRIOR
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Equivalent to specifying a count of <command>-1</command>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
PRIOR
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
Equivalent to specifying a count of <command>-1</command>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><replaceable class="PARAMETER">cursor</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
An open cursor's name.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<REPLACEABLE CLASS="PARAMETER">cursor</REPLACEABLE>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
An open cursor's name.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
<refsect2 id="R2-SQL-FETCH-2">
|
||||
<refsect2info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</title>
|
||||
<para>
|
||||
<command>FETCH</command> returns the results of the query defined by the specified cursor.
|
||||
The following messages will be returned if the query fails:
|
||||
|
||||
<REFSECT2 ID="R2-SQL-FETCH-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
Outputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
FETCH returns the results of the query defined by the specified cursor.
|
||||
The following messages will be returned if the query fails:
|
||||
</para>
|
||||
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
NOTICE: PerformPortalFetch: portal "<REPLACEABLE CLASS="PARAMETER">cursor</REPLACEABLE>" not found
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
If <REPLACEABLE CLASS="PARAMETER">cursor</REPLACEABLE>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
NOTICE: PerformPortalFetch: portal "<replaceable class="PARAMETER">cursor</replaceable>" not found
|
||||
</computeroutput></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>
|
||||
The cursor must be declared within a transaction block.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
NOTICE: FETCH/ABSOLUTE not supported, using RELATIVE
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<productname>Postgres</productname> does not support absolute
|
||||
positioning of cursors.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<productname>Postgres</productname> does not support absolute
|
||||
positioning of cursors.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
ERROR: FETCH/RELATIVE at current position is not supported
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<acronym>SQL92</acronym> allows one to repetatively retrieve the cursor
|
||||
at its "current position" using the syntax
|
||||
<programlisting>
|
||||
FETCH RELATIVE 0 FROM <REPLACEABLE CLASS="PARAMETER">cursor</REPLACEABLE>
|
||||
</programlisting>
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<acronym>SQL92</acronym> allows one to repetatively retrieve the cursor
|
||||
at its "current position" using the syntax
|
||||
<synopsis>
|
||||
FETCH RELATIVE 0 FROM <replaceable class="PARAMETER">cursor</replaceable>
|
||||
</synopsis>
|
||||
</para>
|
||||
|
||||
<productname>Postgres</productname> does not currently support
|
||||
this notion; in fact the value zero is reserved to indicate that
|
||||
all rows should be retrieved and is equivalent to specifying the ALL keyword.
|
||||
If the RELATIVE keyword has been used, the <productname>Postgres</productname>
|
||||
assumes that the user intended <acronym>SQL92</acronym> behavior
|
||||
and returns this error message.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<para>
|
||||
<productname>Postgres</productname> does not currently support
|
||||
this notion; in fact the value zero is reserved to indicate that
|
||||
all rows should be retrieved and is equivalent to specifying the ALL keyword.
|
||||
If the RELATIVE keyword has been used, the <productname>Postgres</productname>
|
||||
assumes that the user intended <acronym>SQL92</acronym> behavior
|
||||
and returns this error message.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-FETCH-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
<refsect1 id="R1-SQL-FETCH-1">
|
||||
<refsect1info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</title>
|
||||
<para>
|
||||
FETCH allows a user to retrieve rows using a cursor.
|
||||
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
|
||||
than <REPLACEABLE CLASS="PARAMETER">#</REPLACEABLE>,
|
||||
than <replaceable class="PARAMETER">#</replaceable>,
|
||||
then only those available are fetched.
|
||||
Substituting the keyword ALL in place of a number will
|
||||
cause all remaining rows in the cursor to be retrieved.
|
||||
Instances may be fetched in both FORWARD and BACKWARD
|
||||
directions. The default direction is FORWARD.
|
||||
|
||||
<tip>
|
||||
<para>
|
||||
Negative numbers are now allowed to be specified for the
|
||||
row count. A negative number is equivalent to reversing
|
||||
the sense of the FORWARD and BACKWARD keywords. For example,
|
||||
<command>FORWARD -1</command> is the same as <command>BACKWARD 1</command>.
|
||||
</para>
|
||||
</tip>
|
||||
</para>
|
||||
<para>
|
||||
Note that the FORWARD and BACKWARD keywords are
|
||||
<tip>
|
||||
<para>
|
||||
Negative numbers are now allowed to be specified for the
|
||||
row count. A negative number is equivalent to reversing
|
||||
the sense of the FORWARD and BACKWARD keywords. For example,
|
||||
<command>FORWARD -1</command> is the same as <command>BACKWARD 1</command>.
|
||||
</para>
|
||||
</tip>
|
||||
</para>
|
||||
<para>
|
||||
Note that the FORWARD and BACKWARD keywords are
|
||||
<productname>Postgres</productname> extensions.
|
||||
The <acronym>SQL92</acronym> syntax is also supported, specified
|
||||
in the second form of the command. See below for details
|
||||
on compatibility issues.
|
||||
</para>
|
||||
<para>
|
||||
The <acronym>SQL92</acronym> syntax is also supported, specified
|
||||
in the second form of the command. See below for details
|
||||
on compatibility issues.
|
||||
</para>
|
||||
<para>
|
||||
Once all rows are fetched, every other fetch access returns
|
||||
no rows.
|
||||
</para>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<para>
|
||||
Updating data in a cursor is not supported by
|
||||
<productname>Postgres</productname>,
|
||||
<productname>Postgres</productname>,
|
||||
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,
|
||||
users must issue explicit UPDATE commands to replace data.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<para>
|
||||
Cursors may only be used inside of transactions because
|
||||
the data that they store spans multiple user queries.
|
||||
</para>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-FETCH-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-04-15</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
Notes
|
||||
</TITLE>
|
||||
<PARA>
|
||||
Refer to MOVE statements to change cursor position.
|
||||
Refer to DECLARE statements to declare a cursor.
|
||||
Refer to BEGIN WORK, COMMIT WORK, ROLLBACK WORK statements
|
||||
<refsect2 id="R2-SQL-FETCH-3">
|
||||
<refsect2info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</title>
|
||||
<para>
|
||||
Use <command>MOVE</command> to change cursor position.
|
||||
<command>DECLARE</command> will define a cursor.
|
||||
Refer to <command>BEGIN</command>, <command>COMMIT</command>, and
|
||||
<command>ROLLBACK</command>
|
||||
for further information about transactions.
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</refsect1>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-FETCH-2">
|
||||
<TITLE>
|
||||
Usage
|
||||
</TITLE>
|
||||
<PARA>
|
||||
<ProgramListing>
|
||||
<refsect1 id="R1-SQL-FETCH-2">
|
||||
<title>
|
||||
Usage
|
||||
</title>
|
||||
<para>
|
||||
<programlisting>
|
||||
--set up and use a cursor:
|
||||
--
|
||||
BEGIN WORK;
|
||||
|
@ -326,82 +313,75 @@ Usage
|
|||
--
|
||||
CLOSE liahona;
|
||||
COMMIT WORK;
|
||||
</ProgramListing>
|
||||
</para>
|
||||
</REFSECT1>
|
||||
</programlisting>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-FETCH-3">
|
||||
<TITLE>
|
||||
Compatibility
|
||||
</TITLE>
|
||||
<PARA>
|
||||
The non-embedded use of cursors is a <productname>Postgres</productname>
|
||||
extension. The syntax and usage of cursors is being compared
|
||||
against the embedded form of cursors defined in <acronym>SQL92</acronym>.
|
||||
</PARA>
|
||||
<refsect1 id="R1-SQL-FETCH-3">
|
||||
<title>
|
||||
Compatibility
|
||||
</title>
|
||||
<para>
|
||||
The non-embedded use of cursors is a <productname>Postgres</productname>
|
||||
extension. The syntax and usage of cursors is being compared
|
||||
against the embedded form of cursors defined in <acronym>SQL92</acronym>.
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-FETCH-4">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-01</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
SQL92
|
||||
</TITLE>
|
||||
<PARA>
|
||||
<acronym>SQL92</acronym> allows absolute positioning of the cursor for
|
||||
FETCH, and allows placing the results into explicit variables.
|
||||
<refsect2 id="R2-SQL-FETCH-4">
|
||||
<refsect2info>
|
||||
<date>1998-09-01</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
SQL92
|
||||
</title>
|
||||
<para>
|
||||
<acronym>SQL92</acronym> allows absolute positioning of the cursor for
|
||||
FETCH, and allows placing the results into explicit variables.
|
||||
|
||||
<synopsis>
|
||||
FETCH ABSOLUTE <REPLACEABLE CLASS="PARAMETER">#</REPLACEABLE>
|
||||
FROM <REPLACEABLE CLASS="PARAMETER">cursor</REPLACEABLE>
|
||||
INTO :<REPLACEABLE CLASS="PARAMETER">variable</REPLACEABLE> [, ...]
|
||||
</synopsis>
|
||||
<synopsis>
|
||||
FETCH ABSOLUTE <replaceable class="PARAMETER">#</replaceable>
|
||||
FROM <replaceable class="PARAMETER">cursor</replaceable>
|
||||
INTO :<replaceable class="PARAMETER">variable</replaceable> [, ...]
|
||||
</synopsis>
|
||||
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
ABSOLUTE
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
The cursor should be positioned to the specified absolute
|
||||
row number. All row numbers in <productname>Postgres</productname>
|
||||
are relative numbers so this capability is not supported.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
:<REPLACEABLE CLASS="PARAMETER">variable</REPLACEABLE>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
Target host variable(s).
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
</REFENTRY>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>ABSOLUTE</term>
|
||||
<listitem>
|
||||
<para>
|
||||
The cursor should be positioned to the specified absolute
|
||||
row number. All row numbers in <productname>Postgres</productname>
|
||||
are relative numbers so this capability is not supported.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>:<replaceable class="PARAMETER">variable</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Target host variable(s).
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<!--
|
||||
<REPLACEABLE CLASS="PARAMETER">
|
||||
</REPLACEABLE>
|
||||
<ReturnValue></ReturnValue>
|
||||
<PARA>
|
||||
</PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>•
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</VARIABLELIST>
|
||||
<PARA>
|
||||
</PARA>
|
||||
<!-- 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,130 +1,114 @@
|
|||
<REFENTRY ID="SQL-GRANT">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<refentry id="SQL-GRANT">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
GRANT
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
GRANT
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Grants access privilege to a user, a group or all users
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-09-23</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
GRANT <REPLACEABLE CLASS="PARAMETER">privilege</REPLACEABLE> [, ...]
|
||||
ON <REPLACEABLE CLASS="PARAMETER">object</REPLACEABLE> [, ...]
|
||||
TO { PUBLIC | GROUP <REPLACEABLE CLASS="PARAMETER">group</REPLACEABLE> | <REPLACEABLE CLASS="PARAMETER">username</REPLACEABLE> }
|
||||
</SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-09-23</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
GRANT <replaceable class="PARAMETER">privilege</replaceable> [, ...] ON <replaceable class="PARAMETER">object</replaceable> [, ...]
|
||||
TO { PUBLIC | GROUP <replaceable class="PARAMETER">group</replaceable> | <replaceable class="PARAMETER">username</replaceable> }
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-GRANT-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-23</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-GRANT-1">
|
||||
<refsect2info>
|
||||
<date>1998-09-23</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<REPLACEABLE CLASS="PARAMETER">privilege</REPLACEABLE>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<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>
|
||||
|
||||
<variablelist>
|
||||
<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>
|
||||
<varlistentry>
|
||||
<term>INSERT</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Insert data into all columns of a
|
||||
specific table.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
UPDATE
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<varlistentry>
|
||||
<term>UPDATE</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Update all columns of a specific
|
||||
table.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
DELETE
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<varlistentry>
|
||||
<term>DELETE</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Delete rows from a specific table.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
RULE
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<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>
|
||||
<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>
|
||||
<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">
|
||||
<itemizedlist spacing="compact" mark="bullet">
|
||||
<listitem>
|
||||
<para>
|
||||
table
|
||||
|
@ -153,91 +137,87 @@
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
PUBLIC
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<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.
|
||||
|
||||
<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>
|
||||
<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>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-GRANT-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-23</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-GRANT-2">
|
||||
<refsect2info>
|
||||
<date>1998-09-23</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
CHANGE
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
CHANGE
|
||||
</computeroutput></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>
|
||||
<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>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-GRANT-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-09-23</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-GRANT-1">
|
||||
<refsect1info>
|
||||
<date>1998-09-23</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
GRANT allows the creator of an object to give specific permissions to
|
||||
</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
|
||||
|
@ -252,15 +232,23 @@
|
|||
also drop the object.
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-GRANT-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-23</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-GRANT-3">
|
||||
<refsect2info>
|
||||
<date>1998-09-23</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
<PARA>
|
||||
Use the <command>psql \z</command> command
|
||||
</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>
|
||||
|
@ -287,192 +275,170 @@
|
|||
Currently, to create a GROUP you have to insert
|
||||
data manually into table pg_group as:
|
||||
<programlisting>
|
||||
INSERT INTO pg_group VALUES ('todos');
|
||||
CREATE USER miriam IN GROUP todos;
|
||||
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>
|
||||
|
||||
<para>
|
||||
Refer to REVOKE statements to revoke access privileges.
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-GRANT-2">
|
||||
<TITLE>
|
||||
<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>
|
||||
</title>
|
||||
<para>
|
||||
Grant insert privilege to all users on table films:
|
||||
|
||||
<programlisting>
|
||||
-- grant all privileges to user manuel on view kinds:
|
||||
--
|
||||
GRANT ALL ON kinds TO manuel;
|
||||
</ProgramListing>
|
||||
GRANT INSERT ON films TO PUBLIC;
|
||||
</programlisting>
|
||||
</para>
|
||||
</REFSECT1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-GRANT-3">
|
||||
<TITLE>
|
||||
<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>
|
||||
</title>
|
||||
<para>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-GRANT-4">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-23</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-GRANT-4">
|
||||
<refsect2info>
|
||||
<date>1998-09-23</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
SQL92
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
The <acronym>SQL92</acronym> syntax for GRANT allows setting privileges
|
||||
for individual columns
|
||||
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>
|
||||
<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>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
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>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><replaceable class="PARAMETER">privilege</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<acronym>SQL92</acronym> permits additional privileges to be specified:
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>SELECT</term>
|
||||
<listitem>
|
||||
<para>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
REFERENCES
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<varlistentry>
|
||||
<term>COLLATION</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Allowed to use the specified collation sequence.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
TRANSLATION
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<varlistentry>
|
||||
<term>TRANSLATION</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Allowed to use the specified character set translation.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
DOMAIN
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<varlistentry>
|
||||
<term>DOMAIN</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Allowed to use the specified domain.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
WITH GRANT OPTION
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<varlistentry>
|
||||
<term>WITH GRANT OPTION</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Allowed to grant the same privilege to others.
|
||||
</para>
|
||||
</listitem>
|
||||
|
@ -485,24 +451,21 @@
|
|||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
</REFENTRY>
|
||||
</refentry>
|
||||
|
||||
<!--
|
||||
<REPLACEABLE CLASS="PARAMETER">
|
||||
</REPLACEABLE>
|
||||
<ReturnValue></ReturnValue>
|
||||
<PARA>
|
||||
</PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>•
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</VARIABLELIST>
|
||||
<PARA>
|
||||
</PARA>
|
||||
<!-- 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,49 +1,44 @@
|
|||
<REFENTRY ID="APP-INITDB">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<application>initdb</application>
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>Application</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
<application>initdb</application>
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
Create a new <productname>Postgres</productname> database installation
|
||||
</REFPURPOSE>
|
||||
<refentry id="APP-INITDB">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
<application>initdb</application>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>Application</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
<application>initdb</application>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Create a new <productname>Postgres</productname> database installation
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-10-02</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-10-02</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
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> ]
|
||||
[ --template=<replaceable class="parameter">template</replaceable> | -t <replaceable class="parameter">template</replaceable> ]
|
||||
[ --username=<replaceable class="parameter">name</replaceable> | -u <replaceable class="parameter">name</replaceable> ]
|
||||
[ --noclean | -n ] [ --debug | -d ]
|
||||
</SYNOPSIS>
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-APP-INITDB-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-10-02</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-APP-INITDB-1">
|
||||
<refsect2info>
|
||||
<date>1998-10-02</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
--pglib=<replaceable class="parameter">libdir</replaceable>
|
||||
</term>
|
||||
<term>
|
||||
-l <replaceable class="parameter">libdir</replaceable>
|
||||
</term>
|
||||
<term>
|
||||
<envar>PGLIB</envar>
|
||||
</term>
|
||||
<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>?
|
||||
|
@ -62,15 +57,9 @@ initdb [ --pgdata=<replaceable class="parameter">dbdir</replaceable> | -r <repla
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
--pgdata=<replaceable class="parameter">dbdir</replaceable>
|
||||
</term>
|
||||
<term>
|
||||
-r <replaceable class="parameter">dbdir</replaceable>
|
||||
</term>
|
||||
<term>
|
||||
<envar>PGDATA</envar>
|
||||
</term>
|
||||
<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?
|
||||
|
@ -80,15 +69,9 @@ initdb [ --pgdata=<replaceable class="parameter">dbdir</replaceable> | -r <repla
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
--username=<replaceable class="parameter">name</replaceable>
|
||||
</term>
|
||||
<term>
|
||||
-u <replaceable class="parameter">name</replaceable>
|
||||
</term>
|
||||
<term>
|
||||
<envar>PGUSER</envar>
|
||||
</term>
|
||||
<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
|
||||
|
@ -110,17 +93,14 @@ initdb [ --pgdata=<replaceable class="parameter">dbdir</replaceable> | -r <repla
|
|||
</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>
|
||||
<term>--template=<replaceable class="parameter">template</replaceable></term>
|
||||
<term>-t <replaceable class="parameter">template</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Replace the <literal>template1</literal>
|
||||
|
@ -141,12 +121,8 @@ initdb [ --pgdata=<replaceable class="parameter">dbdir</replaceable> | -r <repla
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
--noclean
|
||||
</term>
|
||||
<term>
|
||||
-n
|
||||
</term>
|
||||
<term>--noclean</term>
|
||||
<term>-n</term>
|
||||
<listitem>
|
||||
<para>
|
||||
By default, when <application>initdb</application>
|
||||
|
@ -160,12 +136,8 @@ initdb [ --pgdata=<replaceable class="parameter">dbdir</replaceable> | -r <repla
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
--debug
|
||||
</term>
|
||||
<term>
|
||||
-d
|
||||
</term>
|
||||
<term>--debug</term>
|
||||
<term>-d</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Print debugging output from the bootstrap backend.
|
||||
|
@ -178,14 +150,13 @@ initdb [ --pgdata=<replaceable class="parameter">dbdir</replaceable> | -r <repla
|
|||
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Files are also input to <application>initdb</application>:
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<application>postconfig</application>
|
||||
</term>
|
||||
<term><application>postconfig</application></term>
|
||||
<listitem>
|
||||
<para>
|
||||
If appearing somewhere in the Unix command search path
|
||||
|
@ -197,9 +168,7 @@ initdb [ --pgdata=<replaceable class="parameter">dbdir</replaceable> | -r <repla
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename><envar>PGLIB</envar>/global1.bki.source</filename>
|
||||
</term>
|
||||
<term><filename><envar>PGLIB</envar>/global1.bki.source</filename></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Contents for the shared catalog tables in the new database system. This
|
||||
|
@ -209,9 +178,7 @@ initdb [ --pgdata=<replaceable class="parameter">dbdir</replaceable> | -r <repla
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename><envar>PGLIB</envar>/local1_template1.bki.source</filename>
|
||||
</term>
|
||||
<term><filename><envar>PGLIB</envar>/local1_template1.bki.source</filename></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Contents for the template1 tables in the new database system. This
|
||||
|
@ -224,29 +191,30 @@ initdb [ --pgdata=<replaceable class="parameter">dbdir</replaceable> | -r <repla
|
|||
</para>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-APP-INITDB-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-26</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<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>
|
||||
</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>
|
||||
<refsect1 id="R1-APP-INITDB-1">
|
||||
<refsect1info>
|
||||
<date>1998-09-26</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<application>initdb</application> creates a new
|
||||
<productname>Postgres</productname> database system.
|
||||
A database system is a
|
||||
|
@ -273,15 +241,31 @@ initdb [ --pgdata=<replaceable class="parameter">dbdir</replaceable> | -r <repla
|
|||
<para>
|
||||
There are three ways to give parameters to <application>initdb</application>.
|
||||
|
||||
First, you can use <application>initdb</application> command options.
|
||||
Second, you can set environment
|
||||
<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>.
|
||||
Third, you can have a program called <application>postconfig</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> parameters to its standard output stream.
|
||||
This third option is not a common thing to do, however.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Command options always override parameters specified any other way.
|
||||
The values returned by <application>postconfig</application>
|
||||
|
@ -290,19 +274,20 @@ initdb [ --pgdata=<replaceable class="parameter">dbdir</replaceable> | -r <repla
|
|||
program may base its output on the environment variables if you want
|
||||
their values to be used.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The value that <application>postconfig</application>
|
||||
outputs must have the format
|
||||
<programlisting>
|
||||
<replaceable>var1</replaceable>=<replaceable class="parameter">value1</replaceable> <replaceable>var2</replaceable>=<replaceable class="parameter">value2</replaceable> ...
|
||||
</programlisting>
|
||||
<synopsis>
|
||||
<replaceable>var1</replaceable>=<replaceable class="parameter">value1</replaceable> <replaceable class="parameter">var2</replaceable>=<replaceable class="parameter">value2</replaceable> ...
|
||||
</synopsis>
|
||||
|
||||
It can output nothing if it doesn't want to supply any parameters.
|
||||
The <replaceable>var</replaceable> values are equal to
|
||||
the corresponding environment variable
|
||||
names. For example,
|
||||
<programlisting>
|
||||
PGDATA=/tmp/postgres_test
|
||||
PGDATA=/tmp/postgres_test
|
||||
</programlisting>
|
||||
has the
|
||||
same effect as invoking <application>initdb</application>
|
||||
|
@ -310,4 +295,21 @@ initdb [ --pgdata=<replaceable class="parameter">dbdir</replaceable> | -r <repla
|
|||
<filename>/tmp/postgres_test</filename>.
|
||||
</para>
|
||||
</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,67 +1,56 @@
|
|||
<REFENTRY ID="APP-INITLOCATION">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<application>initlocation</application>
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>Application</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
<application>initlocation</application>
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
Create a secondary <productname>Postgres</productname> database storage area
|
||||
</REFPURPOSE>
|
||||
<refentry id="APP-INITLOCATION">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
<application>initlocation</application>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>Application</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
<application>initlocation</application>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Create a secondary <productname>Postgres</productname> database storage area
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-10-02</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
initlocation [ --location=<replaceable class="parameter">altdir</replaceable> | -D <replaceable class="parameter">altdir</replaceable> ]
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-10-02</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
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> ]
|
||||
[ <replaceable class="parameter">altdir</replaceable> ]
|
||||
</SYNOPSIS>
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-APP-INITLOCATION-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-10-02</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-APP-INITLOCATION-1">
|
||||
<refsect2info>
|
||||
<date>1998-10-02</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<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>
|
||||
<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>.
|
||||
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>
|
||||
<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?
|
||||
|
@ -84,30 +73,29 @@ initlocation [ --location=<replaceable class="parameter">altdir</replaceable> |
|
|||
</note>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-APP-INITLOCATION-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-26</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-APP-INITLOCATION-2">
|
||||
<refsect2info>
|
||||
<date>1998-09-26</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</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>
|
||||
<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.
|
||||
|
@ -116,12 +104,12 @@ initlocation [ --location=<replaceable class="parameter">altdir</replaceable> |
|
|||
</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>
|
||||
<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.
|
||||
|
@ -130,12 +118,12 @@ initlocation [ --location=<replaceable class="parameter">altdir</replaceable> |
|
|||
</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>
|
||||
<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
|
||||
|
@ -145,11 +133,11 @@ initlocation [ --location=<replaceable class="parameter">altdir</replaceable> |
|
|||
</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>
|
||||
<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.
|
||||
|
@ -162,14 +150,14 @@ initlocation [ --location=<replaceable class="parameter">altdir</replaceable> |
|
|||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-APP-INITLOCATION-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-09-26</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-APP-INITLOCATION-1">
|
||||
<refsect1info>
|
||||
<date>1998-09-26</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</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
|
||||
|
@ -181,6 +169,7 @@ initlocation [ --location=<replaceable class="parameter">altdir</replaceable> |
|
|||
</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>
|
||||
|
@ -207,22 +196,38 @@ initlocation [ --location=<replaceable class="parameter">altdir</replaceable> |
|
|||
</note>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-APP-INITLOCATION-2">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-09-26</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-APP-INITLOCATION-2">
|
||||
<refsect1info>
|
||||
<date>1998-09-26</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Usage
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</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
|
||||
% setenv PGDATA2 /opt/postgres/data
|
||||
% initlocation PGDATA2
|
||||
% createdb -D PGDATA2
|
||||
</programlisting>
|
||||
</para>
|
||||
</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,133 +1,125 @@
|
|||
<REFENTRY ID="SQL-INSERT">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
INSERT
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
INSERT
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
Inserts new rows into a table
|
||||
</REFPURPOSE>
|
||||
<refentry id="SQL-INSERT">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
INSERT
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
INSERT
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Inserts new rows into a table
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-09-23</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
INSERT INTO <REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE> [ ( <REPLACEABLE CLASS="PARAMETER">column</REPLACEABLE> [, ...] ) ]
|
||||
{ VALUES ( <REPLACEABLE CLASS="PARAMETER">expression</REPLACEABLE> [, ...] ) | SELECT <REPLACEABLE CLASS="PARAMETER">query</REPLACEABLE> }
|
||||
</SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-09-23</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
INSERT INTO <replaceable class="PARAMETER">table</replaceable> [ ( <replaceable class="PARAMETER">column</replaceable> [, ...] ) ]
|
||||
{ VALUES ( <replaceable class="PARAMETER">expression</replaceable> [, ...] ) | SELECT <replaceable class="PARAMETER">query</replaceable> }
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-INSERT-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-23</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-INSERT-1">
|
||||
<refsect2info>
|
||||
<date>1998-09-23</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<REPLACEABLE CLASS="PARAMETER">table</REPLACEABLE>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</title>
|
||||
<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>.
|
||||
<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>.
|
||||
<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>
|
||||
<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>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
</VARIABLELIST>
|
||||
|
||||
</REFSECT2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-INSERT-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-23</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-INSERT-2">
|
||||
<refsect2info>
|
||||
<date>1998-09-23</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<ReturnValue>INSERT <replaceable>oid</replaceable></ReturnValue> 1
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<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>
|
||||
<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>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
INSERT 0 <replaceable>#</replaceable>
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Message returned if more than one rows were inserted.
|
||||
<ReturnValue><replaceable>#</replaceable></ReturnValue>
|
||||
<returnvalue><replaceable>#</replaceable></returnvalue>
|
||||
is the number of rows inserted.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</VARIABLELIST>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-INSERT-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-09-02</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<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
|
||||
</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
|
||||
|
@ -143,95 +135,101 @@ Inserts new rows into a table
|
|||
</para>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-INSERT-2">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-INSERT-2">
|
||||
<title>
|
||||
Usage
|
||||
</TITLE>
|
||||
<PARA>
|
||||
<ProgramListing>
|
||||
--Insert a single row into table films;
|
||||
--(in the second example the column date_prod is omitted
|
||||
--therefore will be stored in it a default value of NULL):
|
||||
--
|
||||
INSERT INTO films VALUES
|
||||
</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');
|
||||
|
||||
INSERT INTO films (code, title, did, date_prod, kind)
|
||||
VALUES ('T_601', 'Yojimbo', 106, DATE '1961-06-16', 'Drama');
|
||||
</ProgramListing>
|
||||
|
||||
<ProgramListing>
|
||||
--Insert a single row into table distributors, note that
|
||||
--only column "name" is specified, to the non specified
|
||||
--column "did" will be assigned its default value:
|
||||
--
|
||||
INSERT INTO distributors (name) VALUES ('British Lion');
|
||||
</ProgramListing>
|
||||
|
||||
<ProgramListing>
|
||||
--Insert several rows into table films from table tmp:
|
||||
--
|
||||
INSERT INTO films
|
||||
SELECT * FROM tmp;
|
||||
</ProgramListing>
|
||||
|
||||
<ProgramListing>
|
||||
--Insert into arrays:
|
||||
--Create an empty 3x3 gameboard for noughts-and-crosses
|
||||
--(all of these queries create the same board attribute)
|
||||
--(Refer to the <citetitle>PostgreSQL User's Guide</citetitle> for further
|
||||
--information about arrays).
|
||||
|
||||
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>
|
||||
</programlisting>
|
||||
</para>
|
||||
</REFSECT1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-INSERT-3">
|
||||
<TITLE>
|
||||
<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>
|
||||
</title>
|
||||
<para>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-INSERT-4">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-23</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-INSERT-4">
|
||||
<refsect2info>
|
||||
<date>1998-09-23</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
SQL92
|
||||
</TITLE>
|
||||
<PARA>
|
||||
The INSERT statement is fully compatible with <acronym>SQL92</acronym>.
|
||||
</title>
|
||||
<para>
|
||||
<command>INSERT</command> is fully compatible with <acronym>SQL92</acronym>.
|
||||
Possible limitations in features of the
|
||||
<REPLACEABLE CLASS="PARAMETER">query</REPLACEABLE>
|
||||
<replaceable class="PARAMETER">query</replaceable>
|
||||
clause are documented for the SELECT statement.
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
</REFENTRY>
|
||||
</refentry>
|
||||
|
||||
<!--
|
||||
<REPLACEABLE CLASS="PARAMETER">
|
||||
</REPLACEABLE>
|
||||
<ReturnValue></ReturnValue>
|
||||
<PARA>
|
||||
</PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>•
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
</VARIABLELIST>
|
||||
<PARA>
|
||||
</PARA>
|
||||
<!-- 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,100 +1,98 @@
|
|||
<REFENTRY ID="SQL-LISTEN">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
LISTEN
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
LISTEN
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
Listen for notification on a notify condition
|
||||
</REFPURPOSE>
|
||||
<refentry id="SQL-LISTEN">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
LISTEN
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
LISTEN
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Listen for a response on a notify condition
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-10-07</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
LISTEN <REPLACEABLE CLASS="PARAMETER">notifyname</REPLACEABLE>
|
||||
</SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-10-07</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
LISTEN <replaceable class="PARAMETER">name</replaceable>
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-LISTEN-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-10-07</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-LISTEN-1">
|
||||
<refsect2info>
|
||||
<date>1998-10-07</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<REPLACEABLE CLASS="PARAMETER">notifyname</REPLACEABLE>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><replaceable class="PARAMETER">name</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Name of notify condition.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</VARIABLELIST>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
</REFSECT2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-LISTEN-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-24</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-LISTEN-2">
|
||||
<refsect2info>
|
||||
<date>1998-09-24</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<returnvalue>LISTEN</returnvalue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
LISTEN
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Message returned upon successful completion of registration.
|
||||
</PARA>
|
||||
</LISTITEM>
|
||||
</VARLISTENTRY>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<returnvalue>NOTICE Async_Listen: We are already listening on notifyname</returnvalue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
If this backend is already registered for that notify condition.
|
||||
</PARA>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</VARIABLELIST>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
NOTICE Async_Listen: We are already listening on <replaceable class="PARAMETER">name</replaceable>
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
If this backend is already registered for that notify condition.
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-LISTEN-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-10-07</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-LISTEN-1">
|
||||
<refsect1info>
|
||||
<date>1998-10-07</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
LISTEN registers the current <productname>Postgres</productname> backend as a
|
||||
</title>
|
||||
<para>
|
||||
<command>LISTEN</command> registers the current <productname>Postgres</productname> backend as a
|
||||
listener on the notify condition
|
||||
<REPLACEABLE CLASS="PARAMETER">notifyname</REPLACEABLE>.
|
||||
<replaceable class="PARAMETER">name</replaceable>.
|
||||
</para>
|
||||
<para>
|
||||
Whenever the command
|
||||
<command>NOTIFY <REPLACEABLE CLASS="PARAMETER">notifyname</REPLACEABLE></command>
|
||||
<command>NOTIFY <replaceable class="PARAMETER">name</replaceable></command>
|
||||
is invoked, either by this backend or another one connected to
|
||||
the same database, all the backends currently listening on that notify
|
||||
condition are notified, and each will in turn notify its connected
|
||||
|
@ -102,7 +100,7 @@ LISTEN <REPLACEABLE CLASS="PARAMETER">notifyname</REPLACEABLE>
|
|||
for more information.
|
||||
</para>
|
||||
<para>
|
||||
A backend can be deregistered for a given notify condition with the
|
||||
A backend can be unregistered for a given notify condition with the
|
||||
<command>UNLISTEN</command> command. Also, a backend's listen registrations
|
||||
are automatically cleared when the backend process exits.
|
||||
</para>
|
||||
|
@ -124,62 +122,78 @@ LISTEN <REPLACEABLE CLASS="PARAMETER">notifyname</REPLACEABLE>
|
|||
<command>NOTIFY</command>.
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-LISTEN-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-10-07</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-LISTEN-3">
|
||||
<refsect2info>
|
||||
<date>1998-10-07</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
</title>
|
||||
<para>
|
||||
<REPLACEABLE CLASS="PARAMETER">notifyname</REPLACEABLE>
|
||||
<replaceable class="PARAMETER">name</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>
|
||||
<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>
|
||||
<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>
|
||||
</REFSECT2>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-LISTEN-2">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-LISTEN-2">
|
||||
<title>
|
||||
Usage
|
||||
</TITLE>
|
||||
<PARA>
|
||||
<ProgramListing>
|
||||
-- Configure and execute a listen/notify sequence from psql
|
||||
postgres=> listen virtual;
|
||||
LISTEN
|
||||
postgres=> notify virtual;
|
||||
NOTIFY
|
||||
ASYNC NOTIFY of 'virtual' from backend pid '11239' received
|
||||
</ProgramListing>
|
||||
</title>
|
||||
<para>
|
||||
Configure and execute a listen/notify sequence from <application>psql</application>:
|
||||
<programlisting>
|
||||
LISTEN virtual;
|
||||
NOTIFY virtual;
|
||||
|
||||
ASYNC NOTIFY of 'virtual' from backend pid '11239' received
|
||||
</programlisting>
|
||||
</para>
|
||||
</REFSECT1>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-LISTEN-3">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-LISTEN-3">
|
||||
<title>
|
||||
Compatibility
|
||||
</TITLE>
|
||||
</title>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-LISTEN-4">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-01</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-LISTEN-4">
|
||||
<refsect2info>
|
||||
<date>1998-09-01</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
SQL92
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
There is no <command>LISTEN</command> in <acronym>SQL92</acronym>.
|
||||
</para>
|
||||
</refsect2>
|
||||
</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,97 +1,92 @@
|
|||
<REFENTRY ID="SQL-LOAD">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<refentry id="SQL-LOAD">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
LOAD
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
LOAD
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Dynamically loads an object file
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-09-24</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
<REPLACEABLE CLASS="PARAMETER">
|
||||
</REPLACEABLE>
|
||||
LOAD '<REPLACEABLE CLASS="PARAMETER">filename</REPLACEABLE>'
|
||||
</SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-09-24</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
LOAD '<replaceable class="PARAMETER">filename</replaceable>'
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-LOAD-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-01</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-LOAD-1">
|
||||
<refsect2info>
|
||||
<date>1998-09-01</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<REPLACEABLE CLASS="PARAMETER">filename</REPLACEABLE>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><replaceable class="PARAMETER">filename</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Object file for dynamic loading.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</VARIABLELIST>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
</REFSECT2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-LOAD-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-24</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-LOAD-2">
|
||||
<refsect2info>
|
||||
<date>1998-09-24</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<returnvalue>LOAD</returnvalue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
LOAD
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Message returned on successful completion.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<returnvalue>ERROR: LOAD: could not open file '<REPLACEABLE CLASS="PARAMETER">filename</REPLACEABLE>'</returnvalue>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
ERROR: LOAD: could not open file '<replaceable class="PARAMETER">filename</replaceable>'
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Message returned if the specified file is not found. The file must be visible
|
||||
<emphasis>to the <productname>Postgres</productname> backend</emphasis>,
|
||||
with the appropriate full path name specified, to avoid this message.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</VARIABLELIST>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</REFSYNOPSISDIV>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-LOAD-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-09-24</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-LOAD-1">
|
||||
<refsect1info>
|
||||
<date>1998-09-24</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</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
|
||||
|
@ -107,14 +102,14 @@
|
|||
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>
|
||||
<refsect2 id="R2-SQL-LOAD-3">
|
||||
<refsect2info>
|
||||
<date>1998-09-24</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
Functions in loaded object files should not call functions in other
|
||||
object files loaded through the
|
||||
<command>LOAD</command>
|
||||
|
@ -123,7 +118,8 @@
|
|||
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
|
||||
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.
|
||||
|
@ -141,39 +137,56 @@
|
|||
to a new platform, <command>LOAD</command>
|
||||
will have to work in order to support ADTs.
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-LOAD-2">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-LOAD-2">
|
||||
<title>
|
||||
Usage
|
||||
</TITLE>
|
||||
<PARA>
|
||||
<ProgramListing>
|
||||
--Load the file /usr/postgres/demo/circle.o
|
||||
--
|
||||
LOAD '/usr/postgres/demo/circle.o'
|
||||
</ProgramListing>
|
||||
</title>
|
||||
<para>
|
||||
Load the file <filename>/usr/postgres/demo/circle.o</filename>:
|
||||
|
||||
<programlisting>
|
||||
LOAD '/usr/postgres/demo/circle.o'
|
||||
</programlisting>
|
||||
</para>
|
||||
</REFSECT1>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-LOAD-3">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-LOAD-3">
|
||||
<title>
|
||||
Compatibility
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
</title>
|
||||
<para>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-LOAD-4">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-24</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-LOAD-4">
|
||||
<refsect2info>
|
||||
<date>1998-09-24</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
SQL92
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
There is no <command>LOAD</command> in <acronym>SQL92</acronym>.
|
||||
</para>
|
||||
</refsect2>
|
||||
</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:
|
||||
-->
|
||||
|
|
|
@ -34,9 +34,7 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">table</replaceable> IN SHARE ROW E
|
|||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<replaceable class="PARAMETER">table</replaceable>
|
||||
</term>
|
||||
<term><replaceable class="PARAMETER">table</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of an existing table to lock.
|
||||
|
@ -45,9 +43,7 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">table</replaceable> IN SHARE ROW E
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
ACCESS SHARE MODE
|
||||
</term>
|
||||
<term>ACCESS SHARE MODE</term>
|
||||
<listitem>
|
||||
<note>
|
||||
<para>
|
||||
|
@ -68,9 +64,7 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">table</replaceable> IN SHARE ROW E
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
ROW SHARE MODE
|
||||
</term>
|
||||
<term>ROW SHARE MODE</term>
|
||||
<listitem>
|
||||
<note>
|
||||
<para>
|
||||
|
@ -85,9 +79,7 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">table</replaceable> IN SHARE ROW E
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
ROW EXCLUSIVE MODE
|
||||
</term>
|
||||
<term>ROW EXCLUSIVE MODE</term>
|
||||
<listitem>
|
||||
<note>
|
||||
<para>
|
||||
|
@ -105,9 +97,7 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">table</replaceable> IN SHARE ROW E
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
SHARE MODE
|
||||
</term>
|
||||
<term>SHARE MODE</term>
|
||||
<listitem>
|
||||
<note>
|
||||
<para>
|
||||
|
@ -124,9 +114,7 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">table</replaceable> IN SHARE ROW E
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
SHARE ROW EXCLUSIVE MODE
|
||||
</term>
|
||||
<term>SHARE ROW EXCLUSIVE MODE</term>
|
||||
<listitem>
|
||||
|
||||
<para>
|
||||
|
@ -139,9 +127,7 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">table</replaceable> IN SHARE ROW E
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
EXCLUSIVE MODE
|
||||
</term>
|
||||
<term>EXCLUSIVE MODE</term>
|
||||
<listitem>
|
||||
|
||||
<para>
|
||||
|
@ -154,9 +140,7 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">table</replaceable> IN SHARE ROW E
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
ACCESS EXCLUSIVE MODE
|
||||
</term>
|
||||
<term>ACCESS EXCLUSIVE MODE</term>
|
||||
<listitem>
|
||||
<note>
|
||||
<para>
|
||||
|
@ -179,7 +163,6 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">table</replaceable> IN SHARE ROW E
|
|||
</note>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
@ -195,9 +178,20 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">table</replaceable> IN SHARE ROW E
|
|||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
ERROR <replaceable class="PARAMETER">table</replaceable>: Table does not exist.
|
||||
</term>
|
||||
<term><computeroutput>
|
||||
LOCK TABLE
|
||||
</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>
|
||||
<para>
|
||||
Message returned if <replaceable class="PARAMETER">table</replaceable>
|
||||
|
@ -328,45 +322,42 @@ LOCK [ TABLE ] <replaceable class="PARAMETER">table</replaceable> IN SHARE ROW E
|
|||
</title>
|
||||
|
||||
<para>
|
||||
Illustrate a SHARE lock on a primary key table when going to perform
|
||||
inserts into a foreign key table:
|
||||
|
||||
<programlisting>
|
||||
--
|
||||
-- SHARE lock primary key table when going to perform
|
||||
-- insert into foreign key table.
|
||||
--
|
||||
BEGIN WORK;
|
||||
LOCK TABLE films IN SHARE MODE;
|
||||
SELECT id FROM films
|
||||
BEGIN WORK;
|
||||
LOCK TABLE films IN SHARE MODE;
|
||||
SELECT id FROM films
|
||||
WHERE name = 'Star Wars: Episode I - The Phantom Menace';
|
||||
--
|
||||
-- Do ROLLBACK if record was not returned
|
||||
--
|
||||
INSERT INTO films_user_comments VALUES
|
||||
-- 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;
|
||||
COMMIT WORK;
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Take a SHARE ROW EXCLUSIVE lock on a primary key table when going to perform
|
||||
a delete operation:
|
||||
|
||||
<programlisting>
|
||||
--
|
||||
-- SHARE ROW EXCLUSIVE lock primary key table when going to perform
|
||||
-- delete operation.
|
||||
--
|
||||
BEGIN WORK;
|
||||
LOCK TABLE films IN SHARE ROW EXCLUSIVE MODE;
|
||||
DELETE FROM films_user_comments WHERE id IN
|
||||
BEGIN WORK;
|
||||
LOCK TABLE films IN SHARE ROW EXCLUSIVE MODE;
|
||||
DELETE FROM films_user_comments WHERE id IN
|
||||
(SELECT id FROM films WHERE rating < 5);
|
||||
DELETE FROM films WHERE rating < 5;
|
||||
COMMIT WORK;
|
||||
DELETE FROM films WHERE rating < 5;
|
||||
COMMIT WORK;
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id="R1-SQL-LOCK-3">
|
||||
<title>
|
||||
Compatibility
|
||||
</title>
|
||||
<para>
|
||||
</para>
|
||||
|
||||
<refsect2 id="R2-SQL-LOCK-4">
|
||||
<refsect2info>
|
||||
|
@ -397,7 +388,7 @@ 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-catalogs:"/usr/lib/sgml/catalog"
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
-->
|
||||
|
|
|
@ -1,37 +1,37 @@
|
|||
<REFENTRY ID="SQL-MOVE">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
MOVE
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>SQL - Language Statements</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
MOVE
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
Moves cursor position
|
||||
</REFPURPOSE>
|
||||
<refentry id="SQL-MOVE">
|
||||
<refmeta>
|
||||
<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>
|
||||
<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>
|
||||
<refsect1 id="R1-SQL-MOVE-1">
|
||||
<refsect1info>
|
||||
<date>1998-09-24</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</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,
|
||||
|
@ -42,14 +42,14 @@ FETCH [ RELATIVE ] [ { [ <REPLACEABLE CLASS="PARAMETER">#</REPLACEABLE> | ALL |
|
|||
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>
|
||||
<refsect2 id="R2-SQL-MOVE-3">
|
||||
<refsect2info>
|
||||
<date>1998-09-24</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<command>MOVE</command> is a <productname>Postgres</productname>
|
||||
language extension.
|
||||
</para>
|
||||
|
@ -61,59 +61,56 @@ FETCH [ RELATIVE ] [ { [ <REPLACEABLE CLASS="PARAMETER">#</REPLACEABLE> | ALL |
|
|||
<command>ROLLBACK WORK</command> statements
|
||||
for further information about transactions.
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-MOVE-2">
|
||||
<TITLE>
|
||||
<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;
|
||||
</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
|
||||
</computeroutput>
|
||||
--Fetch 6th row in the cursor liahona:
|
||||
FETCH 1 IN liahona;
|
||||
<computeroutput>
|
||||
FETCH
|
||||
|
||||
--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>
|
||||
</computeroutput>
|
||||
-- close the cursor liahona and commit work:
|
||||
CLOSE liahona;
|
||||
COMMIT WORK;
|
||||
</programlisting>
|
||||
</para>
|
||||
</REFSECT1>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-MOVE-3">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-MOVE-3">
|
||||
<title>
|
||||
Compatibility
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</PARA>
|
||||
</title>
|
||||
<para>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-MOVE-4">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-01</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-MOVE-4">
|
||||
<refsect2info>
|
||||
<date>1998-09-01</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
SQL92
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
There is no SQL92 <command>MOVE</command> statement.
|
||||
Instead, <acronym>SQL92</acronym> allows
|
||||
one to <command>FETCH</command> rows from an absolute cursor position,
|
||||
|
@ -121,4 +118,21 @@ FETCH [ RELATIVE ] [ { [ <REPLACEABLE CLASS="PARAMETER">#</REPLACEABLE> | ALL |
|
|||
</para>
|
||||
</refsect2>
|
||||
</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,96 +1,90 @@
|
|||
<REFENTRY ID="SQL-NOTIFY">
|
||||
<REFMETA>
|
||||
<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>
|
||||
<refentry id="SQL-NOTIFY">
|
||||
<refmeta>
|
||||
<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>
|
||||
<REPLACEABLE CLASS="PARAMETER">
|
||||
</REPLACEABLE>
|
||||
NOTIFY <REPLACEABLE CLASS="PARAMETER">notifyname</REPLACEABLE>
|
||||
</SYNOPSIS>
|
||||
<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>
|
||||
<refsect2 id="R2-SQL-NOTIFY-1">
|
||||
<refsect2info>
|
||||
<date>1998-10-07</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
<REPLACEABLE CLASS="PARAMETER">notifyname</REPLACEABLE>
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><replaceable class="PARAMETER">notifyname</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Notify condition to be signaled.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</VARIABLELIST>
|
||||
</variablelist>
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-NOTIFY-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-10-07</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-NOTIFY-2">
|
||||
<refsect2info>
|
||||
<date>1998-10-07</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
|
||||
<VARIABLELIST>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
NOTIFY
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
NOTIFY
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Acknowledgement that notify command has executed.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<VARLISTENTRY>
|
||||
<TERM>
|
||||
Notify events
|
||||
</TERM>
|
||||
<LISTITEM>
|
||||
<PARA>
|
||||
<varlistentry>
|
||||
<term><replaceable>Notify events</replaceable></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>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-NOTIFY-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-10-07</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-NOTIFY-1">
|
||||
<refsect1info>
|
||||
<date>1998-10-07</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</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>
|
||||
|
@ -130,8 +124,8 @@ NOTIFY <REPLACEABLE CLASS="PARAMETER">notifyname</REPLACEABLE>
|
|||
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 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
|
||||
|
@ -170,25 +164,25 @@ NOTIFY <REPLACEABLE CLASS="PARAMETER">notifyname</REPLACEABLE>
|
|||
your own notifies.)
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-NOTIFY-3">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-10-07</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-NOTIFY-3">
|
||||
<refsect2info>
|
||||
<date>1998-10-07</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
</title>
|
||||
<para>
|
||||
<REPLACEABLE CLASS="PARAMETER">notifyname</REPLACEABLE>
|
||||
<replaceable class="PARAMETER">name</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>
|
||||
<replaceable class="PARAMETER">name</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>
|
||||
<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>
|
||||
|
@ -198,40 +192,60 @@ NOTIFY <REPLACEABLE CLASS="PARAMETER">notifyname</REPLACEABLE>
|
|||
backend. So it was not possible to distinguish one's own notifies from other
|
||||
clients' notifies in those earlier releases.
|
||||
</para>
|
||||
</REFSECT2>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-NOTIFY-2">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-NOTIFY-2">
|
||||
<title>
|
||||
Usage
|
||||
</TITLE>
|
||||
<PARA>
|
||||
<ProgramListing>
|
||||
-- Configure and execute a listen/notify sequence from psql
|
||||
postgres=> listen virtual;
|
||||
LISTEN
|
||||
postgres=> notify virtual;
|
||||
NOTIFY
|
||||
ASYNC NOTIFY of 'virtual' from backend pid '11239' received
|
||||
</ProgramListing>
|
||||
</title>
|
||||
<para>
|
||||
Configure and execute a listen/notify sequence from
|
||||
<application>psql</application>:
|
||||
|
||||
<programlisting>
|
||||
LISTEN virtual;
|
||||
NOTIFY virtual;
|
||||
ASYNC NOTIFY of 'virtual' from backend pid '11239' received
|
||||
</programlisting>
|
||||
</para>
|
||||
</REFSECT1>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-SQL-NOTIFY-3">
|
||||
<TITLE>
|
||||
<refsect1 id="R1-SQL-NOTIFY-3">
|
||||
<title>
|
||||
Compatibility
|
||||
</TITLE>
|
||||
</title>
|
||||
<para>
|
||||
</para>
|
||||
|
||||
<REFSECT2 ID="R2-SQL-NOTIFY-4">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-09-24</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-SQL-NOTIFY-4">
|
||||
<refsect2info>
|
||||
<date>1998-09-24</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
SQL92
|
||||
</TITLE>
|
||||
<PARA>
|
||||
There is no <command>NOTIFY</command> statement in <acronym>SQL92</acronym>.
|
||||
</title>
|
||||
<para>
|
||||
There is no <command>NOTIFY</command> statement in
|
||||
<acronym>SQL92</acronym>.
|
||||
</para>
|
||||
</refsect2>
|
||||
</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,47 +1,45 @@
|
|||
<REFENTRY ID="APP-PG-DUMP">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE id="pg-dump">
|
||||
<application>pg_dump</application>
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>Application</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
<application>pg_dump</application>
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
Extract a <productname>Postgres</productname> database into a script file
|
||||
</REFPURPOSE>
|
||||
<refentry id="APP-PG-DUMP">
|
||||
<refmeta>
|
||||
<refentrytitle id="pg-dump">
|
||||
<application>pg_dump</application>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>Application</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
<application>pg_dump</application>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Extract a <productname>Postgres</productname> database into a script file
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-11-05</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-11-05</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
pg_dump [ <replaceable class="parameter">dbname</replaceable> ]
|
||||
pg_dump [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
|
||||
[ -t <replaceable class="parameter">table</replaceable> ]
|
||||
[ -f <replaceable class="parameter">outputfile</replaceable> ]
|
||||
[ -t <replaceable class="parameter">table</replaceable> ] [ -f <replaceable class="parameter">outputfile</replaceable> ]
|
||||
[ -a ] [ -c ] [ -d ] [ -D ] [ -n ] [ -N ]
|
||||
[ -o ] [ -s ] [ -u ] [ -v ] [ -x ]
|
||||
[ <replaceable class="parameter">dbname</replaceable> ]
|
||||
</SYNOPSIS>
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-APP-PG-DUMP-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-11-05</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-APP-PG-DUMP-1">
|
||||
<refsect2info>
|
||||
<date>1998-11-05</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
<application>pg_dump</application> accepts the following command line arguments:
|
||||
</title>
|
||||
<para>
|
||||
<application>pg_dump</application> accepts the following command
|
||||
line arguments:
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<replaceable class="parameter">dbname</replaceable>
|
||||
</term>
|
||||
<term><replaceable class="parameter">dbname</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the name of the database to be extracted.
|
||||
|
@ -54,9 +52,7 @@ pg_dump [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceab
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-a
|
||||
</term>
|
||||
<term>-a</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Dump out only the data, no schema (definitions).
|
||||
|
@ -65,9 +61,7 @@ pg_dump [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceab
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-c
|
||||
</term>
|
||||
<term>-c</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Clean(drop) schema prior to create.
|
||||
|
@ -76,9 +70,7 @@ pg_dump [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceab
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-d
|
||||
</term>
|
||||
<term>-d</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Dump data as proper insert strings.
|
||||
|
@ -87,9 +79,7 @@ pg_dump [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceab
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-D
|
||||
</term>
|
||||
<term>-D</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Dump data as inserts with attribute names
|
||||
|
@ -98,9 +88,7 @@ pg_dump [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceab
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-f <replaceable class="parameter">filename</replaceable>
|
||||
</term>
|
||||
<term>-f <replaceable class="parameter">filename</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the output file. Defaults to <filename>stdout</filename>.
|
||||
|
@ -109,9 +97,7 @@ pg_dump [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceab
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-n
|
||||
</term>
|
||||
<term>-n</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Suppress double quotes around identifiers unless absolutely necessary.
|
||||
|
@ -123,9 +109,7 @@ pg_dump [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceab
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-N
|
||||
</term>
|
||||
<term>-N</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Include double quotes around identifiers.
|
||||
|
@ -135,9 +119,7 @@ pg_dump [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceab
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-o
|
||||
</term>
|
||||
<term>-o</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Dump object identifiers (<acronym>OID</acronym>s) for every table.
|
||||
|
@ -146,9 +128,7 @@ pg_dump [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceab
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-s
|
||||
</term>
|
||||
<term>-s</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Dump out only the schema (definitions), no data.
|
||||
|
@ -157,9 +137,7 @@ pg_dump [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceab
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-t <replaceable class="parameter">table</replaceable>
|
||||
</term>
|
||||
<term>-t <replaceable class="parameter">table</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Dump data for <replaceable class="parameter">table</replaceable> only.
|
||||
|
@ -168,9 +146,7 @@ pg_dump [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceab
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-u
|
||||
</term>
|
||||
<term>-u</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Use password authentication. Prompts for username and password.
|
||||
|
@ -179,9 +155,7 @@ pg_dump [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceab
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-v
|
||||
</term>
|
||||
<term>-v</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies verbose mode
|
||||
|
@ -190,9 +164,7 @@ pg_dump [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceab
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-x
|
||||
</term>
|
||||
<term>-x</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Prevent dumping of ACLs (grant/revoke commands) and table ownership information.
|
||||
|
@ -208,9 +180,7 @@ pg_dump [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceab
|
|||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
-h <replaceable class="parameter">host</replaceable>
|
||||
</term>
|
||||
<term>-h <replaceable class="parameter">host</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the hostname of the machine on which the
|
||||
|
@ -222,9 +192,7 @@ pg_dump [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceab
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-p <replaceable class="parameter">port</replaceable>
|
||||
</term>
|
||||
<term>-p <replaceable class="parameter">port</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the Internet TCP/IP port or local Unix domain socket file
|
||||
|
@ -237,9 +205,7 @@ pg_dump [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceab
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-u
|
||||
</term>
|
||||
<term>-u</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Use password authentication.
|
||||
|
@ -249,29 +215,28 @@ pg_dump [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceab
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-APP-PG-DUMP-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-11-05</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-APP-PG-DUMP-2">
|
||||
<refsect2info>
|
||||
<date>1998-11-05</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<application>pg_dump</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
|
||||
<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>'?
|
||||
</term>
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<application>pg_dump</application> could not attach to the
|
||||
|
@ -286,10 +251,10 @@ pg_dump [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceab
|
|||
</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>
|
||||
<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>
|
||||
|
@ -300,9 +265,9 @@ pg_dump [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceab
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
dumpSequence(<replaceable class="parameter">table</replaceable>): SELECT failed
|
||||
</term>
|
||||
<term><computeroutput>
|
||||
dumpSequence(<replaceable class="parameter">table</replaceable>): SELECT failed
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
You do not have permission to read the database.
|
||||
|
@ -310,9 +275,9 @@ pg_dump [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceab
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
<note>
|
||||
<para>
|
||||
<application>pg_dump</application> internally executes
|
||||
|
@ -325,14 +290,14 @@ pg_dump [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceab
|
|||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-APP-PG-DUMP-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-11-05</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-APP-PG-DUMP-1">
|
||||
<refsect1info>
|
||||
<date>1998-11-05</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</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
|
||||
|
@ -345,6 +310,7 @@ pg_dump [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceab
|
|||
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
|
||||
|
@ -355,24 +321,20 @@ pg_dump [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceab
|
|||
</para>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-APP-PG-DUMP-2">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-11-05</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-APP-PG-DUMP-2">
|
||||
<refsect1info>
|
||||
<date>1998-11-05</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Notes
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</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.
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
partial indices
|
||||
</term>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<application>pg_dump</application>
|
||||
|
@ -380,44 +342,55 @@ pg_dump [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceab
|
|||
the same as above; partial index predicates are stored as plans.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
large objects
|
||||
</term>
|
||||
<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>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-APP-PG-DUMP-3">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-11-05</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-APP-PG-DUMP-3">
|
||||
<refsect1info>
|
||||
<date>1998-11-05</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Usage
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
To dump a database of the same name as the user:
|
||||
|
||||
<programlisting>
|
||||
% pg_dump > db.out
|
||||
% pg_dump > db.out
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To reload this database:
|
||||
|
||||
<programlisting>
|
||||
psql -e database < db.out
|
||||
% psql -e database < db.out
|
||||
</programlisting>
|
||||
</para>
|
||||
</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,53 +1,49 @@
|
|||
<REFENTRY ID="APP-PG-DUMPALL">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<application>pg_dumpall</application>
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>Application</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
<application>pg_dumpall</application>
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
Extract all <productname>Postgres</productname> databases into a script file
|
||||
</REFPURPOSE>
|
||||
<refentry id="APP-PG-DUMPALL">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
<application>pg_dumpall</application>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>Application</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
<application>pg_dumpall</application>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Extract all <productname>Postgres</productname> databases into a script file
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-10-04</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-10-04</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
pg_dumpall
|
||||
pg_dumpall [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ]
|
||||
[ -a ] [ -d ] [ -D ] [ -o ] [ -s ] [ -u ] [ -v ] [ -x ]
|
||||
</SYNOPSIS>
|
||||
pg_dumpall [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ] [ -a ] [ -d ] [ -D ] [ -o ] [ -s ] [ -u ] [ -v ] [ -x ]
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-APP-PG-DUMPALL-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-10-04</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-APP-PG-DUMPALL-1">
|
||||
<refsect2info>
|
||||
<date>1998-10-04</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<application>pg_dumpall</application> accepts the following command line arguments:
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
-a
|
||||
</term>
|
||||
<term>-a</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Dump out only the data, no schema (definitions).
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-d
|
||||
</term>
|
||||
<term>-d</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Dump data as proper insert strings.
|
||||
|
@ -56,9 +52,7 @@ pg_dumpall [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-D
|
||||
</term>
|
||||
<term>-D</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Dump data as inserts with attribute names
|
||||
|
@ -67,9 +61,7 @@ pg_dumpall [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-n
|
||||
</term>
|
||||
<term>-n</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Suppress double quotes around identifiers unless absolutely necessary.
|
||||
|
@ -80,9 +72,7 @@ pg_dumpall [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-o
|
||||
</term>
|
||||
<term>-o</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Dump object identifiers (<acronym>OID</acronym>s) for every table.
|
||||
|
@ -91,9 +81,7 @@ pg_dumpall [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-s
|
||||
</term>
|
||||
<term>-s</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Dump out only the schema (definitions), no data.
|
||||
|
@ -102,9 +90,7 @@ pg_dumpall [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-u
|
||||
</term>
|
||||
<term>-u</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Use password authentication. Prompts for username and password.
|
||||
|
@ -113,9 +99,7 @@ pg_dumpall [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-v
|
||||
</term>
|
||||
<term>-v</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies verbose mode
|
||||
|
@ -124,9 +108,7 @@ pg_dumpall [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-x
|
||||
</term>
|
||||
<term>-x</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Prevent dumping ACLs (grant/revoke commands) and table ownership information.
|
||||
|
@ -136,15 +118,14 @@ pg_dumpall [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
|||
|
||||
</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>
|
||||
<term>-h <replaceable class="parameter">host</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the hostname of the machine on which the
|
||||
|
@ -156,9 +137,7 @@ pg_dumpall [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-p <replaceable class="parameter">port</replaceable>
|
||||
</term>
|
||||
<term>-p <replaceable class="parameter">port</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the Internet TCP/IP port or local Unix domain socket file
|
||||
|
@ -171,9 +150,7 @@ pg_dumpall [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-u
|
||||
</term>
|
||||
<term>-u</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Use password authentication.
|
||||
|
@ -187,24 +164,23 @@ pg_dumpall [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
|||
</para>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-APP-PG-DUMPALL-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1998-10-04</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-APP-PG-DUMPALL-2">
|
||||
<refsect2info>
|
||||
<date>1998-10-04</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<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>
|
||||
<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
|
||||
|
@ -219,10 +195,10 @@ pg_dumpall [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
|||
</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>
|
||||
<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>
|
||||
|
@ -233,9 +209,9 @@ pg_dumpall [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
dumpSequence(<replaceable class="parameter">table</replaceable>): SELECT failed
|
||||
</term>
|
||||
<term><computeroutput>
|
||||
dumpSequence(<replaceable class="parameter">table</replaceable>): SELECT failed
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
You do not have permission to read the database.
|
||||
|
@ -258,14 +234,14 @@ pg_dumpall [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
|||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-APP-PG-DUMPALL-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-10-04</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-APP-PG-DUMPALL-1">
|
||||
<refsect1info>
|
||||
<date>1998-10-04</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</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.
|
||||
|
@ -280,23 +256,23 @@ pg_dumpall [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
|||
</para>
|
||||
<para>
|
||||
Refer to
|
||||
<xref linkend="app-pg-dump" endterm="pg-dump">
|
||||
<xref endterm="pg-dump" linkend="app-pg-dump">
|
||||
for more information on this capability.
|
||||
</para
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<REFSECT1 ID="R1-APP-PG-DUMPALL-2">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-10-04</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-APP-PG-DUMPALL-2">
|
||||
<refsect1info>
|
||||
<date>1998-10-04</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Usage
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
To dump all databases:
|
||||
|
||||
<programlisting>
|
||||
% pg_dumpall -o > db.out
|
||||
% pg_dumpall -o > db.out
|
||||
</programlisting>
|
||||
|
||||
<tip>
|
||||
|
@ -310,7 +286,7 @@ pg_dumpall [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
|||
To reload this database:
|
||||
|
||||
<programlisting>
|
||||
psql -e template1 < db.out
|
||||
% psql -e template1 < db.out
|
||||
</programlisting>
|
||||
</para>
|
||||
<tip>
|
||||
|
@ -320,4 +296,21 @@ pg_dumpall [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replac
|
|||
</para>
|
||||
</tip>
|
||||
</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,59 +1,128 @@
|
|||
<REFENTRY ID="APP-PG-UPGRADE">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE>
|
||||
<application>pg_upgrade</application>
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>Application</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
<application>pg_upgrade</application>
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
Allows upgrade from a previous release without reloading data
|
||||
</REFPURPOSE>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1998-10-04</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
<refentry id="APP-PG-UPGRADE">
|
||||
<refmeta>
|
||||
<refentrytitle>
|
||||
<application>pg_upgrade</application>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>Application</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
<application>pg_upgrade</application>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Allows upgrade from a previous release without reloading data
|
||||
</refpurpose>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1998-10-04</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
pg_upgrade
|
||||
pg_upgrade [-f <replaceable class="parameter">input_file</replaceable>] <replaceable class="parameter">old_data_dir</replaceable>
|
||||
</SYNOPSIS>
|
||||
pg_upgrade [ -f <replaceable class="parameter">filename</replaceable> ] <replaceable class="parameter">old_data_dir</replaceable>
|
||||
</synopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-APP-PG-UPGRADE-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1998-10-04</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
<application>pg_upgrade</application>
|
||||
<refsect1 id="R1-APP-PG-UPGRADE-1">
|
||||
<refsect1info>
|
||||
<date>1998-10-04</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</title>
|
||||
<para>
|
||||
<application>pg_upgrade</application>
|
||||
is a utility for upgrading from a previous
|
||||
PostgreSQL release without reloading all the data. First,
|
||||
to be safe, back up your data directory. Then, use:
|
||||
<programlisting>
|
||||
% pg_dumpall -s >db.out
|
||||
</programlisting>
|
||||
to dump out your old database definitions without any
|
||||
data. Stop the postmaster and all backends.
|
||||
</para>
|
||||
PostgreSQL release without reloading all the data.
|
||||
|
||||
<para>
|
||||
Then rename (using mv) your old pgsql /data directory to
|
||||
/data.old and do a make install to install the new binaries.
|
||||
Run initdb to create a new template1 database containing the system
|
||||
tables for the new release. Start the new postmaster, cd to the
|
||||
pgsql main directory, and type:
|
||||
<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
|
||||
</programlisting>
|
||||
to dump out your old database definitions without any
|
||||
data. Stop the postmaster and all backends.
|
||||
</para>
|
||||
</step>
|
||||
|
||||
<step performance="required">
|
||||
<para>
|
||||
Rename (using mv) your old pgsql <filename>data/</filename> directory to
|
||||
<filename>data.old/</filename>.
|
||||
</para>
|
||||
</step>
|
||||
|
||||
<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
|
||||
</programlisting>
|
||||
The system will do some checking to make sure everything
|
||||
is properly configured, and run your db.out script to create
|
||||
all the databases and tables you had, but with no
|
||||
data. It will then move the data files from /data.old
|
||||
into the proper /data directory. You can then check out
|
||||
the data. You can delete the /data.old directory when you
|
||||
are finished.
|
||||
</REFENTRY>
|
||||
</programlisting>
|
||||
The system will do some checking to make sure everything
|
||||
is properly configured, and will run your db.out script to create
|
||||
all the databases and tables you had, but with no
|
||||
data. It will then move the data files from <filename>data.old/</filename>
|
||||
into the proper <filename>data/</filename> directory.
|
||||
</para>
|
||||
</step>
|
||||
|
||||
<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">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE id="pgaccess-ref">
|
||||
<refentry id="APP-PGACCESS">
|
||||
<refmeta>
|
||||
<refentrytitle id="pgaccess-ref">
|
||||
<application>pgaccess</application>
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>Application</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>Application</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
<application>pgaccess</application>
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
<productname>Postgres</productname> graphical interactive client
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1999-05-19</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1999-05-19</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
pgaccess [ <replaceable class="parameter">dbname</replaceable> ]
|
||||
</SYNOPSIS>
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-APP-PGACCESS-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1999-05-19</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-APP-PGACCESS-1">
|
||||
<refsect2info>
|
||||
<date>1999-05-19</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<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>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-APP-PGACCESS-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1999-05-19</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-APP-PGACCESS-2">
|
||||
<refsect2info>
|
||||
<date>1999-05-19</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-APP-PGACCESS-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1999-05-19</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-APP-PGACCESS-1">
|
||||
<refsect1info>
|
||||
<date>1999-05-19</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<note>
|
||||
<title>Editor's Note</title>
|
||||
<para>
|
||||
This should be transcribed from other pgaccess info. Volunteers?
|
||||
</para>
|
||||
</note>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
@ -68,7 +85,7 @@ 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-catalogs:"/usr/lib/sgml/catalog"
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
-->
|
||||
|
|
|
@ -1,57 +1,74 @@
|
|||
<REFENTRY ID="APP-PGADMIN">
|
||||
<REFMETA>
|
||||
<REFENTRYTITLE id="pgadmin-ref">
|
||||
<refentry id="APP-PGADMIN">
|
||||
<refmeta>
|
||||
<refentrytitle id="pgadmin-ref">
|
||||
<application>pgadmin</application>
|
||||
</REFENTRYTITLE>
|
||||
<REFMISCINFO>Application</REFMISCINFO>
|
||||
</REFMETA>
|
||||
<REFNAMEDIV>
|
||||
<REFNAME>
|
||||
</refentrytitle>
|
||||
<refmiscinfo>Application</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
<application>pgadmin</application>
|
||||
</REFNAME>
|
||||
<REFPURPOSE>
|
||||
</refname>
|
||||
<refpurpose>
|
||||
<productname>Postgres</productname> graphical interactive client
|
||||
</REFPURPOSE>
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<REFSYNOPSISDIV>
|
||||
<REFSYNOPSISDIVINFO>
|
||||
<DATE>1999-05-19</DATE>
|
||||
</REFSYNOPSISDIVINFO>
|
||||
<SYNOPSIS>
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1999-05-19</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
pgadmin [ <replaceable class="parameter">dbname</replaceable> ]
|
||||
</SYNOPSIS>
|
||||
</synopsis>
|
||||
|
||||
<REFSECT2 ID="R2-APP-PGADMIN-1">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1999-05-19</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-APP-PGADMIN-1">
|
||||
<refsect2info>
|
||||
<date>1999-05-19</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Inputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<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>
|
||||
</refsect2>
|
||||
|
||||
<REFSECT2 ID="R2-APP-PGADMIN-2">
|
||||
<REFSECT2INFO>
|
||||
<DATE>1999-05-19</DATE>
|
||||
</REFSECT2INFO>
|
||||
<TITLE>
|
||||
<refsect2 id="R2-APP-PGADMIN-2">
|
||||
<refsect2info>
|
||||
<date>1999-05-19</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
Outputs
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<REFSECT1 ID="R1-APP-PGADMIN-1">
|
||||
<REFSECT1INFO>
|
||||
<DATE>1999-05-19</DATE>
|
||||
</REFSECT1INFO>
|
||||
<TITLE>
|
||||
<refsect1 id="R1-APP-PGADMIN-1">
|
||||
<refsect1info>
|
||||
<date>1999-05-19</date>
|
||||
</refsect1info>
|
||||
<title>
|
||||
Description
|
||||
</TITLE>
|
||||
<PARA>
|
||||
</title>
|
||||
<para>
|
||||
<note>
|
||||
<title>Editor's Note</title>
|
||||
<para>
|
||||
This should be transcribed from other pgadmin info. Volunteers?
|
||||
</para>
|
||||
</note>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
@ -68,7 +85,7 @@ 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-catalogs:"/usr/lib/sgml/catalog"
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
-->
|
||||
|
|
|
@ -36,9 +36,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
|||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<replaceable class="parameter">dbname</replaceable>
|
||||
</term>
|
||||
<term><replaceable class="parameter">dbname</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The optional argument
|
||||
|
@ -53,9 +51,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-B <replaceable class="parameter">nBuffers</replaceable>
|
||||
</term>
|
||||
<term>-B <replaceable class="parameter">nBuffers</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
If the backend is running under the
|
||||
|
@ -72,9 +68,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-C
|
||||
</term>
|
||||
<term>-C</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Do not show the server version number.
|
||||
|
@ -83,9 +77,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-D <replaceable class="parameter">DataDir</replaceable>
|
||||
</term>
|
||||
<term>-D <replaceable class="parameter">DataDir</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
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>
|
||||
<term>
|
||||
-E
|
||||
</term>
|
||||
<term>-E</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Echo all queries.
|
||||
|
@ -113,9 +103,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-F
|
||||
</term>
|
||||
<term>-F</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Disable an automatic <function>fsync()</function> call after each transaction.
|
||||
|
@ -128,9 +116,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-O
|
||||
</term>
|
||||
<term>-O</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Override restrictions, so system table structures can be modified.
|
||||
|
@ -140,9 +126,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-Q
|
||||
</term>
|
||||
<term>-Q</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies "quiet" mode.
|
||||
|
@ -151,9 +135,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-S <replaceable class="parameter">SortSize</replaceable>
|
||||
</term>
|
||||
<term>-S <replaceable class="parameter">SortSize</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
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>
|
||||
<term>
|
||||
-d [ <replaceable class="parameter">DebugLevel</replaceable> ]
|
||||
</term>
|
||||
<term>-d [ <replaceable class="parameter">DebugLevel</replaceable> ]</term>
|
||||
<listitem>
|
||||
<para>
|
||||
The optional argument <replaceable class="parameter">DebugLevel</replaceable>
|
||||
|
@ -191,9 +171,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-e
|
||||
</term>
|
||||
<term>-e</term>
|
||||
<listitem>
|
||||
<para>
|
||||
This option controls how dates are interpreted upon
|
||||
|
@ -214,9 +192,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-o <replaceable class="parameter">OutputFile</replaceable>
|
||||
</term>
|
||||
<term>-o <replaceable class="parameter">OutputFile</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Sends all debugging and error output to
|
||||
|
@ -232,9 +208,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-s
|
||||
</term>
|
||||
<term>-s</term>
|
||||
<listitem>
|
||||
<para>
|
||||
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>
|
||||
<term>
|
||||
-v <replaceable class="parameter">protocol</replaceable>
|
||||
</term>
|
||||
<term>-v <replaceable class="parameter">protocol</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
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>
|
||||
<varlistentry>
|
||||
<term>
|
||||
-A n|r|b|Q\fIn\fP|X\fIn\fP
|
||||
</term>
|
||||
<term>-A n|r|b|Q\fIn\fP|X\fIn\fP</term>
|
||||
<listitem>
|
||||
<para>
|
||||
This option generates a tremendous amount of output.
|
||||
|
@ -282,9 +252,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-L
|
||||
</term>
|
||||
<term>-L</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Turns off the locking system.
|
||||
|
@ -293,9 +261,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-N
|
||||
</term>
|
||||
<term>-N</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Disables use of newline as a query delimiter.
|
||||
|
@ -304,9 +270,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-f [ s | i | m | n | h ]
|
||||
</term>
|
||||
<term>-f [ s | i | m | n | h ]</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Forbids the use of particular scan and join methods:
|
||||
|
@ -328,9 +292,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-i
|
||||
</term>
|
||||
<term>-i</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Prevents query execution, but shows the plan tree.
|
||||
|
@ -339,9 +301,7 @@ postgres [ -B <replaceable class="parameter">nBuffers</replaceable> ] [ -C ] [ -
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-p <replaceable class="parameter">dbname</replaceable>
|
||||
</term>
|
||||
<term>-p <replaceable class="parameter">dbname</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
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>
|
||||
<term>
|
||||
-t pa[rser] | pl[anner] | e[xecutor]
|
||||
</term>
|
||||
<term>-t pa[rser] | pl[anner] | e[xecutor]</term>
|
||||
<listitem>
|
||||
<para>
|
||||
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>
|
||||
<varlistentry>
|
||||
<term>
|
||||
semget: No space left on device
|
||||
</term>
|
||||
<term><computeroutput>
|
||||
semget: No space left on device
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
If you see this message, you should run the
|
||||
|
|
|
@ -36,9 +36,7 @@ postmaster [ -n | -s ] ...
|
|||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
-B <replaceable class="parameter">nBuffers</replaceable>
|
||||
</term>
|
||||
<term>-B <replaceable class="parameter">nBuffers</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The number of shared-memory buffers for the
|
||||
|
@ -51,9 +49,7 @@ postmaster [ -n | -s ] ...
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-D <replaceable class="parameter">DataDir</replaceable>
|
||||
</term>
|
||||
<term>-D <replaceable class="parameter">DataDir</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the directory to use as the root of the tree of database
|
||||
|
@ -70,9 +66,7 @@ postmaster [ -n | -s ] ...
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-N <replaceable class="parameter">nBackends</replaceable>
|
||||
</term>
|
||||
<term>-N <replaceable class="parameter">nBackends</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The maximum number of backend server processes that this postmaster
|
||||
|
@ -86,9 +80,7 @@ postmaster [ -n | -s ] ...
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-S
|
||||
</term>
|
||||
<term>-S</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies that the <application>postmaster</application>
|
||||
|
@ -102,9 +94,7 @@ postmaster [ -n | -s ] ...
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-d [ <replaceable class="parameter">DebugLevel</replaceable> ]
|
||||
</term>
|
||||
<term>-d [ <replaceable class="parameter">DebugLevel</replaceable> ]</term>
|
||||
<listitem>
|
||||
<para>
|
||||
The optional argument <replaceable class="parameter">DebugLevel</replaceable>
|
||||
|
@ -125,9 +115,7 @@ postmaster [ -n | -s ] ...
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-i
|
||||
</term>
|
||||
<term>-i</term>
|
||||
<listitem>
|
||||
<para>
|
||||
This enables TCP/IP or Internet domain socket communication.
|
||||
|
@ -138,9 +126,7 @@ postmaster [ -n | -s ] ...
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-o <replaceable class="parameter">BackendOptions</replaceable>
|
||||
</term>
|
||||
<term>-o <replaceable class="parameter">BackendOptions</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The
|
||||
|
@ -156,9 +142,7 @@ postmaster [ -n | -s ] ...
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-p <replaceable class="parameter">port</replaceable>
|
||||
</term>
|
||||
<term>-p <replaceable class="parameter">port</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the TCP/IP port or local Unix domain socket file extension
|
||||
|
@ -200,9 +184,7 @@ postmaster [ -n | -s ] ...
|
|||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
-n
|
||||
</term>
|
||||
<term>-n</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<application>postmaster</application>
|
||||
|
@ -215,9 +197,7 @@ postmaster [ -n | -s ] ...
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-s
|
||||
</term>
|
||||
<term>-s</term>
|
||||
<listitem>
|
||||
<para>
|
||||
<application>postmaster</application>
|
||||
|
@ -259,9 +239,9 @@ postmaster [ -n | -s ] ...
|
|||
</varlistentry>
|
||||
-->
|
||||
<varlistentry>
|
||||
<term>
|
||||
semget: No space left on device
|
||||
</term>
|
||||
<term><computeroutput>
|
||||
semget: No space left on device
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
If you see this message, you should run the
|
||||
|
@ -290,9 +270,9 @@ postmaster [ -n | -s ] ...
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
StreamServerPort: cannot bind to port
|
||||
</term>
|
||||
<term><computeroutput>
|
||||
StreamServerPort: cannot bind to port
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
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>
|
||||
<term>
|
||||
IpcMemoryAttach: shmat() failed: Permission denied
|
||||
</term>
|
||||
<term><computeroutput>
|
||||
IpcMemoryAttach: shmat() failed: Permission denied
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
A likely explanation is that another user attempted to start a
|
||||
|
|
|
@ -20,11 +20,9 @@
|
|||
<synopsis>
|
||||
psql [ <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> ]
|
||||
[ -F <replaceable class="parameter">separator</replaceable> ] [ -h <replaceable class="parameter">hostname</replaceable> ]
|
||||
-Hln [ -o <replaceable class="parameter">filename</replaceable> ] [ -p
|
||||
<replaceable class="parameter">port</replaceable> ]
|
||||
-qsSt [ -T <replaceable class="parameter">table_o</replaceable> ] -ux
|
||||
-e -E [ -f <replaceable class="parameter">filename</replaceable> ] [ -F <replaceable class="parameter">separator</replaceable> ]
|
||||
[ -h <replaceable class="parameter">hostname</replaceable> ] -Hln [ -o <replaceable class="parameter">filename</replaceable> ]
|
||||
[ -p <replaceable class="parameter">port</replaceable> ] -qsSt [ -T <replaceable class="parameter">table_o</replaceable> ] -ux
|
||||
[ <replaceable class="parameter">dbname</replaceable> ]
|
||||
</synopsis>
|
||||
|
||||
|
@ -43,9 +41,7 @@ psql -A [ -c <replaceable class="parameter">query</replaceable> ] [ -d <replacea
|
|||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<replaceable class="PARAMETER">dbname</replaceable>
|
||||
</term>
|
||||
<term><replaceable class="PARAMETER">dbname</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of an existing database to access.
|
||||
|
@ -59,22 +55,21 @@ psql -A [ -c <replaceable class="parameter">query</replaceable> ] [ -d <replacea
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-c <replaceable class="parameter">query</replaceable>
|
||||
</term>
|
||||
<term>-c <replaceable class="parameter">query</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
A single query to run. <application>psql</application> will exit on completion.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The full set of command-line arguments and meta-commands are described in a subsequent
|
||||
section.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
There are some environment variables which can be used in liu of
|
||||
command line arguments.
|
||||
|
@ -91,9 +86,7 @@ psql -A [ -c <replaceable class="parameter">query</replaceable> ] [ -d <replacea
|
|||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>PGHOST</envar>
|
||||
</term>
|
||||
<term><envar>PGHOST</envar></term>
|
||||
<listitem>
|
||||
<para>
|
||||
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>
|
||||
<term>
|
||||
<envar>PGPORT</envar>
|
||||
</term>
|
||||
<term><envar>PGPORT</envar></term>
|
||||
<listitem>
|
||||
<para>
|
||||
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>
|
||||
<term>
|
||||
<envar>PGTTY</envar>
|
||||
</term>
|
||||
<term><envar>PGTTY</envar></term>
|
||||
<listitem>
|
||||
<para>
|
||||
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>
|
||||
<term>
|
||||
<envar>PGOPTION</envar>
|
||||
</term>
|
||||
<term><envar>PGOPTION</envar></term>
|
||||
<listitem>
|
||||
<para>
|
||||
If <envar>PGOPTION</envar>
|
||||
|
@ -143,9 +130,7 @@ psql -A [ -c <replaceable class="parameter">query</replaceable> ] [ -d <replacea
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>PGREALM</envar>
|
||||
</term>
|
||||
<term><envar>PGREALM</envar></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<envar>PGREALM</envar>
|
||||
|
@ -176,11 +161,13 @@ psql -A [ -c <replaceable class="parameter">query</replaceable> ] [ -d <replacea
|
|||
<application>psql</application>
|
||||
returns 0 to the shell on successful completion of all queries,
|
||||
1 for errors, 2 for abrupt disconnection from the backend.
|
||||
The default TAB delimiter is used.
|
||||
<application>psql</application>
|
||||
will also return 1 if the connection to a database could not be made for
|
||||
any reason.
|
||||
</para>
|
||||
<para>
|
||||
The default TAB delimiter is used.
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsynopsisdiv>
|
||||
|
||||
|
@ -337,9 +324,7 @@ testdb=>
|
|||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
-A
|
||||
</term>
|
||||
<term>-A</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Turn off fill justification when printing out table elements.
|
||||
|
@ -348,9 +333,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-c <replaceable class="parameter">query</replaceable>
|
||||
</term>
|
||||
<term>-c <replaceable class="parameter">query</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies that
|
||||
|
@ -364,9 +347,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-d <replaceable class="parameter">dbname</replaceable>
|
||||
</term>
|
||||
<term>-d <replaceable class="parameter">dbname</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the name of the database to connect to. This is equivalent to specifying
|
||||
|
@ -377,9 +358,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-e
|
||||
</term>
|
||||
<term>-e</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Echo the query sent to the backend
|
||||
|
@ -388,9 +367,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-E
|
||||
</term>
|
||||
<term>-E</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Echo the actual query generated by \d and other backslash commands
|
||||
|
@ -399,9 +376,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-f <replaceable class="parameter">filename</replaceable>
|
||||
</term>
|
||||
<term>-f <replaceable class="parameter">filename</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Use the file <replaceable class="parameter">filename</replaceable>
|
||||
|
@ -412,9 +387,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-F <replaceable class="parameter">separator</replaceable>
|
||||
</term>
|
||||
<term>-F <replaceable class="parameter">separator</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Use <replaceable class="parameter">separator</replaceable>
|
||||
|
@ -425,9 +398,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-h <replaceable class="parameter">hostname</replaceable>
|
||||
</term>
|
||||
<term>-h <replaceable class="parameter">hostname</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the host name of the machine on which the
|
||||
|
@ -440,9 +411,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-H
|
||||
</term>
|
||||
<term>-H</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Turns on
|
||||
|
@ -453,9 +422,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-l
|
||||
</term>
|
||||
<term>-l</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Lists all available databases, then exit. Other non-connection options are ignored.
|
||||
|
@ -464,9 +431,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-n
|
||||
</term>
|
||||
<term>-n</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Do not use the readline library for input line editing and command history.
|
||||
|
@ -475,9 +440,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-o <replaceable class="parameter">filename</replaceable>
|
||||
</term>
|
||||
<term>-o <replaceable class="parameter">filename</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Put all output into file <replaceable class="parameter">filename</replaceable>.
|
||||
|
@ -487,9 +450,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-p <replaceable class="parameter">port</replaceable>
|
||||
</term>
|
||||
<term>-p <replaceable class="parameter">port</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the TCP/IP port or, by omission, the local Unix domain socket file
|
||||
|
@ -503,9 +464,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-q
|
||||
</term>
|
||||
<term>-q</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies that
|
||||
|
@ -520,9 +479,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-s
|
||||
</term>
|
||||
<term>-s</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Run in single-step mode where the user is prompted for each query before
|
||||
|
@ -532,9 +489,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-S
|
||||
</term>
|
||||
<term>-S</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Runs in single-line mode where each query is terminated by a newline,
|
||||
|
@ -544,9 +499,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-t
|
||||
</term>
|
||||
<term>-t</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Turn off printing of column names.
|
||||
|
@ -558,9 +511,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-T <replaceable class="parameter">table_options</replaceable>
|
||||
</term>
|
||||
<term>-T <replaceable class="parameter">table_options</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Allows you to specify options to be placed within the
|
||||
|
@ -573,9 +524,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-u
|
||||
</term>
|
||||
<term>-u</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Asks the user for the user name and password before connecting to the database.
|
||||
|
@ -588,9 +537,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
-x
|
||||
</term>
|
||||
<term>-x</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Turns on extended row format mode. When enabled each row will have its column
|
||||
|
@ -640,9 +587,7 @@ testdb=>
|
|||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\a</literal>
|
||||
</term>
|
||||
<term><literal>\a</literal></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Toggle field alignment when printing out table elements.
|
||||
|
@ -651,9 +596,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\C</literal> <replaceable class="parameter">caption</replaceable>
|
||||
</term>
|
||||
<term><literal>\C</literal> <replaceable class="parameter">caption</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Set the HTML3.0 table caption to
|
||||
|
@ -663,10 +606,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\connect</literal> <replaceable class="parameter">meter"</replaceable>ceable> [ <replaceable
|
||||
class="parameter">username</replaceable> ]
|
||||
</term>
|
||||
<term><literal>\connect</literal> <replaceable class="parameter">meter"</replaceable>ceable> [ <replaceable class="parameter">username</replaceable> ]</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Establish a connection to a new database, using the default
|
||||
|
@ -677,9 +617,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\copy</literal> <replaceable class="parameter">meter"</replaceable>ceable> { FROM | TO }
|
||||
<replaceable class="parameter">filename</replaceable>
|
||||
<term><literal>\copy</literal> <replaceable class="parameter">meter"</replaceable>ceable> { FROM | TO } <replaceable class="parameter">filename</replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
@ -703,9 +641,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\d</literal> [ <replaceable class="parameter">table</replaceable> ]
|
||||
</term>
|
||||
<term><literal>\d</literal> [ <replaceable class="parameter">table</replaceable> ]</term>
|
||||
<listitem>
|
||||
<para>
|
||||
List tables in the database, or if <replaceable
|
||||
|
@ -718,9 +654,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\da</literal>
|
||||
</term>
|
||||
<term><literal>\da</literal></term>
|
||||
<listitem>
|
||||
<para>
|
||||
List all available aggregates.
|
||||
|
@ -729,9 +663,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\dd</literal> <replaceable class="parameter">object</replaceable>
|
||||
</term>
|
||||
<term><literal>\dd</literal> <replaceable class="parameter">object</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
List the description from <literal>pg_description</literal>
|
||||
|
@ -749,9 +681,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\df</literal>
|
||||
</term>
|
||||
<term><literal>\df</literal></term>
|
||||
<listitem>
|
||||
<para>
|
||||
List functions.
|
||||
|
@ -760,9 +690,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\di</literal>
|
||||
</term>
|
||||
<term><literal>\di</literal></term>
|
||||
<listitem>
|
||||
<para>
|
||||
List only indexes.
|
||||
|
@ -771,9 +699,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\do</literal>
|
||||
</term>
|
||||
<term><literal>\do</literal></term>
|
||||
<listitem>
|
||||
<para>
|
||||
List only operators.
|
||||
|
@ -782,9 +708,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\ds</literal>
|
||||
</term>
|
||||
<term><literal>\ds</literal></term>
|
||||
<listitem>
|
||||
<para>
|
||||
List only sequences.
|
||||
|
@ -793,9 +717,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\dS</literal>
|
||||
</term>
|
||||
<term><literal>\dS</literal></term>
|
||||
<listitem>
|
||||
<para>
|
||||
List system tables and indexes.
|
||||
|
@ -804,9 +726,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\dt</literal>
|
||||
</term>
|
||||
<term><literal>\dt</literal></term>
|
||||
<listitem>
|
||||
<para>
|
||||
List only non-system tables.
|
||||
|
@ -815,9 +735,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\dT</literal>
|
||||
</term>
|
||||
<term><literal>\dT</literal></term>
|
||||
<listitem>
|
||||
<para>
|
||||
List types.
|
||||
|
@ -825,10 +743,8 @@ testdb=>
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\e</literal> [ <replaceable class="parameter">filename</replaceable> ]
|
||||
</term>
|
||||
<varlistentry><term>
|
||||
<literal>\e</literal> [ <replaceable class="parameter">filename</replaceable> ]</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Edit the current query buffer or the contents of the file
|
||||
|
@ -838,9 +754,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\E</literal> [ <replaceable class="parameter">filename</replaceable> ]
|
||||
</term>
|
||||
<term><literal>\E</literal> [ <replaceable class="parameter">filename</replaceable> ]</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Edit the current query buffer or the contents of the file
|
||||
|
@ -851,9 +765,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\f</literal> [ <replaceable class="parameter">separator</replaceable> ]
|
||||
</term>
|
||||
<term><literal>\f</literal> [ <replaceable class="parameter">separator</replaceable> ]</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Set the field separator. Default is a single blank space.
|
||||
|
@ -862,9 +774,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\g</literal> [ { <replaceable class="parameter">filename</replaceable> | <literal>|</literal><replaceable class="parameter">command</replaceable> } ]
|
||||
</term>
|
||||
<term><literal>\g</literal> [ { <replaceable class="parameter">filename</replaceable> | <literal>|</literal><replaceable class="parameter">command</replaceable> } ]</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Send the current query input buffer to the backend and optionally
|
||||
|
@ -876,9 +786,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\h</literal> [ <replaceable class="parameter">command</replaceable> ]
|
||||
</term>
|
||||
<term><literal>\h</literal> [ <replaceable class="parameter">command</replaceable> ]</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Give syntax help on the specified SQL command.
|
||||
|
@ -895,9 +803,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\H</literal>
|
||||
</term>
|
||||
<term><literal>\H</literal></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Toggle <acronym>HTML3</acronym> output. This is equivalent to
|
||||
|
@ -908,9 +814,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\i</literal> <replaceable class="parameter">filename</replaceable>
|
||||
</term>
|
||||
<term><literal>\i</literal> <replaceable class="parameter">filename</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Read queries from the file <replaceable class="parameter">filename</replaceable>
|
||||
|
@ -920,9 +824,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\l</literal>
|
||||
</term>
|
||||
<term><literal>\l</literal></term>
|
||||
<listitem>
|
||||
<para>
|
||||
List all the databases in the server.
|
||||
|
@ -931,9 +833,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\m</literal>
|
||||
</term>
|
||||
<term><literal>\m</literal></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Toggle the old monitor-like table display, which includes border characters
|
||||
|
@ -946,9 +846,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\o</literal> [ { <replaceable class="parameter">filename</replaceable> | <literal>|</literal><replaceable class="parameter">command</replaceable> } ]
|
||||
</term>
|
||||
<term><literal>\o</literal> [ { <replaceable class="parameter">filename</replaceable> | <literal>|</literal><replaceable class="parameter">command</replaceable> } ]</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Save future query results to the file
|
||||
|
@ -962,9 +860,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\p</literal>
|
||||
</term>
|
||||
<term><literal>\p</literal></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Print the current query buffer.
|
||||
|
@ -973,9 +869,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\q</literal>
|
||||
</term>
|
||||
<term><literal>\q</literal></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Quit the <application>psql</application> program.
|
||||
|
@ -984,9 +878,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\r</literal>
|
||||
</term>
|
||||
<term><literal>\r</literal></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Reset(clear) the query buffer.
|
||||
|
@ -995,9 +887,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\s</literal> [ <replaceable class="parameter">filename</replaceable> ]
|
||||
</term>
|
||||
<term><literal>\s</literal> [ <replaceable class="parameter">filename</replaceable> ]</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Print or save the command line history to
|
||||
|
@ -1011,9 +901,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\t</literal>
|
||||
</term>
|
||||
<term><literal>\t</literal></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Toggle display of output column name headings and row count footer (defaults to on).
|
||||
|
@ -1022,9 +910,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\T</literal> <replaceable class="parameter">table_options</replaceable>
|
||||
</term>
|
||||
<term><literal>\T</literal> <replaceable class="parameter">table_options</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Allows you to specify options to be placed within the
|
||||
|
@ -1038,9 +924,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\x</literal>
|
||||
</term>
|
||||
<term><literal>\x</literal></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Toggles extended row format mode. When enabled each row will have its column
|
||||
|
@ -1052,9 +936,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\w</literal> <replaceable class="parameter">filename</replaceable>
|
||||
</term>
|
||||
<term><literal>\w</literal> <replaceable class="parameter">filename</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Outputs the current query buffer to the file
|
||||
|
@ -1064,9 +946,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\z</literal>
|
||||
</term>
|
||||
<term><literal>\z</literal></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Produces a list of all tables in the database with their appropriate ACLs
|
||||
|
@ -1076,9 +956,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\!</literal> [ <replaceable class="parameter">command</replaceable> ]
|
||||
</term>
|
||||
<term><literal>\!</literal> [ <replaceable class="parameter">command</replaceable> ]</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Escape to a separate Unix shell or execute the Unix command
|
||||
|
@ -1088,9 +966,7 @@ testdb=>
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<literal>\?</literal>
|
||||
</term>
|
||||
<term><literal>\?</literal></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Get help information about the slash (<quote>\</quote>) commands.
|
||||
|
@ -1114,7 +990,7 @@ 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-catalogs:"/usr/lib/sgml/catalog"
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
-->
|
||||
|
|
|
@ -31,9 +31,7 @@ RESET <replaceable class="PARAMETER">variable</replaceable>
|
|||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<replaceable class="PARAMETER">variable</replaceable>
|
||||
</term>
|
||||
<term><replaceable class="PARAMETER">variable</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Refer to the SET statement for more information on available
|
||||
|
@ -56,9 +54,9 @@ RESET <replaceable class="PARAMETER">variable</replaceable>
|
|||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
RESET VARIABLE
|
||||
</term>
|
||||
<term><computeroutput>
|
||||
RESET VARIABLE
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Message returned if
|
||||
|
@ -110,12 +108,17 @@ RESET <replaceable class="PARAMETER">variable</replaceable>
|
|||
Usage
|
||||
</title>
|
||||
<para>
|
||||
Set DateStyle to its default value:
|
||||
|
||||
<programlisting>
|
||||
-- reset DateStyle to its default;
|
||||
RESET DateStyle;
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Set Geqo to its default value:
|
||||
|
||||
<programlisting>
|
||||
-- reset Geqo to its default;
|
||||
RESET GEQO;
|
||||
</programlisting>
|
||||
</para>
|
||||
|
|
|
@ -34,20 +34,14 @@ REVOKE <replaceable class="PARAMETER">privilege</replaceable> [, ...]
|
|||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<replaceable class="PARAMETER">privilege</replaceable>
|
||||
</term>
|
||||
<term><replaceable class="PARAMETER">privilege</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The possible privileges are:
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
SELECT
|
||||
</term>
|
||||
<term>SELECT</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Privilege to access all of the columns of a specific
|
||||
|
@ -57,9 +51,7 @@ REVOKE <replaceable class="PARAMETER">privilege</replaceable> [, ...]
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
INSERT
|
||||
</term>
|
||||
<term>INSERT</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Privilege to insert data into all columns of a
|
||||
|
@ -69,9 +61,7 @@ REVOKE <replaceable class="PARAMETER">privilege</replaceable> [, ...]
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
UPDATE
|
||||
</term>
|
||||
<term>UPDATE</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Privilege to update all columns of a specific
|
||||
|
@ -81,9 +71,7 @@ REVOKE <replaceable class="PARAMETER">privilege</replaceable> [, ...]
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
DELETE
|
||||
</term>
|
||||
<term>DELETE</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Privilege to delete rows from a specific table.
|
||||
|
@ -92,9 +80,7 @@ REVOKE <replaceable class="PARAMETER">privilege</replaceable> [, ...]
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
RULE
|
||||
</term>
|
||||
<term>RULE</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Privilege to define rules on table/view.
|
||||
|
@ -104,23 +90,24 @@ REVOKE <replaceable class="PARAMETER">privilege</replaceable> [, ...]
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
ALL
|
||||
</term>
|
||||
<term>ALL</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Rescind all privileges.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<replaceable class="PARAMETER">object</replaceable>
|
||||
</term>
|
||||
<term><replaceable class="PARAMETER">object</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of an object from which to revoke access.
|
||||
|
||||
The possible objects are:
|
||||
<itemizedlist spacing="compact" mark="bullet">
|
||||
<listitem>
|
||||
|
@ -152,9 +139,7 @@ REVOKE <replaceable class="PARAMETER">privilege</replaceable> [, ...]
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<replaceable class="PARAMETER">group</replaceable>
|
||||
</term>
|
||||
<term><replaceable class="PARAMETER">group</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of a group from whom to revoke privileges.
|
||||
|
@ -163,9 +148,7 @@ REVOKE <replaceable class="PARAMETER">privilege</replaceable> [, ...]
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<replaceable class="PARAMETER">username</replaceable>
|
||||
</term>
|
||||
<term><replaceable class="PARAMETER">username</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
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>
|
||||
<term>
|
||||
PUBLIC
|
||||
</term>
|
||||
<term>PUBLIC</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Rescind the specified privilege(s) for all users.
|
||||
|
@ -199,9 +180,9 @@ REVOKE <replaceable class="PARAMETER">privilege</replaceable> [, ...]
|
|||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
CHANGE
|
||||
</term>
|
||||
<term><computeroutput>
|
||||
CHANGE
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Message returned if successfully.
|
||||
|
@ -210,9 +191,9 @@ REVOKE <replaceable class="PARAMETER">privilege</replaceable> [, ...]
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
ERROR
|
||||
</term>
|
||||
<term><computeroutput>
|
||||
ERROR
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Message returned if object is not available or impossible
|
||||
|
@ -233,7 +214,7 @@ REVOKE <replaceable class="PARAMETER">privilege</replaceable> [, ...]
|
|||
Description
|
||||
</title>
|
||||
<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.
|
||||
</para>
|
||||
|
||||
|
@ -271,6 +252,7 @@ Legend:
|
|||
<para>
|
||||
Currently, to create a GROUP you have to insert
|
||||
data manually into table pg_group as:
|
||||
|
||||
<programlisting>
|
||||
INSERT INTO pg_group VALUES ('todos');
|
||||
CREATE USER miriam IN GROUP todos;
|
||||
|
@ -286,15 +268,18 @@ CREATE USER miriam IN GROUP todos;
|
|||
Usage
|
||||
</title>
|
||||
<para>
|
||||
<programlisting>
|
||||
-- revoke insert privilege from all users on table films:
|
||||
--
|
||||
REVOKE INSERT ON films FROM PUBLIC;
|
||||
</programlisting>
|
||||
Revoke insert privilege from all users on table
|
||||
<literal>films</literal>:
|
||||
|
||||
<programlisting>
|
||||
REVOKE INSERT ON films FROM PUBLIC;
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Revoke all privileges from user <literal>manuel</literal> on view <literal>kinds</literal>:
|
||||
|
||||
<programlisting>
|
||||
-- revoke all privileges from user manuel on view kinds:
|
||||
--
|
||||
REVOKE ALL ON kinds FROM manuel;
|
||||
</programlisting>
|
||||
</para>
|
||||
|
@ -355,6 +340,7 @@ REVOKE GRANT OPTION FOR <replaceable class="parameter">privilege</replaceable> [
|
|||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The possible objects are:
|
||||
<simplelist>
|
||||
|
@ -381,6 +367,7 @@ REVOKE GRANT OPTION FOR <replaceable class="parameter">privilege</replaceable> [
|
|||
and user2 gives it to user3 then user1 can revoke
|
||||
this privilege in cascade using the CASCADE keyword.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If user1 gives a privilege WITH GRANT OPTION to user2,
|
||||
and user2 gives it to user3 then if user1 try revoke
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<refentry id="SQL-ROLLBACK">
|
||||
<refmeta>
|
||||
<refentrytitle id="SQL-ROLLBACK-TITLE">
|
||||
ROLLBACK
|
||||
ROLLBACK
|
||||
</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>
|
||||
ROLLBACK
|
||||
ROLLBACK
|
||||
</refname>
|
||||
<refpurpose>
|
||||
Aborts the current transaction
|
||||
|
@ -44,9 +44,9 @@ ROLLBACK [ WORK | TRANSACTION ]
|
|||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
ABORT
|
||||
</term>
|
||||
<term><computeroutput>
|
||||
ABORT
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Message returned if successful.
|
||||
|
@ -55,10 +55,10 @@ ROLLBACK [ WORK | TRANSACTION ]
|
|||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
NOTICE: UserAbortTransactionBlock and not in in-progress state
|
||||
ABORT
|
||||
</term>
|
||||
<term><computeroutput>
|
||||
NOTICE: UserAbortTransactionBlock and not in in-progress state
|
||||
ABORT
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
If there is not any transaction currently in progress.
|
||||
|
@ -106,10 +106,10 @@ ROLLBACK [ WORK | TRANSACTION ]
|
|||
Usage
|
||||
</title>
|
||||
<para>
|
||||
To abort all changes:
|
||||
|
||||
<programlisting>
|
||||
--To abort all changes:
|
||||
--
|
||||
ROLLBACK WORK;
|
||||
ROLLBACK WORK;
|
||||
</programlisting>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
@ -129,7 +129,7 @@ ROLLBACK [ WORK | TRANSACTION ]
|
|||
SQL92
|
||||
</title>
|
||||
<para>
|
||||
Full compatibility. TRANSACTION is a
|
||||
Full compatibility. The TRANSACTION keyword is a
|
||||
<productname>Postgres</productname> extension.
|
||||
</para>
|
||||
</refsect2>
|
||||
|
|
Loading…
Reference in New Issue