mirror of
https://github.com/postgres/postgres.git
synced 2025-08-08 06:02:22 +03:00
Update this branch to match CVS head, includes WIN32 improvements.
This commit is contained in:
8
doc/FAQ
8
doc/FAQ
@@ -1,7 +1,7 @@
|
||||
|
||||
Frequently Asked Questions (FAQ) for PostgreSQL
|
||||
|
||||
Last updated: Fri Jul 25 18:07:30 EDT 2003
|
||||
Last updated: Fri Sep 5 12:42:57 EDT 2003
|
||||
|
||||
Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us)
|
||||
|
||||
@@ -199,7 +199,8 @@
|
||||
|
||||
A native port to MS Win NT/2000/XP is currently being worked on. For
|
||||
more details on the current status of PostgreSQL on Windows see
|
||||
http://techdocs.postgresql.org/guides/Windows.
|
||||
http://techdocs.postgresql.org/guides/Windows and
|
||||
http://candle.pha.pa.us/main/writings/pgsql/win32.html.
|
||||
|
||||
There is also a Novell Netware 6 port at http://forge.novell.com.
|
||||
|
||||
@@ -916,7 +917,8 @@ BYTEA bytea variable-length byte array (null-byte safe)
|
||||
|
||||
Finally, you could use the OID returned from the INSERT statement to
|
||||
look up the default value, though this is probably the least portable
|
||||
approach. In Perl, using DBI with Edmund Mergl's DBD::Pg module, the
|
||||
approach, and the oid value will wrap around when it reaches 4
|
||||
billion. In Perl, using DBI with Edmund Mergl's DBD::Pg module, the
|
||||
oid value is made available via $sth->{pg_oid_status} after
|
||||
$sth->execute().
|
||||
|
||||
|
@@ -5,8 +5,8 @@
|
||||
|
||||
Deutsche <20>bersetzung von Ian Barwick (barwick@gmx.net).
|
||||
|
||||
Letzte Aktualisierung der deutschen <20>bersetzung: Di., den 22.07.2003,
|
||||
16:20 CET
|
||||
Letzte Aktualisierung der deutschen <20>bersetzung: Di., den 02.09.2003,
|
||||
10:00 CET
|
||||
|
||||
Die aktuellste Version dieses Dokuments liegt auf der PostgreSQL
|
||||
Website:
|
||||
@@ -1063,9 +1063,12 @@ BYTEA bytea Bytearray mit variabler L
|
||||
|
||||
Schlie<69>lich besteht noch die M<>glichkeit, den von einer
|
||||
INSERT-Anweisung zur<75>ckgelieferten OID-Wert als einmaligen Wert zu
|
||||
verwenden. In Perl mit dem DBD::Pg-Modul von Edmund Mergl wird der
|
||||
OID-Wert nach einem $sth->excute() <20>ber $sth->{pg_oid_status}
|
||||
zur<EFBFBD>ckgeliefert.
|
||||
verwenden. Dieser Ansatz ist allerdings PostgreSQL-spezifisch;
|
||||
au<EFBFBD>erdem wird nach ca. 4 Milliarden Eintr<74>gen der OID-Wert wieder auf
|
||||
eine kleine Zahl gesetzt, ist also nicht garantiert einmalig.
|
||||
|
||||
In Perl mit dem DBD::Pg-Modul wird der OID-Wert nach einem
|
||||
$sth->excute() <20>ber $sth->{pg_oid_status} zur<75>ckgeliefert.
|
||||
|
||||
4.15.3) F<>hren currval() und nextval() zu einer Race-Condition mit anderen
|
||||
Nutzern?
|
||||
@@ -1278,15 +1281,21 @@ BYTEA bytea Bytearray mit variabler L
|
||||
4.28) Welche M<>glichkeiten zur Verschl<68>sselung gibt es?
|
||||
|
||||
* contrib/pgcrypto enth<74>lt diverse Funktionen f<>r die Ben<65>tzung mit
|
||||
SQL-Abfragen;
|
||||
* die einzige M<>glichkeit, Kommunikationen zwischen Client und
|
||||
Server zu verschl<EFBFBD>sseln, ist durch die Anwendung von hostssl in
|
||||
pg_hba.conf;
|
||||
SQL-Abfragen.
|
||||
* Um Verbindungen zwischen dem Server und Client-Anwendungen zu
|
||||
verschl<68>sseln, muss in der Server-Konfigurationsdatei
|
||||
postgresql.conf die ssl-Option auf true (Voreinstellung: false)
|
||||
gesetzt werden und ein passender host- bzw. hostssl-Eintrag muss
|
||||
in pg_hba.conf vorhanden sein. Zudem muss die sslmode-Einstellung
|
||||
beim Client nicht auf disable gesetzt werden. (Bitte beachten Sie
|
||||
auch, da<64> neben der eingebauten SSL-Unterst<73>tzung verschl<68>sselte
|
||||
Verbindungen auch <20>ber externe Anwendungen wie stunnel oder ssh
|
||||
aufgebaut werden k<>nnen).
|
||||
* Die Passw<73>rter der Datenbanknutzer werden ab Version 7.3
|
||||
automatisch verschl<68>sselt (in fr<66>heren Versionen mu<6D> der Parameter
|
||||
PASSWORD_ENCRYPTION in postgresql.conf explizit eingeschaltet
|
||||
werden);
|
||||
* der Server l<>uft auf einem verschl<68>sselten Dateisystem.
|
||||
werden).
|
||||
* Betrieb des Servers auf einem verschl<68>sselten Dateisystem.
|
||||
_________________________________________________________________
|
||||
|
||||
PostgreSQL erweitern
|
||||
@@ -1326,10 +1335,15 @@ BYTEA bytea Bytearray mit variabler L
|
||||
Die englische Vorlage dieser FAQ wird st<73>ndig <20>berarbeitet. Daher
|
||||
liegt die <20>bersetzung nicht immer auf dem aktuellsten Stand.
|
||||
|
||||
Die aktuellste Version der deutschen <20>bersetzung befindet sich immer
|
||||
unter http://sql-info.de/postgresql/FAQ_german.html. Diese
|
||||
"Arbeitsversion" enth<74>lt eventuell <20>nderungen, die noch nicht auf der
|
||||
PostgreSQL-Website eingebunden worden sind.
|
||||
|
||||
<20>ber Verbesserungshinweise und Korrekturvorschl<68>ge sowie
|
||||
Verst<73>ndnisfragen zum Inhalt der FAQ freue ich mich. Ich nehme auch
|
||||
allgemeine Fragen zu PostgreSQL gerne entgegen, kann aber leider keine
|
||||
zeitige Antwort garantieren.
|
||||
allgemeine Fragen zu PostgreSQL gerne entgegen, verweise jedoch auf
|
||||
die Mailing-Listen als schnelle und zuverl<72>ssige Anlaufstellen.
|
||||
|
||||
Diese <20>bersetzung basiert teilweise auf einer fr<66>heren <20>bersetzung von
|
||||
Karsten Schulz (schulz@linux-systemhaus.de).
|
||||
|
29
doc/TODO
29
doc/TODO
@@ -1,6 +1,6 @@
|
||||
TODO list for PostgreSQL
|
||||
========================
|
||||
Last updated: Tue Aug 12 18:04:15 EDT 2003
|
||||
Last updated: Fri Sep 5 15:52:01 EDT 2003
|
||||
|
||||
Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us)
|
||||
|
||||
@@ -52,7 +52,7 @@ Administration
|
||||
* Allow configuration files to be specified in a different directory
|
||||
* -Add start time to pg_stat_activity
|
||||
* Allow limits on per-db/user connections
|
||||
* Have standalone backend read postgresql.conf
|
||||
* -Have standalone backend read postgresql.conf (Tom)
|
||||
* Add group object ownership, so groups can rename/drop/grant on objects,
|
||||
so we can implement roles
|
||||
* Add the concept of dataspaces/tablespaces [tablespaces]
|
||||
@@ -62,6 +62,8 @@ Administration
|
||||
* Allow server log information to be output as INSERT statements
|
||||
* Prevent default re-use of sysids for dropped users and groups
|
||||
* Prevent dropping user that still owns objects, or auto-drop the objects
|
||||
* Allow pooled connections to query prepared queries
|
||||
* Allow pooled connections to close all open WITH HOLD cursors
|
||||
|
||||
|
||||
|
||||
@@ -88,6 +90,10 @@ Data Types
|
||||
from making invalid dates valid
|
||||
* -Prevent month/day swapping of ISO dates to make invalid dates valid
|
||||
* Have initdb set DateStyle based on locale?
|
||||
* Add pg_get_acldef(), pg_get_typedefault(), and pg_get_attrdef()
|
||||
* Add ALTER DOMAIN, AGGREGATE, CONVERSION, SEQUENCE ... OWNER TO
|
||||
* Allow to_char to print localized month names (Karel)
|
||||
|
||||
|
||||
* ARRAYS
|
||||
o Allow nulls in arrays
|
||||
@@ -117,6 +123,8 @@ Multi-Language Support
|
||||
* Prevent mismatch of frontend/backend encodings from converting bytea
|
||||
data from being interpreted as encoded strings
|
||||
* -Remove Cyrillic recode support
|
||||
* Fix upper()/lower() to work for multibyte encodings
|
||||
|
||||
|
||||
|
||||
Views / Rules
|
||||
@@ -142,7 +150,7 @@ Indexes
|
||||
INSERT INTO inherit_table (unique_index_col) VALUES (dup) should fail
|
||||
[inheritance]
|
||||
* Add UNIQUE capability to non-btree indexes
|
||||
* Add btree index support for reltime, tinterval, regproc
|
||||
* -Add btree index support for reltime, tinterval, regproc (Tom)
|
||||
* Add rtree index support for line, lseg, path, point
|
||||
* -Certain indexes will not shrink, e.g. indexes on ever-increasing
|
||||
columns and indexes with many duplicate keys
|
||||
@@ -160,7 +168,7 @@ Indexes
|
||||
float4, numeric/decimal too [optimizer]
|
||||
* Add FILLFACTOR to btree index creation
|
||||
* Add concurrency to GIST
|
||||
* Improve concurrency of hash indexes (Neil)
|
||||
* -Improve concurrency of hash indexes (Tom)
|
||||
* Allow a single index to index multiple tables (for inheritance and subtables)
|
||||
|
||||
|
||||
@@ -188,6 +196,8 @@ Commands
|
||||
* -Have SELECT '13 minutes'::interval display zero seconds in ISO datestyle
|
||||
* Prevent COMMENT ON DATABASE from using a database name
|
||||
* Add GUC variable to prevent waiting on locks
|
||||
* Allow TRUNCATE ... CASCADE/RESTRICT
|
||||
* Allow PREPARE of cursors
|
||||
|
||||
|
||||
* ALTER
|
||||
@@ -204,6 +214,7 @@ Commands
|
||||
o Allow ALTER TABLE to modify column lengths and change to binary
|
||||
compatible types
|
||||
o Add ALTER DATABASE ... OWNER TO newowner
|
||||
o Allow ALTER TABLE ... ALTER CONSTRAINT ... RENAME
|
||||
|
||||
* CLUSTER
|
||||
o Automatically maintain clustering on a table
|
||||
@@ -267,7 +278,7 @@ Clients
|
||||
* -Allow psql to show transaction status if backend protocol changes made
|
||||
* -Add schema, cast, and conversion backslash commands to psql (Christopher)
|
||||
* -Allow pg_dump to dump a specific schema (Neil Conway)
|
||||
* Allow psql to do table completion for SELECT * FROM schema_part and
|
||||
* -Allow psql to do table completion for SELECT * FROM schema_part and
|
||||
table completion for SELECT * FROM schema_name.
|
||||
* Add XML capability to pg_dump and COPY, when backend XML capability
|
||||
* -Allow SSL-enabled clients to turn off SSL transfers
|
||||
@@ -276,6 +287,7 @@ Clients
|
||||
* Allow psql \du to show groups, and add \dg for groups
|
||||
* Allow clients to query WITH HOLD cursors and prepared statements
|
||||
* Prevent unneeded quoting in psql \d output using fmtId()
|
||||
* Add a libpq function to support Parse/DescribeStatement capability
|
||||
|
||||
|
||||
* JDBC
|
||||
@@ -326,7 +338,8 @@ Referential Integrity
|
||||
* Support triggers on columns (Neil)
|
||||
* Have AFTER triggers execute after the appropriate SQL statement in a
|
||||
function, not at the end of the function
|
||||
|
||||
* Print table names with constraint names in error messages, or make constraint
|
||||
names unique within a schema
|
||||
|
||||
Dependency Checking
|
||||
===================
|
||||
@@ -381,6 +394,8 @@ Vacuum
|
||||
* Provide automatic running of vacuum in the background in backend
|
||||
rather than in /contrib [vacuum]
|
||||
* Allow free space map to be auto-sized or warn when it is too small
|
||||
* Maintain a map of recently-expired of pages so vacuum can reclaim
|
||||
free space without a sequential scan
|
||||
|
||||
|
||||
Locking
|
||||
@@ -479,7 +494,7 @@ Source Code
|
||||
* Acquire lock on a relation before building a relcache entry for it
|
||||
* Research interaction of setitimer() and sleep() used by statement_timeout
|
||||
* Add checks for fclose() failure
|
||||
* Change CVS $Id: TODO,v 1.1115 2003/08/13 03:12:04 momjian Exp $ to $PostgreSQL: pgsql/doc/TODO,v 1.1115 2003/08/13 03:12:04 momjian Exp $
|
||||
* Change CVS $Id: TODO,v 1.1115.2.1 2003/09/07 04:36:40 momjian Exp $ to $PostgreSQL: pgsql/doc/TODO,v 1.1115.2.1 2003/09/07 04:36:40 momjian Exp $
|
||||
* Exit postmaster if postgresql.conf can not be opened
|
||||
* Rename /scripts directory because they are all C programs now
|
||||
* Allow the regression tests to start postmaster with -i so the tests
|
||||
|
@@ -10,7 +10,7 @@
|
||||
alink="#0000ff">
|
||||
<H1>Frequently Asked Questions (FAQ) for PostgreSQL</H1>
|
||||
|
||||
<P>Last updated: Fri Jul 25 18:07:30 EDT 2003</P>
|
||||
<P>Last updated: Fri Sep 5 12:42:57 EDT 2003</P>
|
||||
|
||||
<P>Current maintainer: Bruce Momjian (<A href=
|
||||
"mailto:pgman@candle.pha.pa.us">pgman@candle.pha.pa.us</A>)<BR>
|
||||
@@ -251,7 +251,9 @@
|
||||
<p>A native port to MS Win NT/2000/XP is currently being worked
|
||||
on. For more details on the current status of PostgreSQL on Windows see
|
||||
<a href="http://techdocs.postgresql.org/guides/Windows">
|
||||
http://techdocs.postgresql.org/guides/Windows</a>.</p>
|
||||
http://techdocs.postgresql.org/guides/Windows</a> and
|
||||
<a href="http://candle.pha.pa.us/main/writings/pgsql/win32.html">
|
||||
http://candle.pha.pa.us/main/writings/pgsql/win32.html</a>.</p>
|
||||
|
||||
<p>There is also a Novell Netware 6 port at
|
||||
<a href="http://forge.novell.com">http://forge.novell.com</a>.</p>
|
||||
@@ -1152,7 +1154,8 @@ BYTEA bytea variable-length byte array (null-byte safe)
|
||||
|
||||
Finally, you could use the <A href="#4.16"><SMALL>OID</SMALL></A>
|
||||
returned from the <SMALL>INSERT</SMALL> statement to look up the
|
||||
default value, though this is probably the least portable approach.
|
||||
default value, though this is probably the least portable approach,
|
||||
and the oid value will wrap around when it reaches 4 billion.
|
||||
In Perl, using DBI with Edmund Mergl's DBD::Pg module, the oid
|
||||
value is made available via <I>$sth->{pg_oid_status}</I> after
|
||||
<I>$sth->execute()</I>.
|
||||
|
@@ -14,7 +14,7 @@ href="mailto:pgman@candle.pha.pa.us">pgman@candle.pha.pa.us</a>).</p>
|
||||
|
||||
<p>Deutsche <20>bersetzung von Ian Barwick (<a href="mailto:barwick@gmx.net">barwick@gmx.net</a>).</p>
|
||||
|
||||
<p>Letzte Aktualisierung der deutschen <20>bersetzung: Di., den 22.07.2003, 16:20 CET</p>
|
||||
<p>Letzte Aktualisierung der deutschen <20>bersetzung: Di., den 02.09.2003, 10:00 CET</p>
|
||||
|
||||
<p>Die aktuellste Version dieses Dokuments liegt auf der PostgreSQL Website:</p>
|
||||
<ul>
|
||||
@@ -1060,8 +1060,12 @@ BYTEA bytea Bytearray mit variabler L
|
||||
new_id = output of execute("SELECT currval('person_id_seq')");
|
||||
</pre>
|
||||
<p>Schlie<EFBFBD>lich besteht noch die M<>glichkeit, den von einer <small>INSERT</small>-Anweisung
|
||||
zur<75>ckgelieferten <small>OID</small>-Wert als einmaligen Wert zu verwenden.
|
||||
In Perl mit dem <em>DBD::Pg</em>-Modul von Edmund Mergl wird der OID-Wert nach einem
|
||||
zur<75>ckgelieferten <a href="#4.16"><small>OID</small></a>-Wert als einmaligen Wert zu verwenden.
|
||||
Dieser Ansatz ist allerdings PostgreSQL-spezifisch; au<61>erdem wird nach
|
||||
ca. 4 Milliarden Eintr<74>gen der <small>OID</small>-Wert wieder auf eine kleine Zahl
|
||||
gesetzt, ist also nicht garantiert einmalig.</p>
|
||||
|
||||
<p>In Perl mit dem <em>DBD::Pg</em>-Modul wird der OID-Wert nach einem
|
||||
<em>$sth->excute()</em> <20>ber <em>$sth->{pg_oid_status}</em> zur<75>ckgeliefert.</p>
|
||||
|
||||
<h4><a name="4.15.3">4.15.3</a>) F<>hren <em>currval()</em> und <em>nextval()</em> zu einer Race-Condition mit anderen
|
||||
@@ -1285,13 +1289,21 @@ BYTEA bytea Bytearray mit variabler L
|
||||
|
||||
<ul>
|
||||
<li><em>contrib/pgcrypto</em> enth<74>lt diverse Funktionen f<>r die Ben<65>tzung mit
|
||||
SQL-Abfragen;</li>
|
||||
<li>die einzige M<>glichkeit, Kommunikationen zwischen Client und Server
|
||||
zu verschl<68>sseln, ist durch die Anwendung von <em>hostssl</em> in <em>pg_hba.conf</em>;</li>
|
||||
SQL-Abfragen.</li>
|
||||
|
||||
<li>Um Verbindungen zwischen dem Server und Client-Anwendungen zu
|
||||
verschl<68>sseln, muss in der Server-Konfigurationsdatei <em>postgresql.conf</em>
|
||||
die <em>ssl</em>-Option auf <em>true</em> (Voreinstellung: <em>false</em>) gesetzt werden
|
||||
und ein passender <em>host</em>- bzw. <em>hostssl</em>-Eintrag muss in
|
||||
<em>pg_hba.conf</em> vorhanden sein. Zudem muss die <em>sslmode</em>-Einstellung
|
||||
beim Client nicht auf <em>disable</em> gesetzt werden. (Bitte beachten Sie auch,
|
||||
da<64> neben der eingebauten SSL-Unterst<73>tzung verschl<68>sselte Verbindungen
|
||||
auch <20>ber externe Anwendungen wie <em>stunnel</em> oder <em>ssh</em> aufgebaut werden k<>nnen).</li>
|
||||
|
||||
<li>Die Passw<73>rter der Datenbanknutzer werden ab Version 7.3 automatisch
|
||||
verschl<68>sselt (in fr<66>heren Versionen mu<6D> der Parameter <em>PASSWORD_ENCRYPTION</em>
|
||||
in <em>postgresql.conf</em> explizit eingeschaltet werden);</li>
|
||||
<li>der Server l<>uft auf einem verschl<68>sselten Dateisystem.</li>
|
||||
in <em>postgresql.conf</em> explizit eingeschaltet werden).</li>
|
||||
<li>Betrieb des Servers auf einem verschl<68>sselten Dateisystem.</li>
|
||||
</ul>
|
||||
|
||||
<hr />
|
||||
@@ -1333,9 +1345,15 @@ BYTEA bytea Bytearray mit variabler L
|
||||
<p>Die englische Vorlage dieser FAQ wird st<73>ndig <20>berarbeitet. Daher liegt
|
||||
die <20>bersetzung nicht immer auf dem aktuellsten Stand.</p>
|
||||
|
||||
<p>Die aktuellste Version der deutschen <20>bersetzung befindet sich immer unter
|
||||
<a href="http://sql-info.de/postgresql/FAQ_german.html">http://sql-info.de/postgresql/FAQ_german.html</a>.
|
||||
Diese "Arbeitsversion" enth<74>lt eventuell <20>nderungen, die noch nicht auf der
|
||||
PostgreSQL-Website eingebunden worden sind.</p>
|
||||
|
||||
<p><EFBFBD>ber Verbesserungshinweise und Korrekturvorschl<68>ge sowie Verst<73>ndnisfragen
|
||||
zum Inhalt der FAQ freue ich mich. Ich nehme auch allgemeine Fragen zu PostgreSQL gerne
|
||||
entgegen, kann aber leider keine zeitige Antwort garantieren.</p>
|
||||
entgegen, verweise jedoch auf die Mailing-Listen als schnelle und zuverl<72>ssige
|
||||
Anlaufstellen.</p>
|
||||
|
||||
<p>Diese <20>bersetzung basiert teilweise auf einer fr<66>heren <20>bersetzung von Karsten
|
||||
Schulz (<a href="mailto:schulz@linux-systemhaus.de">schulz@linux-systemhaus.de</a>).</p>
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# PostgreSQL documentation makefile
|
||||
#
|
||||
# $Header: /cvsroot/pgsql/doc/src/sgml/Makefile,v 1.57 2003/04/10 01:22:44 petere Exp $
|
||||
# $Header: /cvsroot/pgsql/doc/src/sgml/Makefile,v 1.57.2.1 2003/09/07 04:36:40 momjian Exp $
|
||||
#
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
@@ -48,7 +48,7 @@ endif
|
||||
|
||||
# Enable draft mode during development
|
||||
ifneq (,$(findstring devel, $(VERSION)))
|
||||
JADEFLAGS += -V draft-mode
|
||||
override JADEFLAGS += -V draft-mode
|
||||
endif
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ html: postgres.sgml $(ALLSGML) stylesheet.dsl
|
||||
$(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -i output-html -t sgml $<
|
||||
|
||||
|
||||
COLLATEINDEX := $(PERL) $(COLLATEINDEX) -f -g
|
||||
COLLATEINDEX := LC_ALL=C $(PERL) $(COLLATEINDEX) -f -g
|
||||
|
||||
ifeq (,$(wildcard HTML.index))
|
||||
bookindex.sgml:
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/advanced.sgml,v 1.34 2003/03/25 16:15:35 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/advanced.sgml,v 1.34.2.1 2003/09/07 04:36:40 momjian Exp $
|
||||
-->
|
||||
|
||||
<chapter id="tutorial-advanced">
|
||||
@@ -142,7 +142,7 @@ ERROR: <unnamed> referential integrity violation - key referenced from we
|
||||
<title>Transactions</title>
|
||||
|
||||
<indexterm zone="tutorial-transactions">
|
||||
<primary>transactions</primary>
|
||||
<primary>transaction</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
|
@@ -1,10 +1,10 @@
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/array.sgml,v 1.29 2003/08/09 22:50:21 tgl Exp $ -->
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/array.sgml,v 1.29.2.1 2003/09/07 04:36:40 momjian Exp $ -->
|
||||
|
||||
<sect1 id="arrays">
|
||||
<title>Arrays</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>arrays</primary>
|
||||
<primary>array</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
@@ -162,7 +162,6 @@ ERROR: multidimensional arrays must have array expressions with matching dimens
|
||||
expression syntax is discussed in more detail in <xref
|
||||
linkend="sql-syntax-array-constructors">.
|
||||
</para>
|
||||
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
@@ -326,9 +325,9 @@ UPDATE sal_emp SET pay_by_quarter[1:2] = '{27000,27000}'
|
||||
<literal>||</literal>.
|
||||
<programlisting>
|
||||
SELECT ARRAY[1,2] || ARRAY[3,4];
|
||||
?column?
|
||||
---------------
|
||||
{{1,2},{3,4}}
|
||||
?column?
|
||||
-----------
|
||||
{1,2,3,4}
|
||||
(1 row)
|
||||
|
||||
SELECT ARRAY[5,6] || ARRAY[[1,2],[3,4]];
|
||||
@@ -337,27 +336,68 @@ SELECT ARRAY[5,6] || ARRAY[[1,2],[3,4]];
|
||||
{{5,6},{1,2},{3,4}}
|
||||
(1 row)
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The concatenation operator allows a single element to be pushed on to the
|
||||
beginning or end of a one-dimensional array. It also accepts two
|
||||
<replaceable>N</>-dimensional arrays, or an <replaceable>N</>-dimensional
|
||||
and an <replaceable>N+1</>-dimensional array. In the former case, the two
|
||||
<replaceable>N</>-dimension arrays become outer elements of an
|
||||
<replaceable>N+1</>-dimensional array. In the latter, the
|
||||
<replaceable>N</>-dimensional array is added as either the first or last
|
||||
outer element of the <replaceable>N+1</>-dimensional array.
|
||||
|
||||
When extending an array by concatenation, the subscripts of its existing
|
||||
elements are preserved. For example, when pushing
|
||||
onto the beginning of an array with one-based subscripts, the resulting
|
||||
array has zero-based subscripts:
|
||||
and an <replaceable>N+1</>-dimensional array.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
When a single element is pushed on to the beginning of a one-dimensional
|
||||
array, the result is an array with a lower bound subscript equal to
|
||||
the righthand operand's lower bound subscript, minus one. When a single
|
||||
element is pushed on to the end of a one-dimensional array, the result is
|
||||
an array retaining the lower bound of the lefthand operand. For example:
|
||||
<programlisting>
|
||||
SELECT array_dims(1 || ARRAY[2,3]);
|
||||
array_dims
|
||||
------------
|
||||
[0:2]
|
||||
(1 row)
|
||||
|
||||
SELECT array_dims(ARRAY[1,2] || 3);
|
||||
array_dims
|
||||
------------
|
||||
[1:3]
|
||||
(1 row)
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
When two arrays with an equal number of dimensions are concatenated, the
|
||||
result retains the lower bound subscript of the lefthand operand's outer
|
||||
dimension. The result is an array comprising every element of the lefthand
|
||||
operand followed by every element of the righthand operand. For example:
|
||||
<programlisting>
|
||||
SELECT array_dims(ARRAY[1,2] || ARRAY[3,4,5]);
|
||||
array_dims
|
||||
------------
|
||||
[1:5]
|
||||
(1 row)
|
||||
|
||||
SELECT array_dims(ARRAY[[1,2],[3,4]] || ARRAY[[5,6],[7,8],[9,0]]);
|
||||
array_dims
|
||||
------------
|
||||
[1:5][1:2]
|
||||
(1 row)
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
When an <replaceable>N</>-dimensional array is pushed on to the beginning
|
||||
or end of an <replaceable>N+1</>-dimensional array, the result is
|
||||
analogous to the element-array case above. Each <replaceable>N</>-dimensional
|
||||
sub-array is essentially an element of the <replaceable>N+1</>-dimensional
|
||||
array's outer dimension. For example:
|
||||
<programlisting>
|
||||
SELECT array_dims(ARRAY[1,2] || ARRAY[[3,4],[5,6]]);
|
||||
array_dims
|
||||
------------
|
||||
[0:2][1:2]
|
||||
(1 row)
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
@@ -386,9 +426,9 @@ SELECT array_append(ARRAY[1,2], 3);
|
||||
(1 row)
|
||||
|
||||
SELECT array_cat(ARRAY[1,2], ARRAY[3,4]);
|
||||
array_cat
|
||||
---------------
|
||||
{{1,2},{3,4}}
|
||||
array_cat
|
||||
-----------
|
||||
{1,2,3,4}
|
||||
(1 row)
|
||||
|
||||
SELECT array_cat(ARRAY[[1,2],[3,4]], ARRAY[5,6]);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/backup.sgml,v 2.27 2003/08/01 01:01:52 tgl Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/backup.sgml,v 2.27.2.1 2003/09/07 04:36:40 momjian Exp $
|
||||
-->
|
||||
<chapter id="backup">
|
||||
<title>Backup and Restore</title>
|
||||
@@ -153,6 +153,12 @@ pg_dump -h <replaceable>host1</> <replaceable>dbname</> | psql -h <replaceable>h
|
||||
</para>
|
||||
</important>
|
||||
|
||||
<tip>
|
||||
<para>
|
||||
Restore performance can be improved by increasing <literal>SORT_MEM</>
|
||||
(see <xref linkend="runtime-config-resource-memory">).
|
||||
</para>
|
||||
</tip>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="backup-dump-all">
|
||||
@@ -279,13 +285,15 @@ pg_dump -Fc <replaceable class="parameter">dbname</replaceable> > <replaceable c
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For reasons of backward compatibility, <application>pg_dump</> does
|
||||
not dump large objects by default. To dump large objects you must use
|
||||
either the custom or the TAR output format, and use the <option>-b</> option in
|
||||
<application>pg_dump</>. See the reference pages for details.
|
||||
The directory <filename>contrib/pg_dumplo</> of the
|
||||
<productname>PostgreSQL</> source tree also contains a program that can
|
||||
dump large objects.
|
||||
For reasons of backward compatibility, <application>pg_dump</>
|
||||
does not dump large objects by default.<indexterm><primary>large
|
||||
object</primary><secondary>backup</secondary></indexterm> To dump
|
||||
large objects you must use either the custom or the TAR output
|
||||
format, and use the <option>-b</> option in
|
||||
<application>pg_dump</>. See the reference pages for details. The
|
||||
directory <filename>contrib/pg_dumplo</> of the
|
||||
<productname>PostgreSQL</> source tree also contains a program
|
||||
that can dump large objects.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -365,7 +373,15 @@ tar -cf backup.tar /usr/local/pgsql/data
|
||||
|
||||
<sect1 id="migration">
|
||||
<title>Migration between releases</title>
|
||||
<indexterm zone="migration"><primary>upgrading</></>
|
||||
|
||||
<indexterm zone="migration">
|
||||
<primary>upgrading</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="migration">
|
||||
<primary>version</primary>
|
||||
<secondary>compatibility</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
As a general rule, the internal data storage format is subject to
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/charset.sgml,v 2.37 2003/08/04 04:03:03 tgl Exp $ -->
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/charset.sgml,v 2.37.2.1 2003/09/07 04:36:40 momjian Exp $ -->
|
||||
|
||||
<chapter id="charset">
|
||||
<title>Localization</>
|
||||
@@ -197,7 +197,7 @@ initdb --locale=sv_SE
|
||||
<listitem>
|
||||
<para>
|
||||
Sort order in queries using <command>ORDER BY</>
|
||||
<indexterm><primary>ORDER BY</></>
|
||||
<indexterm><primary>ORDER BY</><secondary>and locales</></indexterm>
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/client-auth.sgml,v 1.53 2003/07/26 13:50:01 momjian Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/client-auth.sgml,v 1.53.2.1 2003/09/07 04:36:40 momjian Exp $
|
||||
-->
|
||||
|
||||
<chapter id="client-authentication">
|
||||
@@ -199,13 +199,17 @@ hostnossl <replaceable>database</replaceable> <replaceable>user</replaceable>
|
||||
<programlisting>
|
||||
(<replaceable>actual-IP-address</replaceable> xor <replaceable>IP-address-field</replaceable>) and <replaceable>IP-mask-field</replaceable>
|
||||
</programlisting>
|
||||
must be zero for the record to match. (Of course IP addresses
|
||||
can be spoofed but this consideration is beyond the scope of
|
||||
<productname>PostgreSQL</productname>.) If you machine supports
|
||||
IPv6, the default <filename>pg_hba.conf</> file will have an
|
||||
IPv6 entry for <literal>localhost</>. You can add your own IPv6
|
||||
entries to the file. IPv6 entries are used only for IPv6
|
||||
connections.
|
||||
must be zero for the record to match.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
An IP address given in IPv4 format will match IPv6 connections that
|
||||
have the corresponding address, for example <literal>127.0.0.1</>
|
||||
will match the IPv6 address <literal>::ffff:127.0.0.1</>. An entry
|
||||
given in IPv6 format will match only IPv6 connections, even if the
|
||||
represented address is in the IPv4-in-IPv6 range. Note that entries
|
||||
in IPv6 format will be rejected if the system's C library does not have
|
||||
support for IPv6 addresses.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -219,9 +223,10 @@ hostnossl <replaceable>database</replaceable> <replaceable>user</replaceable>
|
||||
<term><replaceable>CIDR-mask</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
This is an integer specifying the number of significant bits
|
||||
to set in the mask, and is an alternative to using the
|
||||
<replaceable>IP-mask</replaceable> notation. The number must
|
||||
This field may be used as an alternative to the
|
||||
<replaceable>IP-mask</replaceable> notation. It is an
|
||||
integer specifying the number of high-order bits
|
||||
to set in the mask. The number must
|
||||
be between 0 and 32 (in the case of an IPv4 address) or 128
|
||||
(in the case of an IPv6 address) inclusive. 0 will match any
|
||||
address, while 32/128 will match only the exact host specified.
|
||||
@@ -451,6 +456,11 @@ local all all trust
|
||||
# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
|
||||
host all all 127.0.0.1 255.255.255.255 trust
|
||||
|
||||
# The same as the last line but using a CIDR mask
|
||||
#
|
||||
# TYPE DATABASE USER IP-ADDRESS/CIDR-mask METHOD
|
||||
host all all 127.0.0.1/32 trust
|
||||
|
||||
# Allow any user from any host with IP address 192.168.93.x to connect
|
||||
# to database "template1" as the same user name that ident reports for
|
||||
# the connection (typically the Unix user name).
|
||||
@@ -458,6 +468,11 @@ host all all 127.0.0.1 255.255.255.255 trust
|
||||
# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
|
||||
host template1 all 192.168.93.0 255.255.255.0 ident sameuser
|
||||
|
||||
# The same as the last line but using a CIDR mask
|
||||
#
|
||||
# TYPE DATABASE USER IP-ADDRESS/CIDR-mask METHOD
|
||||
host template1 all 192.168.93.0/24 ident sameuser
|
||||
|
||||
# Allow a user from host 192.168.12.10 to connect to database
|
||||
# "template1" if the user's password is correctly supplied.
|
||||
#
|
||||
@@ -566,6 +581,7 @@ local db1,db2,@demodbs all md5
|
||||
</indexterm>
|
||||
<indexterm>
|
||||
<primary>password</primary>
|
||||
<secondary>authentication</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
@@ -610,16 +626,21 @@ local db1,db2,@demodbs all md5
|
||||
|
||||
<para>
|
||||
<productname>Kerberos</productname> is an industry-standard secure
|
||||
authentication system suitable for distributed computing over a
|
||||
public network. A description of the
|
||||
<productname>Kerberos</productname> system is far beyond the scope
|
||||
of this document; in all generality it can be quite complex (yet
|
||||
powerful). The <ulink
|
||||
authentication system suitable for distributed computing over a public
|
||||
network. A description of the <productname>Kerberos</productname> system
|
||||
is far beyond the scope of this document; in all generality it can be
|
||||
quite complex (yet powerful). The <ulink
|
||||
url="http://www.nrl.navy.mil/CCS/people/kenh/kerberos-faq.html">Kerberos
|
||||
<acronym>FAQ</></ulink> or <ulink
|
||||
url="ftp://athena-dist.mit.edu">MIT Project Athena</ulink> can be
|
||||
a good starting point for exploration. Several sources for
|
||||
<productname>Kerberos</> distributions exist.
|
||||
<acronym>FAQ</></ulink> or <ulink url="ftp://athena-dist.mit.edu">MIT
|
||||
Project Athena</ulink> can be a good starting point for exploration.
|
||||
Several sources for <productname>Kerberos</> distributions exist.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
While <productname>PostgreSQL</> supports both Kerberos 4 and
|
||||
Kerberos 5, only Kerberos 5 is recommended. Kerberos 4 is
|
||||
considered insecure and no longer recommended for general
|
||||
use.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -850,6 +871,10 @@ omicron bryanh guest1
|
||||
<sect2 id="auth-pam">
|
||||
<title>PAM Authentication</title>
|
||||
|
||||
<indexterm zone="auth-pam">
|
||||
<primary>PAM</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
This authentication method operates similarly to
|
||||
<literal>password</literal> except that it uses PAM (Pluggable
|
||||
|
@@ -1,17 +1,17 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.122 2003/08/09 22:50:21 tgl Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.122.2.1 2003/09/07 04:36:40 momjian Exp $
|
||||
-->
|
||||
|
||||
<chapter id="datatype">
|
||||
<title id="datatype-title">Data Types</title>
|
||||
|
||||
<indexterm zone="datatype">
|
||||
<primary>data types</primary>
|
||||
<primary>data type</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>types</primary>
|
||||
<see>data types</see>
|
||||
<primary>type</primary>
|
||||
<see>data type</see>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
@@ -279,68 +279,10 @@ $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.122 2003/08/09 22:50:21 t
|
||||
<title>Numeric Types</title>
|
||||
|
||||
<indexterm zone="datatype-numeric">
|
||||
<primary>data types</primary>
|
||||
<primary>data type</primary>
|
||||
<secondary>numeric</secondary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="datatype-numeric">
|
||||
<primary>integer</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="datatype-numeric">
|
||||
<primary>smallint</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="datatype-numeric">
|
||||
<primary>bigint</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>int4</primary>
|
||||
<see>integer</see>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>int2</primary>
|
||||
<see>smallint</see>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>int8</primary>
|
||||
<see>bigint</see>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="datatype-numeric">
|
||||
<primary>numeric (data type)</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>decimal</primary>
|
||||
<see>numeric</see>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="datatype-numeric">
|
||||
<primary>real</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="datatype-numeric">
|
||||
<primary>double precision</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>float4</primary>
|
||||
<see>real</see>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>float8</primary>
|
||||
<see>double precision</see>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="datatype-numeric">
|
||||
<primary>floating point</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
Numeric types consist of two-, four-, and eight-byte integers,
|
||||
four- and eight-byte floating-point numbers, and fixed-precision
|
||||
@@ -434,6 +376,33 @@ $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.122 2003/08/09 22:50:21 t
|
||||
<sect2 id="datatype-int">
|
||||
<title>Integer Types</title>
|
||||
|
||||
<indexterm zone="datatype-int">
|
||||
<primary>integer</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="datatype-int">
|
||||
<primary>smallint</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="datatype-int">
|
||||
<primary>bigint</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>int4</primary>
|
||||
<see>integer</see>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>int2</primary>
|
||||
<see>smallint</see>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>int8</primary>
|
||||
<see>bigint</see>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
The types <type>smallint</type>, <type>integer</type>, and
|
||||
<type>bigint</type> store whole numbers, that is, numbers without
|
||||
@@ -495,6 +464,15 @@ $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.122 2003/08/09 22:50:21 t
|
||||
<sect2 id="datatype-numeric-decimal">
|
||||
<title>Arbitrary Precision Numbers</title>
|
||||
|
||||
<indexterm zone="datatype-numeric-decimal">
|
||||
<primary>numeric (data type)</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>decimal</primary>
|
||||
<see>numeric</see>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
The type <type>numeric</type> can store numbers with up to 1000
|
||||
digits of precision and perform calculations exactly. It is
|
||||
@@ -562,6 +540,28 @@ NUMERIC
|
||||
<sect2 id="datatype-float">
|
||||
<title>Floating-Point Types</title>
|
||||
|
||||
<indexterm zone="datatype-float">
|
||||
<primary>real</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="datatype-float">
|
||||
<primary>double precision</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>float4</primary>
|
||||
<see>real</see>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>float8</primary>
|
||||
<see>double precision</see>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="datatype-float">
|
||||
<primary>floating point</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
The data types <type>real</type> and <type>double
|
||||
precision</type> are inexact, variable-precision numeric types.
|
||||
@@ -675,7 +675,7 @@ NUMERIC
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>sequences</primary>
|
||||
<primary>sequence</primary>
|
||||
<secondary>and serial type</secondary>
|
||||
</indexterm>
|
||||
|
||||
@@ -807,18 +807,33 @@ CREATE TABLE <replaceable class="parameter">tablename</replaceable> (
|
||||
<title>Character Types</title>
|
||||
|
||||
<indexterm zone="datatype-character">
|
||||
<primary>character strings</primary>
|
||||
<primary>character string</primary>
|
||||
<secondary>data types</secondary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>strings</primary>
|
||||
<see>character strings</see>
|
||||
<primary>string</primary>
|
||||
<see>character string</see>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<indexterm zone="datatype-character">
|
||||
<primary>character</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="datatype-character">
|
||||
<primary>character varying</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="datatype-character">
|
||||
<primary>text</primary>
|
||||
<see>character strings</see>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="datatype-character">
|
||||
<primary>char</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="datatype-character">
|
||||
<primary>varchar</primary>
|
||||
</indexterm>
|
||||
|
||||
<table id="datatype-character-table">
|
||||
@@ -1020,6 +1035,15 @@ SELECT b, char_length(b) FROM test2;
|
||||
|
||||
<sect1 id="datatype-binary">
|
||||
<title>Binary Data Types</title>
|
||||
|
||||
<indexterm zone="datatype-binary">
|
||||
<primary>binary data</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="datatype-binary">
|
||||
<primary>bytea</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
The <type>bytea</type> data type allows storage of binary strings;
|
||||
see <xref linkend="datatype-binary-table">.
|
||||
@@ -1210,6 +1234,34 @@ SELECT b, char_length(b) FROM test2;
|
||||
<sect1 id="datatype-datetime">
|
||||
<title>Date/Time Types</title>
|
||||
|
||||
<indexterm zone="datatype-datetime">
|
||||
<primary>date</primary>
|
||||
</indexterm>
|
||||
<indexterm zone="datatype-datetime">
|
||||
<primary>time</primary>
|
||||
</indexterm>
|
||||
<indexterm zone="datatype-datetime">
|
||||
<primary>time without time zone</primary>
|
||||
</indexterm>
|
||||
<indexterm zone="datatype-datetime">
|
||||
<primary>time with time zone</primary>
|
||||
</indexterm>
|
||||
<indexterm zone="datatype-datetime">
|
||||
<primary>timestamp</primary>
|
||||
</indexterm>
|
||||
<indexterm zone="datatype-datetime">
|
||||
<primary>timestamp with time zone</primary>
|
||||
</indexterm>
|
||||
<indexterm zone="datatype-datetime">
|
||||
<primary>timestamp without time zone</primary>
|
||||
</indexterm>
|
||||
<indexterm zone="datatype-datetime">
|
||||
<primary>interval</primary>
|
||||
</indexterm>
|
||||
<indexterm zone="datatype-datetime">
|
||||
<primary>time span</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
<productname>PostgreSQL</productname> supports the full set of
|
||||
<acronym>SQL</acronym> date and time types, shown in <xref
|
||||
@@ -1387,7 +1439,6 @@ SELECT b, char_length(b) FROM test2;
|
||||
|
||||
<indexterm>
|
||||
<primary>date</primary>
|
||||
<secondary>data type</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
@@ -1461,15 +1512,12 @@ SELECT b, char_length(b) FROM test2;
|
||||
|
||||
<indexterm>
|
||||
<primary>time</primary>
|
||||
<secondary>data type</secondary>
|
||||
</indexterm>
|
||||
<indexterm>
|
||||
<primary>time without time zone</primary>
|
||||
<secondary>time</secondary>
|
||||
</indexterm>
|
||||
<indexterm>
|
||||
<primary>time with time zone</primary>
|
||||
<secondary>data type</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
@@ -1587,17 +1635,14 @@ SELECT b, char_length(b) FROM test2;
|
||||
|
||||
<indexterm>
|
||||
<primary>timestamp</primary>
|
||||
<secondary>data type</secondary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>timestamp with time zone</primary>
|
||||
<secondary>data type</secondary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>timestamp without time zone</primary>
|
||||
<secondary>data type</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
@@ -1797,13 +1842,13 @@ January 8 04:05:06 1999 PST
|
||||
<indexterm>
|
||||
<primary>date</primary>
|
||||
<secondary>output format</secondary>
|
||||
<seealso>Formatting</seealso>
|
||||
<seealso>formatting</seealso>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>time</primary>
|
||||
<secondary>output format</secondary>
|
||||
<seealso>Formatting</seealso>
|
||||
<seealso>formatting</seealso>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
@@ -1924,7 +1969,7 @@ January 8 04:05:06 1999 PST
|
||||
<title>Time Zones</title>
|
||||
|
||||
<indexterm zone="datatype-timezones">
|
||||
<primary>time zones</primary>
|
||||
<primary>time zone</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
@@ -2265,7 +2310,11 @@ SELECT * FROM test1 WHERE a;
|
||||
<title>Line Segments</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>line</primary>
|
||||
<primary>lseg</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>line segment</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
@@ -2293,6 +2342,10 @@ SELECT * FROM test1 WHERE a;
|
||||
<primary>box (data type)</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>rectangle</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
Boxes are represented by pairs of points that are opposite
|
||||
corners of the box.
|
||||
@@ -2431,7 +2484,7 @@ SELECT * FROM test1 WHERE a;
|
||||
|
||||
<indexterm zone="datatype-net-types">
|
||||
<primary>network</primary>
|
||||
<secondary>addresses</secondary>
|
||||
<secondary>data types</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
@@ -2708,7 +2761,7 @@ SELECT * FROM test1 WHERE a;
|
||||
<title>Bit String Types</title>
|
||||
|
||||
<indexterm zone="datatype-bit">
|
||||
<primary>bit strings</primary>
|
||||
<primary>bit string</primary>
|
||||
<secondary>data type</secondary>
|
||||
</indexterm>
|
||||
|
||||
@@ -3045,11 +3098,6 @@ SELECT * FROM test;
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><type>record</></entry>
|
||||
<entry>Identifies a function returning an unspecified row type.</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><type>any</></entry>
|
||||
<entry>Indicates that a function accepts any input data type whatever.</entry>
|
||||
@@ -3058,28 +3106,13 @@ SELECT * FROM test;
|
||||
<row>
|
||||
<entry><type>anyarray</></entry>
|
||||
<entry>Indicates that a function accepts any array data type
|
||||
(see <xref linkend="types-polymorphic">).</entry>
|
||||
(see <xref linkend="extend-types-polymorphic">).</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><type>anyelement</></entry>
|
||||
<entry>Indicates that a function accepts any data type
|
||||
(see <xref linkend="types-polymorphic">).</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><type>void</></entry>
|
||||
<entry>Indicates that a function returns no value.</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><type>trigger</></entry>
|
||||
<entry>A trigger function is declared to return <type>trigger.</></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><type>language_handler</></entry>
|
||||
<entry>A procedural language call handler is declared to return <type>language_handler</>.</entry>
|
||||
(see <xref linkend="extend-types-polymorphic">).</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
@@ -3093,6 +3126,26 @@ SELECT * FROM test;
|
||||
data type.</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><type>language_handler</></entry>
|
||||
<entry>A procedural language call handler is declared to return <type>language_handler</>.</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><type>record</></entry>
|
||||
<entry>Identifies a function returning an unspecified row type.</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><type>trigger</></entry>
|
||||
<entry>A trigger function is declared to return <type>trigger.</></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><type>void</></entry>
|
||||
<entry>Indicates that a function returns no value.</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><type>opaque</></entry>
|
||||
<entry>An obsolete type name that formerly served all the above purposes.</entry>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/datetime.sgml,v 2.32 2003/07/29 00:03:17 tgl Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/datetime.sgml,v 2.32.2.1 2003/09/07 04:36:41 momjian Exp $
|
||||
-->
|
||||
|
||||
<appendix id="datetime-appendix">
|
||||
@@ -364,7 +364,8 @@ $Header: /cvsroot/pgsql/doc/src/sgml/datetime.sgml,v 2.32 2003/07/29 00:03:17 tg
|
||||
</para>
|
||||
|
||||
<indexterm>
|
||||
<primary>time zones</primary>
|
||||
<primary>time zone</primary>
|
||||
<secondary>abbreviations</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
@@ -536,18 +537,10 @@ $Header: /cvsroot/pgsql/doc/src/sgml/datetime.sgml,v 2.32 2003/07/29 00:03:17 tg
|
||||
<entry>+07:00</entry>
|
||||
<entry>Christmas (Island) Time</entry>
|
||||
</row>
|
||||
<!--
|
||||
Conflicts with China Coastal Time
|
||||
<row>
|
||||
<entry>CCT</entry>
|
||||
<entry>+06:30</entry>
|
||||
<entry>Cocos Island Time</entry>
|
||||
</row>
|
||||
-->
|
||||
<row>
|
||||
<entry>MMT</entry>
|
||||
<entry>+06:30</entry>
|
||||
<entry>Myannar Time</entry>
|
||||
<entry>Myanmar Time</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>ALMT</entry>
|
||||
@@ -759,6 +752,21 @@ $Header: /cvsroot/pgsql/doc/src/sgml/datetime.sgml,v 2.32 2003/07/29 00:03:17 tg
|
||||
<entry>-01:00</entry>
|
||||
<entry>West Africa Time</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>FNST</entry>
|
||||
<entry>-01:00</entry>
|
||||
<entry>Fernando de Noronha Summer Time</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>FNT</entry>
|
||||
<entry>-02:00</entry>
|
||||
<entry>Fernando de Noronha Time</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>BRST</entry>
|
||||
<entry>-02:00</entry>
|
||||
<entry>Brasilia Summer Time</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>NDT</entry>
|
||||
<entry>-02:30</entry>
|
||||
@@ -774,6 +782,11 @@ $Header: /cvsroot/pgsql/doc/src/sgml/datetime.sgml,v 2.32 2003/07/29 00:03:17 tg
|
||||
<entry>-03:00</entry>
|
||||
<entry>(unknown)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>BRT</entry>
|
||||
<entry>-03:00</entry>
|
||||
<entry>Brasilia Time</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>NFT</entry>
|
||||
<entry>-03:30</entry>
|
||||
@@ -794,11 +807,6 @@ $Header: /cvsroot/pgsql/doc/src/sgml/datetime.sgml,v 2.32 2003/07/29 00:03:17 tg
|
||||
<entry>-04:00</entry>
|
||||
<entry>Atlantic/Porto Acre Summer Time</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>ACT</entry>
|
||||
<entry>-05:00</entry>
|
||||
<entry>Atlantic/Porto Acre Standard Time</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>EDT</entry>
|
||||
<entry>-04:00</entry>
|
||||
@@ -811,6 +819,11 @@ $Header: /cvsroot/pgsql/doc/src/sgml/datetime.sgml,v 2.32 2003/07/29 00:03:17 tg
|
||||
<entry>GMT +4 hours</entry>
|
||||
</row>
|
||||
-->
|
||||
<row>
|
||||
<entry>ACT</entry>
|
||||
<entry>-05:00</entry>
|
||||
<entry>Atlantic/Porto Acre Standard Time</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>CDT</entry>
|
||||
<entry>-05:00</entry>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/ddl.sgml,v 1.17 2003/08/14 23:13:27 tgl Exp $ -->
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/ddl.sgml,v 1.17.2.1 2003/09/07 04:36:41 momjian Exp $ -->
|
||||
|
||||
<chapter id="ddl">
|
||||
<title>Data Definition</title>
|
||||
@@ -19,6 +19,18 @@
|
||||
<sect1 id="ddl-basics">
|
||||
<title>Table Basics</title>
|
||||
|
||||
<indexterm zone="ddl-basics">
|
||||
<primary>table</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>row</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>column</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
A table in a relational database is much like a table on paper: It
|
||||
consists of rows and columns. The number and order of the columns
|
||||
@@ -60,6 +72,11 @@
|
||||
containing both date and time.
|
||||
</para>
|
||||
|
||||
<indexterm>
|
||||
<primary>table</primary>
|
||||
<secondary>creating</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
To create a table, you use the aptly named <literal>CREATE
|
||||
TABLE</literal> command. In this command you specify at least a
|
||||
@@ -114,6 +131,11 @@ CREATE TABLE products (
|
||||
highly unusual and often a questionable design.
|
||||
</para>
|
||||
|
||||
<indexterm>
|
||||
<primary>table</primary>
|
||||
<secondary>removing</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
If you no longer need a table, you can remove it using the
|
||||
<command>DROP TABLE</command> command. For example:
|
||||
@@ -156,8 +178,8 @@ DROP TABLE products;
|
||||
</para>
|
||||
|
||||
<indexterm>
|
||||
<primary>columns</primary>
|
||||
<secondary>system columns</secondary>
|
||||
<primary>column</primary>
|
||||
<secondary>system column</secondary>
|
||||
</indexterm>
|
||||
|
||||
<variablelist>
|
||||
@@ -167,6 +189,7 @@ DROP TABLE products;
|
||||
<para>
|
||||
<indexterm>
|
||||
<primary>OID</primary>
|
||||
<secondary>column</secondary>
|
||||
</indexterm>
|
||||
The object identifier (object ID) of a row. This is a serial
|
||||
number that is automatically added by
|
||||
@@ -182,6 +205,10 @@ DROP TABLE products;
|
||||
<varlistentry>
|
||||
<term><structfield>tableoid</></term>
|
||||
<listitem>
|
||||
<indexterm>
|
||||
<primary>tableoid</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
The OID of the table containing this row. This column is
|
||||
particularly handy for queries that select from inheritance
|
||||
@@ -197,6 +224,10 @@ DROP TABLE products;
|
||||
<varlistentry>
|
||||
<term><structfield>xmin</></term>
|
||||
<listitem>
|
||||
<indexterm>
|
||||
<primary>xmin</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
The identity (transaction ID) of the inserting transaction for
|
||||
this tuple. (Note: In this context, a tuple is an individual
|
||||
@@ -209,6 +240,10 @@ DROP TABLE products;
|
||||
<varlistentry>
|
||||
<term><structfield>cmin</></term>
|
||||
<listitem>
|
||||
<indexterm>
|
||||
<primary>cmin</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
The command identifier (starting at zero) within the inserting
|
||||
transaction.
|
||||
@@ -219,6 +254,10 @@ DROP TABLE products;
|
||||
<varlistentry>
|
||||
<term><structfield>xmax</></term>
|
||||
<listitem>
|
||||
<indexterm>
|
||||
<primary>xmax</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
The identity (transaction ID) of the deleting transaction, or
|
||||
zero for an undeleted tuple. It is possible for this column to
|
||||
@@ -232,6 +271,10 @@ DROP TABLE products;
|
||||
<varlistentry>
|
||||
<term><structfield>cmax</></term>
|
||||
<listitem>
|
||||
<indexterm>
|
||||
<primary>cmax</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
The command identifier within the deleting transaction, or zero.
|
||||
</para>
|
||||
@@ -241,6 +284,10 @@ DROP TABLE products;
|
||||
<varlistentry>
|
||||
<term><structfield>ctid</></term>
|
||||
<listitem>
|
||||
<indexterm>
|
||||
<primary>ctid</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
The physical location of the tuple within its table. Note that
|
||||
although the <structfield>ctid</structfield> can be used to
|
||||
@@ -292,6 +339,10 @@ DROP TABLE products;
|
||||
<sect1 id="ddl-default">
|
||||
<title>Default Values</title>
|
||||
|
||||
<indexterm zone="ddl-default">
|
||||
<primary>default value</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
A column can be assigned a default value. When a new row is
|
||||
created and no values are specified for some of the columns, the
|
||||
@@ -302,6 +353,7 @@ DROP TABLE products;
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<indexterm><primary>null value</primary><secondary>default value</secondary></indexterm>
|
||||
If no default value is declared explicitly, the null value is the
|
||||
default value. This usually makes sense because a null value can
|
||||
be thought to represent unknown data.
|
||||
@@ -329,6 +381,10 @@ CREATE TABLE products (
|
||||
<sect1 id="ddl-constraints">
|
||||
<title>Constraints</title>
|
||||
|
||||
<indexterm zone="ddl-constraints">
|
||||
<primary>constraint</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
Data types are a way to limit the kind of data that can be stored
|
||||
in a table. For many applications, however, the constraint they
|
||||
@@ -351,6 +407,15 @@ CREATE TABLE products (
|
||||
<sect2>
|
||||
<title>Check Constraints</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>check constraint</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>constraint</primary>
|
||||
<secondary>check</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
A check constraint is the most generic constraint type. It allows
|
||||
you to specify that the value in a certain column must satisfy an
|
||||
@@ -375,6 +440,11 @@ CREATE TABLE products (
|
||||
would not make too much sense.
|
||||
</para>
|
||||
|
||||
<indexterm>
|
||||
<primary>constraint</primary>
|
||||
<secondary>name</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
You can also give the constraint a separate name. This clarifies
|
||||
error messages and allows you to refer to the constraint when you
|
||||
@@ -444,6 +514,11 @@ CREATE TABLE products (
|
||||
It's a matter of taste.
|
||||
</para>
|
||||
|
||||
<indexterm>
|
||||
<primary>null value</primary>
|
||||
<secondary sortas="check constraints">with check constraints</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
It should be noted that a check constraint is satisfied if the
|
||||
check expression evaluates to true or the null value. Since most
|
||||
@@ -457,6 +532,15 @@ CREATE TABLE products (
|
||||
<sect2>
|
||||
<title>Not-Null Constraints</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>not-null constraint</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>constraint</primary>
|
||||
<secondary>NOT NULL</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
A not-null constraint simply specifies that a column must not
|
||||
assume the null value. A syntax example:
|
||||
@@ -526,6 +610,15 @@ CREATE TABLE products (
|
||||
<sect2>
|
||||
<title>Unique Constraints</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>unique constraint</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>constraint</primary>
|
||||
<secondary>unique</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
Unique constraints ensure that the data contained in a column or a
|
||||
group of columns is unique with respect to all the rows in the
|
||||
@@ -573,6 +666,11 @@ CREATE TABLE products (
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<indexterm>
|
||||
<primary>null value</primary>
|
||||
<secondary sortas="unique constraints">with unique constraints</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
In general, a unique constraint is violated when there are (at
|
||||
least) two rows in the table where the values of each of the
|
||||
@@ -591,6 +689,15 @@ CREATE TABLE products (
|
||||
<sect2>
|
||||
<title>Primary Keys</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>primary key</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>constraint</primary>
|
||||
<secondary>primary key</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
Technically, a primary key constraint is simply a combination of a
|
||||
unique constraint and a not-null constraint. So, the following
|
||||
@@ -649,6 +756,19 @@ CREATE TABLE example (
|
||||
<sect2 id="ddl-constraints-fk">
|
||||
<title>Foreign Keys</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>foreign key</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>constraint</primary>
|
||||
<secondary>foreign key</secondary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>referential integrity</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
A foreign key constraint specifies that the values in a column (or
|
||||
a group of columns) must match the values appearing in some row
|
||||
@@ -749,6 +869,16 @@ CREATE TABLE order_items (
|
||||
the last table.
|
||||
</para>
|
||||
|
||||
<indexterm>
|
||||
<primary>CASCADE</primary>
|
||||
<secondary>foreign key action</secondary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>RESTRICT</primary>
|
||||
<secondary>foreign key action</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
We know that the foreign keys disallow creation of orders that
|
||||
do not relate to any products. But what if a product is removed
|
||||
@@ -998,6 +1128,11 @@ SET SQL_Inheritance TO OFF;
|
||||
<sect1 id="ddl-alter">
|
||||
<title>Modifying Tables</title>
|
||||
|
||||
<indexterm zone="ddl-alter">
|
||||
<primary>table</primary>
|
||||
<secondary>modifying</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
When you create a table and you realize that you made a mistake, or
|
||||
the requirements of the application changed, then you can drop the
|
||||
@@ -1042,6 +1177,11 @@ SET SQL_Inheritance TO OFF;
|
||||
<sect2>
|
||||
<title>Adding a Column</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>column</primary>
|
||||
<secondary>adding</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
To add a column, use this command:
|
||||
<programlisting>
|
||||
@@ -1070,6 +1210,11 @@ ALTER TABLE products ADD COLUMN description text CHECK (description <> '')
|
||||
<sect2>
|
||||
<title>Removing a Column</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>column</primary>
|
||||
<secondary>removing</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
To remove a column, use this command:
|
||||
<programlisting>
|
||||
@@ -1081,6 +1226,11 @@ ALTER TABLE products DROP COLUMN description;
|
||||
<sect2>
|
||||
<title>Adding a Constraint</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>constraint</primary>
|
||||
<secondary>adding</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
To add a constraint, the table constraint syntax is used. For example:
|
||||
<programlisting>
|
||||
@@ -1104,6 +1254,11 @@ ALTER TABLE products ALTER COLUMN product_no SET NOT NULL;
|
||||
<sect2>
|
||||
<title>Removing a Constraint</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>constraint</primary>
|
||||
<secondary>removing</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
To remove a constraint you need to know its name. If you gave it
|
||||
a name then that's easy. Otherwise the system assigned a
|
||||
@@ -1127,6 +1282,11 @@ ALTER TABLE products ALTER COLUMN product_no DROP NOT NULL;
|
||||
<sect2>
|
||||
<title>Changing the Default</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>default value</primary>
|
||||
<secondary>changing</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
To set a new default for a column, use a command like this:
|
||||
<programlisting>
|
||||
@@ -1146,6 +1306,11 @@ ALTER TABLE products ALTER COLUMN price DROP DEFAULT;
|
||||
<sect2>
|
||||
<title>Renaming a Column</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>column</primary>
|
||||
<secondary>renaming</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
To rename a column:
|
||||
<programlisting>
|
||||
@@ -1157,6 +1322,11 @@ ALTER TABLE products RENAME COLUMN product_no TO product_number;
|
||||
<sect2>
|
||||
<title>Renaming a Table</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>table</primary>
|
||||
<secondary>renaming</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
To rename a table:
|
||||
<programlisting>
|
||||
@@ -1169,6 +1339,15 @@ ALTER TABLE products RENAME TO items;
|
||||
<sect1 id="ddl-priv">
|
||||
<title>Privileges</title>
|
||||
|
||||
<indexterm zone="ddl-priv">
|
||||
<primary>privilege</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>permission</primary>
|
||||
<see>privilege</see>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
When you create a database object, you become its owner. By
|
||||
default, only the owner of an object can do anything with the
|
||||
@@ -1241,12 +1420,8 @@ REVOKE ALL ON accounts FROM PUBLIC;
|
||||
<sect1 id="ddl-schemas">
|
||||
<title>Schemas</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>schemas</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>namespaces</primary>
|
||||
<indexterm zone="ddl-schemas">
|
||||
<primary>schema</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
@@ -1313,6 +1488,11 @@ REVOKE ALL ON accounts FROM PUBLIC;
|
||||
<sect2 id="ddl-schemas-create">
|
||||
<title>Creating a Schema</title>
|
||||
|
||||
<indexterm zone="ddl-schemas-create">
|
||||
<primary>schema</primary>
|
||||
<secondary>creating</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
To create a separate schema, use the command <literal>CREATE
|
||||
SCHEMA</literal>. Give the schema a name of your choice. For
|
||||
@@ -1323,11 +1503,11 @@ CREATE SCHEMA myschema;
|
||||
</para>
|
||||
|
||||
<indexterm>
|
||||
<primary>qualified names</primary>
|
||||
<primary>qualified name</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>names</primary>
|
||||
<primary>name</primary>
|
||||
<secondary>qualified</secondary>
|
||||
</indexterm>
|
||||
|
||||
@@ -1359,6 +1539,11 @@ CREATE TABLE myschema.mytable (
|
||||
the following chapters.
|
||||
</para>
|
||||
|
||||
<indexterm>
|
||||
<primary>schema</primary>
|
||||
<secondary>removing</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
To drop a schema if it's empty (all objects in it have been
|
||||
dropped), use
|
||||
@@ -1394,6 +1579,11 @@ CREATE SCHEMA <replaceable>schemaname</replaceable> AUTHORIZATION <replaceable>u
|
||||
<sect2 id="ddl-schemas-public">
|
||||
<title>The Public Schema</title>
|
||||
|
||||
<indexterm zone="ddl-schemas-public">
|
||||
<primary>schema</primary>
|
||||
<secondary>public</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
In the previous sections we created tables without specifying any
|
||||
schema names. By default, such tables (and other objects) are
|
||||
@@ -1417,11 +1607,11 @@ CREATE TABLE public.products ( ... );
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>unqualified names</primary>
|
||||
<primary>unqualified name</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>names</primary>
|
||||
<primary>name</primary>
|
||||
<secondary>unqualified</secondary>
|
||||
</indexterm>
|
||||
|
||||
@@ -1437,6 +1627,11 @@ CREATE TABLE public.products ( ... );
|
||||
in other schemas in the database.
|
||||
</para>
|
||||
|
||||
<indexterm>
|
||||
<primary>schema</primary>
|
||||
<secondary>current</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
The first schema named in the search path is called the current schema.
|
||||
Aside from being the first schema searched, it is also the schema in
|
||||
@@ -1444,6 +1639,10 @@ CREATE TABLE public.products ( ... );
|
||||
command does not specify a schema name.
|
||||
</para>
|
||||
|
||||
<indexterm>
|
||||
<primary>search_path</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
To show the current search path, use the following command:
|
||||
<programlisting>
|
||||
@@ -1523,6 +1722,11 @@ SELECT 3 OPERATOR(pg_catalog.+) 4;
|
||||
<sect2 id="ddl-schemas-priv">
|
||||
<title>Schemas and Privileges</title>
|
||||
|
||||
<indexterm zone="ddl-schemas-priv">
|
||||
<primary>privilege</primary>
|
||||
<secondary sortas="schemas">for schemas</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
By default, users cannot see the objects in schemas they do not
|
||||
own. To allow that, the owner of the schema needs to grant the
|
||||
@@ -1550,9 +1754,14 @@ REVOKE CREATE ON SCHEMA public FROM PUBLIC;
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<sect2 id="ddl-schemas-catalog">
|
||||
<title>The System Catalog Schema</title>
|
||||
|
||||
<indexterm zone="ddl-schemas-catalog">
|
||||
<primary>system catalog</primary>
|
||||
<secondary>schema</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
In addition to <literal>public</> and user-created schemas, each
|
||||
database contains a <literal>pg_catalog</> schema, which contains
|
||||
@@ -1701,6 +1910,16 @@ REVOKE CREATE ON SCHEMA public FROM PUBLIC;
|
||||
<sect1 id="ddl-depend">
|
||||
<title>Dependency Tracking</title>
|
||||
|
||||
<indexterm zone="ddl-depend">
|
||||
<primary>CASCADE</primary>
|
||||
<secondary sortas="DROP">with DROP</secondary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="ddl-depend">
|
||||
<primary>RESTRICT</primary>
|
||||
<secondary sortas="DROP">with DROP</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
When you create complex database structures involving many tables
|
||||
with foreign key constraints, views, triggers, functions, etc. you
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/dfunc.sgml,v 1.25 2003/04/10 01:22:44 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/dfunc.sgml,v 1.25.2.1 2003/09/07 04:36:41 momjian Exp $
|
||||
-->
|
||||
|
||||
<sect2 id="dfunc">
|
||||
@@ -8,9 +8,11 @@ $Header: /cvsroot/pgsql/doc/src/sgml/dfunc.sgml,v 1.25 2003/04/10 01:22:44 peter
|
||||
<para>
|
||||
Before you are able to use your
|
||||
<productname>PostgreSQL</productname> extension functions written in
|
||||
C, they must be compiled and linked in a special way to produce a file
|
||||
that can be dynamically loaded by the server. To be
|
||||
precise, a <firstterm>shared library</firstterm> needs to be created.
|
||||
C, they must be compiled and linked in a special way to produce a
|
||||
file that can be dynamically loaded by the server. To be precise, a
|
||||
<firstterm>shared library</firstterm> needs to be
|
||||
created.<indexterm><primary>shared library</></indexterm>
|
||||
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -26,17 +28,18 @@ $Header: /cvsroot/pgsql/doc/src/sgml/dfunc.sgml,v 1.25 2003/04/10 01:22:44 peter
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<indexterm><primary>PIC</></>
|
||||
Creating shared libraries is generally analogous to linking
|
||||
executables: first the source files are compiled into object files,
|
||||
then the object files are linked together. The object files need to
|
||||
be created as <firstterm>position-independent code</firstterm>
|
||||
(<acronym>PIC</acronym>), which conceptually means that they can be
|
||||
placed at an arbitrary location in memory when they are loaded by the
|
||||
executable. (Object files intended for executables are usually not compiled
|
||||
that way.) The command to link a shared library contains special
|
||||
flags to distinguish it from linking an executable. --- At least
|
||||
this is the theory. On some systems the practice is much uglier.
|
||||
<indexterm><primary>PIC</></> Creating shared libraries is generally
|
||||
analogous to linking executables: first the source files are
|
||||
compiled into object files, then the object files are linked
|
||||
together. The object files need to be created as
|
||||
<firstterm>position-independent code</firstterm>
|
||||
(<acronym>PIC</acronym>),<indexterm><primary>PIC</></> which
|
||||
conceptually means that they can be placed at an arbitrary location
|
||||
in memory when they are loaded by the executable. (Object files
|
||||
intended for executables are usually not compiled that way.) The
|
||||
command to link a shared library contains special flags to
|
||||
distinguish it from linking an executable. --- At least this is the
|
||||
theory. On some systems the practice is much uglier.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -57,7 +60,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/dfunc.sgml,v 1.25 2003/04/10 01:22:44 peter
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><systemitem class="osname">BSD/OS</></term>
|
||||
<indexterm><primary>BSD/OS</></>
|
||||
<indexterm><primary>BSD/OS</><secondary>shared library</></>
|
||||
<listitem>
|
||||
<para>
|
||||
The compiler flag to create <acronym>PIC</acronym> is
|
||||
@@ -75,7 +78,7 @@ ld -shared -o foo.so foo.o
|
||||
|
||||
<varlistentry>
|
||||
<term><systemitem class="osname">FreeBSD</></term>
|
||||
<indexterm><primary>FreeBSD</></>
|
||||
<indexterm><primary>FreeBSD</><secondary>shared library</></>
|
||||
<listitem>
|
||||
<para>
|
||||
The compiler flag to create <acronym>PIC</acronym> is
|
||||
@@ -93,7 +96,7 @@ gcc -shared -o foo.so foo.o
|
||||
|
||||
<varlistentry>
|
||||
<term><systemitem class="osname">HP-UX</></term>
|
||||
<indexterm><primary>HP-UX</></>
|
||||
<indexterm><primary>HP-UX</><secondary>shared library</></>
|
||||
<listitem>
|
||||
<para>
|
||||
The compiler flag of the system compiler to create
|
||||
@@ -120,7 +123,7 @@ ld -b -o foo.sl foo.o
|
||||
|
||||
<varlistentry>
|
||||
<term><systemitem class="osname">IRIX</></term>
|
||||
<indexterm><primary>IRIX</></>
|
||||
<indexterm><primary>IRIX</><secondary>shared library</></>
|
||||
<listitem>
|
||||
<para>
|
||||
<acronym>PIC</acronym> is the default, no special compiler
|
||||
@@ -136,7 +139,7 @@ ld -shared -o foo.so foo.o
|
||||
|
||||
<varlistentry>
|
||||
<term><systemitem class="osname">Linux</></term>
|
||||
<indexterm><primary>Linux</></>
|
||||
<indexterm><primary>Linux</><secondary>shared library</></>
|
||||
<listitem>
|
||||
<para>
|
||||
The compiler flag to create <acronym>PIC</acronym> is
|
||||
@@ -155,7 +158,7 @@ cc -shared -o foo.so foo.o
|
||||
|
||||
<varlistentry>
|
||||
<term><systemitem class="osname">MacOS X</></term>
|
||||
<indexterm><primary>MacOS X</></>
|
||||
<indexterm><primary>MacOS X</><secondary>shared library</></>
|
||||
<listitem>
|
||||
<para>
|
||||
Here is an example. It assumes the developer tools are installed.
|
||||
@@ -169,7 +172,7 @@ cc -bundle -flat_namespace -undefined suppress -o foo.so foo.o
|
||||
|
||||
<varlistentry>
|
||||
<term><systemitem class="osname">NetBSD</></term>
|
||||
<indexterm><primary>NetBSD</></>
|
||||
<indexterm><primary>NetBSD</><secondary>shared library</></>
|
||||
<listitem>
|
||||
<para>
|
||||
The compiler flag to create <acronym>PIC</acronym> is
|
||||
@@ -187,7 +190,7 @@ gcc -shared -o foo.so foo.o
|
||||
|
||||
<varlistentry>
|
||||
<term><systemitem class="osname">OpenBSD</></term>
|
||||
<indexterm><primary>OpenBSD</></>
|
||||
<indexterm><primary>OpenBSD</><secondary>shared library</></>
|
||||
<listitem>
|
||||
<para>
|
||||
The compiler flag to create <acronym>PIC</acronym> is
|
||||
@@ -203,7 +206,7 @@ ld -Bshareable -o foo.so foo.o
|
||||
|
||||
<varlistentry>
|
||||
<term><systemitem class="osname">Solaris</></term>
|
||||
<indexterm><primary>Solaris</></>
|
||||
<indexterm><primary>Solaris</><secondary>shared library</></>
|
||||
<listitem>
|
||||
<para>
|
||||
The compiler flag to create <acronym>PIC</acronym> is
|
||||
@@ -227,7 +230,7 @@ gcc -G -o foo.so foo.o
|
||||
|
||||
<varlistentry>
|
||||
<term><systemitem class="osname">Tru64 UNIX</></term>
|
||||
<indexterm><primary>Tru64 UNIX</></>
|
||||
<indexterm><primary>Tru64 UNIX</><secondary>shared library</></>
|
||||
<indexterm><primary>Digital UNIX</><see>Tru64 UNIX</></>
|
||||
<listitem>
|
||||
<para>
|
||||
@@ -246,7 +249,7 @@ ld -shared -expect_unresolved '*' -o foo.so foo.o
|
||||
|
||||
<varlistentry>
|
||||
<term><systemitem class="osname">UnixWare</></term>
|
||||
<indexterm><primary>UnixWare</></>
|
||||
<indexterm><primary>UnixWare</><secondary>shared library</></>
|
||||
<listitem>
|
||||
<para>
|
||||
The compiler flag to create <acronym>PIC</acronym> is <option>-K
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/dml.sgml,v 1.5 2003/08/10 01:20:34 tgl Exp $ -->
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/dml.sgml,v 1.5.2.1 2003/09/07 04:36:41 momjian Exp $ -->
|
||||
|
||||
<chapter id="dml">
|
||||
<title>Data Manipulation</title>
|
||||
@@ -20,6 +20,14 @@
|
||||
<sect1 id="dml-insert">
|
||||
<title>Inserting Data</title>
|
||||
|
||||
<indexterm zone="dml-insert">
|
||||
<primary>inserting</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="dml-insert">
|
||||
<primary>INSERT</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
When a table is created, it contains no data. The first thing to
|
||||
do before a database can be of much use is to insert data. Data is
|
||||
@@ -98,6 +106,14 @@ INSERT INTO products DEFAULT VALUES;
|
||||
<sect1 id="dml-update">
|
||||
<title>Updating Data</title>
|
||||
|
||||
<indexterm zone="dml-update">
|
||||
<primary>updating</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="dml-update">
|
||||
<primary>UPDATE</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
The modification of data that is already in the database is
|
||||
referred to as updating. You can update individual rows, all the
|
||||
@@ -182,6 +198,14 @@ UPDATE mytable SET a = 5, b = 3, c = 1 WHERE a > 0;
|
||||
<sect1 id="dml-delete">
|
||||
<title>Deleting Data</title>
|
||||
|
||||
<indexterm zone="dml-delete">
|
||||
<primary>deleting</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="dml-delete">
|
||||
<primary>DELETE</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
So far we have explained how to add data to tables and how to
|
||||
change data. What remains is to discuss how to remove data that is
|
||||
|
@@ -1,11 +1,13 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ecpg.sgml,v 1.48 2003/08/07 04:17:21 momjian Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ecpg.sgml,v 1.48.2.1 2003/09/07 04:36:41 momjian Exp $
|
||||
-->
|
||||
|
||||
<chapter id="ecpg">
|
||||
<title><application>ECPG</application> - Embedded <acronym>SQL</acronym> in C</title>
|
||||
|
||||
<indexterm zone="ecpg"><primary>embedded SQL</primary><secondary>in C</secondary></indexterm>
|
||||
<indexterm zone="ecpg"><primary>C</primary></indexterm>
|
||||
<indexterm zone="ecpg"><primary>ECPG</primary></indexterm>
|
||||
|
||||
<para>
|
||||
This chapter describes the embedded <acronym>SQL</acronym> package
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/extend.sgml,v 1.23 2003/08/09 22:50:21 tgl Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/extend.sgml,v 1.23.2.1 2003/09/07 04:36:41 momjian Exp $
|
||||
-->
|
||||
|
||||
<chapter id="extend">
|
||||
@@ -80,16 +80,25 @@ $Header: /cvsroot/pgsql/doc/src/sgml/extend.sgml,v 1.23 2003/08/09 22:50:21 tgl
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="type-system">
|
||||
<sect1 id="extend-type-system">
|
||||
<title>The <productname>PostgreSQL</productname> Type System</title>
|
||||
|
||||
<indexterm zone="type-system">
|
||||
<primary>extending SQL</primary>
|
||||
<secondary>types</secondary>
|
||||
<indexterm zone="extend-type-system">
|
||||
<primary>base type</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="type-system">
|
||||
<primary>data types</primary>
|
||||
<indexterm zone="extend-type-system">
|
||||
<primary>data type</primary>
|
||||
<secondary>base</secondary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="extend-type-system">
|
||||
<primary>composite type</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="extend-type-system">
|
||||
<primary>data type</primary>
|
||||
<secondary>composite</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
@@ -138,15 +147,25 @@ $Header: /cvsroot/pgsql/doc/src/sgml/extend.sgml,v 1.23 2003/08/09 22:50:21 tgl
|
||||
pseudo-types.
|
||||
</para>
|
||||
|
||||
<sect2 id="types-polymorphic">
|
||||
<sect2 id="extend-types-polymorphic">
|
||||
<title>Polymorphic Types and Functions</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>polymorphic types</primary>
|
||||
<indexterm zone="extend-types-polymorphic">
|
||||
<primary>polymorphic type</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>polymorphic functions</primary>
|
||||
<indexterm zone="extend-types-polymorphic">
|
||||
<primary>polymorphic function</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="extend-types-polymorphic">
|
||||
<primary>type</primary>
|
||||
<secondary>polymorphic</secondary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="extend-types-polymorphic">
|
||||
<primary>function</primary>
|
||||
<secondary>polymorphic</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/filelist.sgml,v 1.29 2003/05/18 20:55:56 petere Exp $ -->
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/filelist.sgml,v 1.29.2.1 2003/09/07 04:36:41 momjian Exp $ -->
|
||||
|
||||
<!entity history SYSTEM "history.sgml">
|
||||
<!entity info SYSTEM "info.sgml">
|
||||
@@ -68,7 +68,6 @@
|
||||
<!entity libpgeasy SYSTEM "libpgeasy.sgml">
|
||||
<!entity libpq SYSTEM "libpq.sgml">
|
||||
<!entity libpgtcl SYSTEM "libpgtcl.sgml">
|
||||
<!entity pygresql SYSTEM "pygresql.sgml">
|
||||
<!entity lobj SYSTEM "lobj.sgml">
|
||||
<!entity odbc SYSTEM "odbc.sgml">
|
||||
<!entity rules SYSTEM "rules.sgml">
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.166 2003/08/10 01:20:34 tgl Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.166.2.1 2003/09/07 04:36:41 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -7,11 +7,11 @@ PostgreSQL documentation
|
||||
<title>Functions and Operators</title>
|
||||
|
||||
<indexterm zone="functions">
|
||||
<primary>functions</primary>
|
||||
<primary>function</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="functions">
|
||||
<primary>operators</primary>
|
||||
<primary>operator</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
@@ -40,7 +40,7 @@ PostgreSQL documentation
|
||||
<title>Logical Operators</title>
|
||||
|
||||
<indexterm zone="functions-logical">
|
||||
<primary>operators</primary>
|
||||
<primary>operator</primary>
|
||||
<secondary>logical</secondary>
|
||||
</indexterm>
|
||||
|
||||
@@ -54,18 +54,27 @@ PostgreSQL documentation
|
||||
The usual logical operators are available:
|
||||
|
||||
<indexterm>
|
||||
<primary>and</primary>
|
||||
<secondary>operator</secondary>
|
||||
<primary>AND (operator)</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>or</primary>
|
||||
<secondary>operator</secondary>
|
||||
<primary>OR (operator)</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>not</primary>
|
||||
<secondary>operator</secondary>
|
||||
<primary>NOT (operator)</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>conjunction</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>disjunction</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>negation</primary>
|
||||
</indexterm>
|
||||
|
||||
<simplelist>
|
||||
@@ -252,7 +261,7 @@ PostgreSQL documentation
|
||||
<primary>between</primary>
|
||||
</indexterm>
|
||||
In addition to the comparison operators, the special
|
||||
<token>BETWEEN</token> construct is available.
|
||||
<token>BETWEEN</token> construct is available.<indexterm><primary>BETWEEN</primary></indexterm>
|
||||
<synopsis>
|
||||
<replaceable>a</replaceable> BETWEEN <replaceable>x</replaceable> AND <replaceable>y</replaceable>
|
||||
</synopsis>
|
||||
@@ -284,6 +293,7 @@ PostgreSQL documentation
|
||||
<replaceable>expression</replaceable> ISNULL
|
||||
<replaceable>expression</replaceable> NOTNULL
|
||||
</synopsis>
|
||||
<indexterm><primary>null value</primary><secondary>comparing</secondary></indexterm>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -847,7 +857,7 @@ PostgreSQL documentation
|
||||
<entry>
|
||||
String concatenation
|
||||
<indexterm>
|
||||
<primary>character strings</primary>
|
||||
<primary>character string</primary>
|
||||
<secondary>concatenation</secondary>
|
||||
</indexterm>
|
||||
</entry>
|
||||
@@ -869,12 +879,12 @@ PostgreSQL documentation
|
||||
<entry>
|
||||
Number of characters in string
|
||||
<indexterm>
|
||||
<primary>character strings</primary>
|
||||
<primary>character string</primary>
|
||||
<secondary>length</secondary>
|
||||
</indexterm>
|
||||
<indexterm>
|
||||
<primary>length</primary>
|
||||
<secondary>character strings</secondary>
|
||||
<secondary sortas="character string">of a character string</secondary>
|
||||
<see>character strings, length</see>
|
||||
</indexterm>
|
||||
</entry>
|
||||
@@ -1110,12 +1120,12 @@ PostgreSQL documentation
|
||||
<entry>
|
||||
Number of characters in string
|
||||
<indexterm>
|
||||
<primary>character strings</primary>
|
||||
<primary>character string</primary>
|
||||
<secondary>length</secondary>
|
||||
</indexterm>
|
||||
<indexterm>
|
||||
<primary>length</primary>
|
||||
<secondary>character strings</secondary>
|
||||
<secondary sortas="character string">of a character string</secondary>
|
||||
<see>character strings, length</see>
|
||||
</indexterm>
|
||||
</entry>
|
||||
@@ -1174,7 +1184,7 @@ PostgreSQL documentation
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><literal><function>quote_ident</function>(<parameter>string</parameter> text)</literal></entry>
|
||||
<entry><literal><function>quote_ident</function>(<parameter>string</parameter> text)</literal><indexterm><primary>quote_ident</></></entry>
|
||||
<entry><type>text</type></entry>
|
||||
<entry>
|
||||
Return the given string suitably quoted to be used as an identifier
|
||||
@@ -1188,7 +1198,7 @@ PostgreSQL documentation
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><literal><function>quote_literal</function>(<parameter>string</parameter> text)</literal></entry>
|
||||
<entry><literal><function>quote_literal</function>(<parameter>string</parameter> text)</literal><indexterm><primary>quote_literal</></></entry>
|
||||
<entry><type>text</type></entry>
|
||||
<entry>
|
||||
Return the given string suitably quoted to be used as a string literal
|
||||
@@ -2055,6 +2065,11 @@ PostgreSQL documentation
|
||||
<sect1 id="functions-binarystring">
|
||||
<title>Binary String Functions and Operators</title>
|
||||
|
||||
<indexterm zone="functions-binarystring">
|
||||
<primary>binary data</primary>
|
||||
<secondary>functions</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
This section describes functions and operators for examining and
|
||||
manipulating values of type <type>bytea</type>.
|
||||
@@ -2092,7 +2107,7 @@ PostgreSQL documentation
|
||||
<entry>
|
||||
String concatenation
|
||||
<indexterm>
|
||||
<primary>binary strings</primary>
|
||||
<primary>binary string</primary>
|
||||
<secondary>concatenation</secondary>
|
||||
</indexterm>
|
||||
</entry>
|
||||
@@ -2243,12 +2258,12 @@ PostgreSQL documentation
|
||||
<entry>
|
||||
Length of binary string
|
||||
<indexterm>
|
||||
<primary>binary strings</primary>
|
||||
<primary>binary string</primary>
|
||||
<secondary>length</secondary>
|
||||
</indexterm>
|
||||
<indexterm>
|
||||
<primary>length</primary>
|
||||
<secondary>binary strings</secondary>
|
||||
<secondary sortas="binary string">of a binary string</secondary>
|
||||
<see>binary strings, length</see>
|
||||
</indexterm>
|
||||
</entry>
|
||||
@@ -2321,8 +2336,8 @@ PostgreSQL documentation
|
||||
<sect2 id="functions-like">
|
||||
<title><function>LIKE</function></title>
|
||||
|
||||
<indexterm>
|
||||
<primary>like</primary>
|
||||
<indexterm zone="functions-like">
|
||||
<primary>LIKE</primary>
|
||||
</indexterm>
|
||||
|
||||
<synopsis>
|
||||
@@ -2420,12 +2435,12 @@ PostgreSQL documentation
|
||||
Regular Expressions</title>
|
||||
|
||||
<indexterm zone="functions-sql99-regexp">
|
||||
<primary>regular expressions</primary>
|
||||
<primary>regular expression</primary>
|
||||
<!-- <seealso>pattern matching</seealso> breaks index build -->
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>similar to</primary>
|
||||
<primary>SIMILAR TO</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
@@ -2547,7 +2562,7 @@ substring('foobar' from '#"o_b#"%' for '#') <lineannotation>NULL</lineannotat
|
||||
<title><acronym>POSIX</acronym> Regular Expressions</title>
|
||||
|
||||
<indexterm zone="functions-posix-regexp">
|
||||
<primary>regular expressions</primary>
|
||||
<primary>regular expression</primary>
|
||||
<seealso>pattern matching</seealso>
|
||||
</indexterm>
|
||||
|
||||
@@ -3794,6 +3809,10 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
|
||||
<primary>formatting</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="functions-formatting">
|
||||
<primary>to_char</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
The <productname>PostgreSQL</productname> formatting functions
|
||||
provide a powerful set of tools for converting various data types
|
||||
@@ -3870,6 +3889,11 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
|
||||
</tgroup>
|
||||
</table>
|
||||
|
||||
<para>
|
||||
Warning. <literal><function>to_char</function>(<type>interval</type>, <type>text</type>)</literal>
|
||||
is deprecated and should not be used in newly-written code. Will be removed in the next version.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
In an output template string (for <function>to_char</>), there are certain patterns that are
|
||||
recognized and replaced with appropriately-formatted data from the value
|
||||
@@ -5999,7 +6023,7 @@ SELECT TIMESTAMP 'now';
|
||||
<title>Sequence-Manipulation Functions</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>sequences</primary>
|
||||
<primary>sequence</primary>
|
||||
</indexterm>
|
||||
<indexterm>
|
||||
<primary>nextval</primary>
|
||||
@@ -6162,11 +6186,11 @@ SELECT setval('foo', 42, false); <lineannotation>Next <function>nextval</> wi
|
||||
<title>Conditional Expressions</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>case</primary>
|
||||
<primary>CASE</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>conditionals</primary>
|
||||
<primary>conditional expression</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
@@ -6287,8 +6311,12 @@ SELECT a,
|
||||
<sect2>
|
||||
<title><literal>COALESCE</></title>
|
||||
|
||||
<indexterm>
|
||||
<primary>COALESCE</primary>
|
||||
</indexterm>
|
||||
|
||||
<synopsis>
|
||||
<function>COALESCE</function>(<replaceable>value</replaceable> <optional>, ...</optional>)
|
||||
<function>coalesce</function>(<replaceable>value</replaceable> <optional>, ...</optional>)
|
||||
</synopsis>
|
||||
|
||||
<para>
|
||||
@@ -6497,7 +6525,8 @@ SET search_path TO <replaceable>schema</> <optional>, <replaceable>schema</>, ..
|
||||
|
||||
<indexterm zone="functions-misc">
|
||||
<primary>configuration</primary>
|
||||
<secondary>server</secondary>
|
||||
<secondary sortas="server">of the server</secondary>
|
||||
<tertiary>functions</tertiary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
@@ -6534,6 +6563,11 @@ SELECT set_config('show_statement_stats', 'off', false);
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<indexterm>
|
||||
<primary>privilege</primary>
|
||||
<secondary>querying</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
<xref linkend="functions-misc-access-table"> lists functions that
|
||||
allow the user to query object access privileges programmatically.
|
||||
@@ -6966,6 +7000,11 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
|
||||
<primary>col_description</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="functions-misc">
|
||||
<primary>comment</primary>
|
||||
<secondary sortas="database objects">about database objects</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
The function shown in <xref
|
||||
linkend="functions-misc-comment-table"> extract comments
|
||||
@@ -7027,7 +7066,7 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
|
||||
|
||||
<para>
|
||||
<xref linkend="array-operators-table"> shows the operators
|
||||
available for the <type>array</type> types.
|
||||
available for <type>array</type> types.
|
||||
</para>
|
||||
|
||||
<table id="array-operators-table">
|
||||
@@ -7088,7 +7127,7 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
|
||||
<entry> <literal>||</literal> </entry>
|
||||
<entry>array-to-array concatenation</entry>
|
||||
<entry><literal>ARRAY[1,2,3] || ARRAY[4,5,6]</literal></entry>
|
||||
<entry><literal>{{1,2,3},{4,5,6}}</literal></entry>
|
||||
<entry><literal>{1,2,3,4,5,6}</literal></entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
@@ -7115,6 +7154,11 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
|
||||
</tgroup>
|
||||
</table>
|
||||
|
||||
<para>
|
||||
See <xref linkend="arrays"> for more details about array operator
|
||||
behavior.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<xref linkend="array-functions-table"> shows the functions
|
||||
available for use with array types. See <xref linkend="arrays">
|
||||
@@ -7162,7 +7206,7 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
|
||||
for <literal>NULL</literal> inputs
|
||||
</entry>
|
||||
<entry><literal>array_cat(ARRAY[1,2,3], ARRAY[4,5,6])</literal></entry>
|
||||
<entry><literal>{{1,2,3},{4,5,6}}</literal></entry>
|
||||
<entry><literal>{1,2,3,4,5,6}</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>
|
||||
@@ -7262,6 +7306,11 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
|
||||
<sect1 id="functions-aggregate">
|
||||
<title>Aggregate Functions</title>
|
||||
|
||||
<indexterm zone="functions-aggregate">
|
||||
<primary>aggregate function</primary>
|
||||
<secondary>built-in</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
<firstterm>Aggregate functions</firstterm> compute a single result
|
||||
value from a set of input values. <xref
|
||||
@@ -7290,7 +7339,6 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
|
||||
<entry>
|
||||
<indexterm>
|
||||
<primary>average</primary>
|
||||
<secondary>function</secondary>
|
||||
</indexterm>
|
||||
<function>avg(<replaceable class="parameter">expression</replaceable>)</function>
|
||||
</entry>
|
||||
@@ -7472,31 +7520,31 @@ SELECT col FROM sometable ORDER BY col ASC LIMIT 1;
|
||||
<title>Subquery Expressions</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>exists</primary>
|
||||
<primary>EXISTS</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>in</primary>
|
||||
<primary>IN</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>not in</primary>
|
||||
<primary>NOT IN</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>any</primary>
|
||||
<primary>ANY</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>all</primary>
|
||||
<primary>ALL</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>some</primary>
|
||||
<primary>SOME</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>subqueries</primary>
|
||||
<primary>subquery</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
@@ -7798,6 +7846,11 @@ SELECT col1 FROM tab1
|
||||
<sect2>
|
||||
<title>Row-wise Comparison</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>comparison</primary>
|
||||
<secondary>of rows</secondary>
|
||||
</indexterm>
|
||||
|
||||
<synopsis>
|
||||
(<replaceable>expression</replaceable> <optional>, <replaceable>expression</replaceable> ...</optional>) <replaceable>operator</replaceable> (<replaceable>subquery</replaceable>)
|
||||
</synopsis>
|
||||
|
@@ -1,10 +1,10 @@
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/indices.sgml,v 1.42 2003/05/28 16:03:55 tgl Exp $ -->
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/indices.sgml,v 1.42.2.1 2003/09/07 04:36:41 momjian Exp $ -->
|
||||
|
||||
<chapter id="indexes">
|
||||
<title id="indexes-title">Indexes</title>
|
||||
|
||||
<indexterm zone="indexes">
|
||||
<primary>indexes</primary>
|
||||
<primary>index</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
@@ -109,12 +109,12 @@ CREATE INDEX test1_id_index ON test1 (id);
|
||||
B-tree, R-tree, GiST, and Hash. Each index type is more appropriate for
|
||||
a particular query type because of the algorithm it uses.
|
||||
<indexterm>
|
||||
<primary>indexes</primary>
|
||||
<primary>index</primary>
|
||||
<secondary>B-tree</secondary>
|
||||
</indexterm>
|
||||
<indexterm>
|
||||
<primary>B-tree</primary>
|
||||
<see>indexes</see>
|
||||
<see>index</see>
|
||||
</indexterm>
|
||||
By
|
||||
default, the <command>CREATE INDEX</command> command will create a
|
||||
@@ -147,12 +147,12 @@ CREATE INDEX test1_id_index ON test1 (id);
|
||||
|
||||
<para>
|
||||
<indexterm>
|
||||
<primary>indexes</primary>
|
||||
<primary>index</primary>
|
||||
<secondary>R-tree</secondary>
|
||||
</indexterm>
|
||||
<indexterm>
|
||||
<primary>R-tree</primary>
|
||||
<see>indexes</see>
|
||||
<see>index</see>
|
||||
</indexterm>
|
||||
R-tree indexes are especially suited for spatial data. To create
|
||||
an R-tree index, use a command of the form
|
||||
@@ -178,12 +178,12 @@ CREATE INDEX <replaceable>name</replaceable> ON <replaceable>table</replaceable>
|
||||
|
||||
<para>
|
||||
<indexterm>
|
||||
<primary>indexes</primary>
|
||||
<primary>index</primary>
|
||||
<secondary>hash</secondary>
|
||||
</indexterm>
|
||||
<indexterm>
|
||||
<primary>hash</primary>
|
||||
<see>indexes</see>
|
||||
<see>index</see>
|
||||
</indexterm>
|
||||
The query planner will consider using a hash index whenever an
|
||||
indexed column is involved in a comparison using the
|
||||
@@ -219,7 +219,7 @@ CREATE INDEX <replaceable>name</replaceable> ON <replaceable>table</replaceable>
|
||||
<title>Multicolumn Indexes</title>
|
||||
|
||||
<indexterm zone="indexes-multicolumn">
|
||||
<primary>indexes</primary>
|
||||
<primary>index</primary>
|
||||
<secondary>multicolumn</secondary>
|
||||
</indexterm>
|
||||
|
||||
@@ -294,7 +294,7 @@ SELECT name FROM test2 WHERE major = <replaceable>constant</replaceable> OR mino
|
||||
<title>Unique Indexes</title>
|
||||
|
||||
<indexterm zone="indexes-unique">
|
||||
<primary>indexes</primary>
|
||||
<primary>index</primary>
|
||||
<secondary>unique</secondary>
|
||||
</indexterm>
|
||||
|
||||
@@ -337,8 +337,8 @@ CREATE UNIQUE INDEX <replaceable>name</replaceable> ON <replaceable>table</repla
|
||||
<title>Indexes on Expressions</title>
|
||||
|
||||
<indexterm zone="indexes-expressional">
|
||||
<primary>indexes</primary>
|
||||
<secondary>on expressions</secondary>
|
||||
<primary>index</primary>
|
||||
<secondary sortas="expressions">on expressions</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
@@ -392,6 +392,10 @@ CREATE INDEX people_names ON people ((first_name || ' ' || last_name));
|
||||
<sect1 id="indexes-opclass">
|
||||
<title>Operator Classes</title>
|
||||
|
||||
<indexterm zone="indexes-opclass">
|
||||
<primary>operator class</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
An index definition may specify an <firstterm>operator
|
||||
class</firstterm> for each column of an index.
|
||||
@@ -492,7 +496,7 @@ SELECT am.amname AS index_method,
|
||||
<title>Partial Indexes</title>
|
||||
|
||||
<indexterm zone="indexes-partial">
|
||||
<primary>indexes</primary>
|
||||
<primary>index</primary>
|
||||
<secondary>partial</secondary>
|
||||
</indexterm>
|
||||
|
||||
@@ -709,6 +713,11 @@ CREATE UNIQUE INDEX tests_success_constraint ON tests (subject, target)
|
||||
<sect1 id="indexes-examine">
|
||||
<title>Examining Index Usage</title>
|
||||
|
||||
<indexterm zone="indexes-examine">
|
||||
<primary>index</primary>
|
||||
<secondary>examining usage</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
Although indexes in <productname>PostgreSQL</> do not need
|
||||
maintenance and tuning, it is still important to check
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/installation.sgml,v 1.138 2003/08/04 04:03:03 tgl Exp $ -->
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/installation.sgml,v 1.138.2.1 2003/09/07 04:36:41 momjian Exp $ -->
|
||||
|
||||
<chapter id="installation">
|
||||
<title><![%standalone-include[<productname>PostgreSQL</>]]>
|
||||
@@ -169,10 +169,9 @@ su - postgres
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
To build the Python interface module or the PL/Python server
|
||||
programming language, you need a Python installation, including
|
||||
the header files.
|
||||
Since PL/Python will be a shared library, the
|
||||
To build the PL/Python server programming language, you need a
|
||||
Python installation, including the header files. Since
|
||||
PL/Python will be a shared library, the
|
||||
<indexterm><primary>libpython</primary></indexterm>
|
||||
<filename>libpython</filename> library must be a shared library
|
||||
also on most platforms. This is not the case in a default
|
||||
@@ -383,6 +382,7 @@ JAVACMD=$JAVA_HOME/bin/java
|
||||
<para>
|
||||
<indexterm>
|
||||
<primary>pg_dumpall</primary>
|
||||
<secondary>use during upgrade</secondary>
|
||||
</indexterm>
|
||||
|
||||
To back up your database installation, type:
|
||||
@@ -750,10 +750,7 @@ JAVACMD=$JAVA_HOME/bin/java
|
||||
<term><option>--with-python</option></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Build the Python interface module and the PL/Python
|
||||
server-side language. You need to have root access to be able
|
||||
to install the Python module at its default place
|
||||
(<filename>/usr/lib/python<replaceable>x</>.<replaceable>y</></>).
|
||||
Build the PL/Python server-side language.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -875,8 +872,8 @@ JAVACMD=$JAVA_HOME/bin/java
|
||||
<term><option>--with-pam</option></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Build with <acronym>PAM</> (Pluggable Authentication Modules)
|
||||
support.
|
||||
Build with <acronym>PAM</><indexterm><primary>PAM</></>
|
||||
(Pluggable Authentication Modules) support.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -1078,20 +1075,6 @@ All of PostgreSQL is successfully made. Ready to install.
|
||||
possibly can, you will have to do manual work.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If you built the Python interfaces and you were not the
|
||||
root user when you executed the above command then that part of
|
||||
the installation probably failed. In that case you should become
|
||||
the root user and then do
|
||||
<screen>
|
||||
<userinput>gmake -C src/interfaces/python install</userinput>
|
||||
</screen>
|
||||
If you do not have root access you are on your own:
|
||||
you can still take the required files and place them in
|
||||
other directories where Python can find them, but how to
|
||||
do that is left as an exercise.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The standard installation provides only the header files needed for client
|
||||
application development. If you plan to do any server-side program
|
||||
@@ -1163,7 +1146,7 @@ All of PostgreSQL is successfully made. Ready to install.
|
||||
<title>Shared Libraries</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>shared libraries</primary>
|
||||
<primary>shared library</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
@@ -1284,7 +1267,6 @@ set path = ( /usr/local/pgsql/bin $path )
|
||||
<para>
|
||||
<indexterm>
|
||||
<primary><envar>MANPATH</envar></primary>
|
||||
<seealso>man pages</seealso>
|
||||
</indexterm>
|
||||
To enable your system to find the <application>man</>
|
||||
documentation, you need to add lines like the following to a
|
||||
|
@@ -1,10 +1,18 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/jdbc.sgml,v 1.47 2003/08/07 05:06:40 barry Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/jdbc.sgml,v 1.47.2.1 2003/09/07 04:36:42 momjian Exp $
|
||||
-->
|
||||
|
||||
<chapter id="jdbc">
|
||||
<title><acronym>JDBC</acronym> Interface</title>
|
||||
|
||||
<indexterm zone="jdbc">
|
||||
<primary>JDBC</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="jdbc">
|
||||
<primary>Java</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
<acronym>JDBC</acronym> is a core <acronym>API</acronym> of Java 1.1 and later.
|
||||
It provides a standard set of
|
||||
@@ -66,6 +74,14 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/jdbc.sgml,v 1.47 2003/08/07 05:06:40
|
||||
<sect2 id="jdbc-classpath">
|
||||
<title>Setting up the Class Path</title>
|
||||
|
||||
<indexterm zone="jdbc-classpath">
|
||||
<primary>class path</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="jdbc-classpath">
|
||||
<primary>CLASSPATH</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
To use the driver, the JAR archive (named
|
||||
<filename>postgresql.jar</filename> if you built from source, otherwise
|
||||
@@ -316,6 +332,18 @@ db.close();
|
||||
<sect1 id="jdbc-query">
|
||||
<title>Issuing a Query and Processing the Result</title>
|
||||
|
||||
<indexterm zone="jdbc-query">
|
||||
<primary>Statement</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="jdbc-query">
|
||||
<primary>PreparedStatement</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="jdbc-query">
|
||||
<primary>ResultSet</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
Any time you want to issue <acronym>SQL</acronym> statements to
|
||||
the database, you require a <classname>Statement</classname> or
|
||||
@@ -681,6 +709,16 @@ st.close();
|
||||
<sect1 id="jdbc-binary-data">
|
||||
<title>Storing Binary Data</title>
|
||||
|
||||
<indexterm zone="jdbc-binary-data">
|
||||
<primary>bytea</primary>
|
||||
<secondary sortas="JDBC">in JDBC</secondary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="jdbc-binary-data">
|
||||
<primary>large object</primary>
|
||||
<secondary sortas="JDBC">in JDBC</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
<application>PostgreSQL</application> provides two distinct ways to
|
||||
store binary data. Binary data can be stored in a table using
|
||||
@@ -2597,6 +2635,11 @@ public void unlink(int oid) throws SQLException
|
||||
<sect1 id="jdbc-thread">
|
||||
<title>Using the Driver in a Multithreaded or a Servlet Environment</title>
|
||||
|
||||
<indexterm zone="jdbc-thread">
|
||||
<primary>threads</primary>
|
||||
<secondary sortas="JDBC">with JDBC</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
A problem with many <acronym>JDBC</acronym> drivers is that only
|
||||
one thread can use a <classname>Connection</classname> at any one
|
||||
@@ -2645,6 +2688,15 @@ public void unlink(int oid) throws SQLException
|
||||
<sect1 id="jdbc-datasource">
|
||||
<title>Connection Pools and Data Sources</title>
|
||||
|
||||
<indexterm zone="jdbc-datasource">
|
||||
<primary>connection pool</primary>
|
||||
<secondary sortas="JDBC">in JDBC</secondary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="jdbc-datasource">
|
||||
<primary>DataSource</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
<acronym>JDBC</> 2 introduced standard connection pooling features in an
|
||||
add-on <acronym>API</> known as the <acronym>JDBC</acronym> 2.0 Optional
|
||||
@@ -3029,7 +3081,11 @@ try {
|
||||
</sect2>
|
||||
|
||||
<sect2 id="jdbc-jndi">
|
||||
<title>Data Sources and <acronym>JNDI</acronym></title>
|
||||
<title>Data Sources and <acronym>JNDI</acronym></title>
|
||||
|
||||
<indexterm zone="jdbc-jndi">
|
||||
<primary>JNDI</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
All the <literal>ConnectionPoolDataSource</literal> and
|
||||
|
@@ -1,10 +1,10 @@
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/keywords.sgml,v 2.9 2003/06/12 07:49:43 momjian Exp $ -->
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/keywords.sgml,v 2.9.2.1 2003/09/07 04:36:42 momjian Exp $ -->
|
||||
|
||||
<appendix id="sql-keywords-appendix">
|
||||
<title><acronym>SQL</acronym> Key Words</title>
|
||||
|
||||
<indexterm zone="sql-keywords-appendix">
|
||||
<primary>key words</primary>
|
||||
<primary>key word</primary>
|
||||
<secondary>list of</secondary>
|
||||
</indexterm>
|
||||
|
||||
|
@@ -125,8 +125,8 @@
|
||||
<para>
|
||||
The <function>pg_lo_*</function> commands are interfaces to the
|
||||
large object features of
|
||||
<ProductName>PostgreSQL</ProductName>.<indexterm><primary>Large
|
||||
Object</></> The functions are designed to mimic the analogous file
|
||||
<ProductName>PostgreSQL</ProductName>.<indexterm><primary>large
|
||||
object</><secondary>in pgctl</></> The functions are designed to mimic the analogous file
|
||||
system functions in the standard Unix file system interface. The
|
||||
<function>pg_lo_*</function> commands should be used within a
|
||||
<command>BEGIN</command>/<command>COMMIT</command> transaction
|
||||
@@ -1043,12 +1043,12 @@ pg_listen <parameter>conn</parameter> <parameter>notifyName</parameter> <optiona
|
||||
message bearing the given name arrives from the server. This
|
||||
occurs when any <productname>PostgreSQL</productname> client
|
||||
application issues a
|
||||
<command>NOTIFY</command><indexterm><primary>NOTIFY</><secondary>in
|
||||
pgtcl</></> command referencing that name. The command string is
|
||||
executed from the Tcl idle loop. That is the normal idle state of
|
||||
an application written with Tk. In non-Tk Tcl shells, you can
|
||||
execute <function>update</function> or <function>vwait</function>
|
||||
to cause the idle loop to be entered.
|
||||
<command>NOTIFY</command><indexterm><primary>NOTIFY</><secondary
|
||||
sortas="pgtcl">in pgtcl</></> command referencing that name. The
|
||||
command string is executed from the Tcl idle loop. That is the
|
||||
normal idle state of an application written with Tk. In non-Tk Tcl
|
||||
shells, you can execute <function>update</function> or
|
||||
<function>vwait</function> to cause the idle loop to be entered.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/lobj.sgml,v 1.29 2003/06/21 21:51:33 tgl Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/lobj.sgml,v 1.29.2.1 2003/09/07 04:36:42 momjian Exp $
|
||||
-->
|
||||
|
||||
<chapter id="largeObjects">
|
||||
@@ -113,6 +113,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/lobj.sgml,v 1.29 2003/06/21 21:51:33 tgl Ex
|
||||
<synopsis>
|
||||
Oid lo_creat(PGconn *conn, int mode);
|
||||
</synopsis>
|
||||
<indexterm><primary>lo_creat</></>
|
||||
creates a new large object.
|
||||
<replaceable class="parameter">mode</replaceable> is a bit mask
|
||||
describing several different attributes of the new
|
||||
@@ -143,7 +144,8 @@ inv_oid = lo_creat(INV_READ|INV_WRITE);
|
||||
<synopsis>
|
||||
Oid lo_import(PGconn *conn, const char *filename);
|
||||
</synopsis>
|
||||
<replaceable class="parameter">filename</replaceable>
|
||||
<indexterm><primary>lo_import</></>
|
||||
<replaceable class="parameter">filename</replaceable>
|
||||
specifies the operating system name of
|
||||
the file to be imported as a large object.
|
||||
The return value is the OID that was assigned to the new large object.
|
||||
@@ -159,6 +161,7 @@ Oid lo_import(PGconn *conn, const char *filename);
|
||||
<synopsis>
|
||||
int lo_export(PGconn *conn, Oid lobjId, const char *filename);
|
||||
</synopsis>
|
||||
<indexterm><primary>lo_export</></>
|
||||
The <parameter>lobjId</parameter> argument specifies the OID of the large
|
||||
object to export and the <parameter>filename</parameter> argument specifies
|
||||
the operating system name name of the file.
|
||||
@@ -173,6 +176,7 @@ int lo_export(PGconn *conn, Oid lobjId, const char *filename);
|
||||
<synopsis>
|
||||
int lo_open(PGconn *conn, Oid lobjId, int mode);
|
||||
</synopsis>
|
||||
<indexterm><primary>lo_open</></>
|
||||
The <parameter>lobjId</parameter> argument specifies the OID of the large
|
||||
object to open. The <parameter>mode</parameter> bits control whether the
|
||||
object is opened for reading (<symbol>INV_READ</>), writing (<symbol>INV_WRITE</symbol>), or
|
||||
@@ -194,10 +198,13 @@ int lo_open(PGconn *conn, Oid lobjId, int mode);
|
||||
<synopsis>
|
||||
int lo_write(PGconn *conn, int fd, const char *buf, size_t len);
|
||||
</synopsis>
|
||||
writes <parameter>len</parameter> bytes from <parameter>buf</parameter> to large object <parameter>fd</>. The <parameter>fd</parameter>
|
||||
argument must have been returned by a previous <function>lo_open</function>.
|
||||
The number of bytes actually written is returned. In
|
||||
the event of an error, the return value is negative.
|
||||
<indexterm><primary>lo_write</></> writes
|
||||
<parameter>len</parameter> bytes from <parameter>buf</parameter>
|
||||
to large object <parameter>fd</>. The <parameter>fd</parameter>
|
||||
argument must have been returned by a previous
|
||||
<function>lo_open</function>. The number of bytes actually
|
||||
written is returned. In the event of an error, the return value
|
||||
is negative.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
@@ -209,10 +216,13 @@ int lo_write(PGconn *conn, int fd, const char *buf, size_t len);
|
||||
<synopsis>
|
||||
int lo_read(PGconn *conn, int fd, char *buf, size_t len);
|
||||
</synopsis>
|
||||
reads <parameter>len</parameter> bytes from large object <parameter>fd</parameter> into <parameter>buf</parameter>. The <parameter>fd</parameter>
|
||||
argument must have been returned by a previous <function>lo_open</function>.
|
||||
The number of bytes actually read is returned. In
|
||||
the event of an error, the return value is negative.
|
||||
<indexterm><primary>lo_read</></> reads
|
||||
<parameter>len</parameter> bytes from large object
|
||||
<parameter>fd</parameter> into <parameter>buf</parameter>. The
|
||||
<parameter>fd</parameter> argument must have been returned by a
|
||||
previous <function>lo_open</function>. The number of bytes
|
||||
actually read is returned. In the event of an error, the return
|
||||
value is negative.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
@@ -225,10 +235,14 @@ int lo_read(PGconn *conn, int fd, char *buf, size_t len);
|
||||
<synopsis>
|
||||
int lo_lseek(PGconn *conn, int fd, int offset, int whence);
|
||||
</synopsis>
|
||||
This function moves the current location pointer for the
|
||||
large object described by <parameter>fd</> to the new location specified
|
||||
by <parameter>offset</>. The valid values for <parameter>whence</> are
|
||||
<symbol>SEEK_SET</> (seek from object start), <symbol>SEEK_CUR</> (seek from current position), and <symbol>SEEK_END</> (seek from object end). The return value is the new location pointer.
|
||||
<indexterm><primary>lo_lseek</></> This function moves the
|
||||
current location pointer for the large object described by
|
||||
<parameter>fd</> to the new location specified by
|
||||
<parameter>offset</>. The valid values for <parameter>whence</>
|
||||
are <symbol>SEEK_SET</> (seek from object start),
|
||||
<symbol>SEEK_CUR</> (seek from current position), and
|
||||
<symbol>SEEK_END</> (seek from object end). The return value is
|
||||
the new location pointer.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
@@ -241,7 +255,8 @@ int lo_lseek(PGconn *conn, int fd, int offset, int whence);
|
||||
<synopsis>
|
||||
int lo_tell(PGconn *conn, int fd);
|
||||
</synopsis>
|
||||
If there is an error, the return value is negative.
|
||||
<indexterm><primary>lo_tell</></> If there is an error, the
|
||||
return value is negative.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
@@ -253,9 +268,10 @@ int lo_tell(PGconn *conn, int fd);
|
||||
<synopsis>
|
||||
int lo_close(PGconn *conn, int fd);
|
||||
</synopsis>
|
||||
where <parameter>fd</> is a large object descriptor returned by
|
||||
<function>lo_open</function>. On success, <function>lo_close</function>
|
||||
returns zero. On error, the return value is negative.
|
||||
<indexterm><primary>lo_close</></> where <parameter>fd</> is a
|
||||
large object descriptor returned by <function>lo_open</function>.
|
||||
On success, <function>lo_close</function> returns zero. On
|
||||
error, the return value is negative.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -272,8 +288,10 @@ int lo_close(PGconn *conn, int fd);
|
||||
<synopsis>
|
||||
int lo_unlink(PGconn *conn, Oid lobjId);
|
||||
</synopsis>
|
||||
The <parameter>lobjId</parameter> argument specifies the OID of the large
|
||||
object to remove. In the event of an error, the return value is negative.
|
||||
<indexterm><primary>lo_unlink</></> The
|
||||
<parameter>lobjId</parameter> argument specifies the OID of the
|
||||
large object to remove. In the event of an error, the return
|
||||
value is negative.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
@@ -284,11 +302,13 @@ int lo_unlink(PGconn *conn, Oid lobjId);
|
||||
<title>Server-side Functions</title>
|
||||
|
||||
<para>
|
||||
There are two built-in server-side functions, <function>lo_import</function>
|
||||
and <function>lo_export</function>, for large object access, which are available for use
|
||||
in <acronym>SQL</acronym>
|
||||
commands.
|
||||
Here is an example of their use:
|
||||
There are two built-in server-side functions,
|
||||
<function>lo_import</function><indexterm><primary>lo_import</></>
|
||||
and
|
||||
<function>lo_export</function>,<indexterm><primary>lo_export</></>
|
||||
for large object access, which are available for use in
|
||||
<acronym>SQL</acronym> commands. Here is an example of their
|
||||
use:
|
||||
<programlisting>
|
||||
CREATE TABLE image (
|
||||
name text,
|
||||
|
@@ -1,10 +1,14 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/maintenance.sgml,v 1.23 2003/06/18 12:19:11 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/maintenance.sgml,v 1.23.2.1 2003/09/07 04:36:42 momjian Exp $
|
||||
-->
|
||||
|
||||
<chapter id="maintenance">
|
||||
<title>Routine Database Maintenance Tasks</title>
|
||||
|
||||
<indexterm zone="maintenance">
|
||||
<primary>maintenance</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
There are a few routine maintenance chores that must be performed on
|
||||
a regular basis to keep a <productname>PostgreSQL</productname>
|
||||
@@ -158,6 +162,15 @@ $Header: /cvsroot/pgsql/doc/src/sgml/maintenance.sgml,v 1.23 2003/06/18 12:19:11
|
||||
<sect2 id="vacuum-for-statistics">
|
||||
<title>Updating planner statistics</title>
|
||||
|
||||
<indexterm zone="vacuum-for-statistics">
|
||||
<primary>statistics</primary>
|
||||
<secondary>of the planner</secondary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="vacuum-for-statistics">
|
||||
<primary>ANALYZE</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
The <productname>PostgreSQL</productname> query planner relies on
|
||||
statistical information about the contents of tables in order to
|
||||
@@ -396,7 +409,8 @@ VACUUM
|
||||
<title>Log File Maintenance</title>
|
||||
|
||||
<indexterm zone="logfile-maintenance">
|
||||
<primary>log files</primary>
|
||||
<primary>server log</primary>
|
||||
<secondary>log file maintenance</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/manage-ag.sgml,v 2.27 2003/03/25 16:15:37 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/manage-ag.sgml,v 2.27.2.1 2003/09/07 04:36:42 momjian Exp $
|
||||
-->
|
||||
|
||||
<chapter id="managing-databases">
|
||||
@@ -19,6 +19,10 @@ $Header: /cvsroot/pgsql/doc/src/sgml/manage-ag.sgml,v 2.27 2003/03/25 16:15:37 p
|
||||
<sect1 id="manage-ag-overview">
|
||||
<title>Overview</title>
|
||||
|
||||
<indexterm zone="manage-ag-overview">
|
||||
<primary>schema</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
A database is a named collection of <acronym>SQL</acronym> objects
|
||||
(<quote>database objects</quote>). Generally, every database
|
||||
@@ -70,8 +74,8 @@ $Header: /cvsroot/pgsql/doc/src/sgml/manage-ag.sgml,v 2.27 2003/03/25 16:15:37 p
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Databases are created with the SQL command
|
||||
<command>CREATE DATABASE</command>:
|
||||
Databases are created with the SQL command <command>CREATE
|
||||
DATABASE</command>:<indexterm><primary>CREATE DATABASE</></>
|
||||
<synopsis>
|
||||
CREATE DATABASE <replaceable>name</>;
|
||||
</synopsis>
|
||||
@@ -93,9 +97,10 @@ CREATE DATABASE <replaceable>name</>;
|
||||
question remains how the <emphasis>first</> database at any given
|
||||
site can be created. The first database is always created by the
|
||||
<command>initdb</> command when the data storage area is
|
||||
initialized. (See <xref linkend="creating-cluster">.)
|
||||
This database is called <literal>template1</>. So to create the
|
||||
first <quote>real</> database you can connect to
|
||||
initialized. (See <xref linkend="creating-cluster">.) This
|
||||
database is called
|
||||
<literal>template1</>.<indexterm><primary>template1</></> So to
|
||||
create the first <quote>real</> database you can connect to
|
||||
<literal>template1</>.
|
||||
</para>
|
||||
|
||||
@@ -112,7 +117,7 @@ CREATE DATABASE <replaceable>name</>;
|
||||
<para>
|
||||
As an extra convenience, there is also a program that you can
|
||||
execute from the shell to create new databases,
|
||||
<command>createdb</>.
|
||||
<command>createdb</>.<indexterm><primary>createdb</></>
|
||||
|
||||
<synopsis>
|
||||
createdb <replaceable class="parameter">dbname</replaceable>
|
||||
@@ -157,31 +162,33 @@ createdb -O <replaceable>username</> <replaceable>dbname</>
|
||||
<para>
|
||||
<command>CREATE DATABASE</> actually works by copying an existing
|
||||
database. By default, it copies the standard system database named
|
||||
<literal>template1</>. Thus that database is the <quote>template</>
|
||||
from which new databases are made. If you add objects to
|
||||
<literal>template1</>, these objects
|
||||
<literal>template1</>.<indexterm><primary>template1</></> Thus that
|
||||
database is the <quote>template</> from which new databases are
|
||||
made. If you add objects to <literal>template1</>, these objects
|
||||
will be copied into subsequently created user databases. This
|
||||
behavior allows site-local modifications to the standard set of
|
||||
objects in databases. For example, if you install the procedural
|
||||
language <application>PL/pgSQL</> in <literal>template1</>, it will
|
||||
automatically be available in user databases without any extra action
|
||||
being taken when those databases are made.
|
||||
automatically be available in user databases without any extra
|
||||
action being taken when those databases are made.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
There is a second standard system database named <literal>template0</>.
|
||||
This database contains the same data as the initial contents of
|
||||
<literal>template1</>, that is, only the standard objects predefined by
|
||||
your version of <productname>PostgreSQL</productname>.
|
||||
<literal>template0</> should never be changed
|
||||
after <command>initdb</>. By instructing <command>CREATE DATABASE</> to
|
||||
copy <literal>template0</> instead of <literal>template1</>, you can
|
||||
create a <quote>virgin</> user database that contains none of the
|
||||
site-local additions in <literal>template1</>. This is particularly
|
||||
handy when restoring a <literal>pg_dump</> dump: the dump script should
|
||||
be restored in a virgin database to ensure that one recreates the
|
||||
correct contents of the dumped database, without any conflicts with
|
||||
additions that may now be present in <literal>template1</>.
|
||||
There is a second standard system database named
|
||||
<literal>template0</>.<indexterm><primary>template0</></> This
|
||||
database contains the same data as the initial contents of
|
||||
<literal>template1</>, that is, only the standard objects
|
||||
predefined by your version of
|
||||
<productname>PostgreSQL</productname>. <literal>template0</>
|
||||
should never be changed after <command>initdb</>. By instructing
|
||||
<command>CREATE DATABASE</> to copy <literal>template0</> instead
|
||||
of <literal>template1</>, you can create a <quote>virgin</> user
|
||||
database that contains none of the site-local additions in
|
||||
<literal>template1</>. This is particularly handy when restoring a
|
||||
<literal>pg_dump</> dump: the dump script should be restored in a
|
||||
virgin database to ensure that one recreates the correct contents
|
||||
of the dumped database, without any conflicts with additions that
|
||||
may now be present in <literal>template1</>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -214,7 +221,7 @@ createdb -T template0 <replaceable>dbname</>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Two useful flags exist in <literal>pg_database</literal> for each
|
||||
Two useful flags exist in <literal>pg_database</literal><indexterm><primary>pg_database</></> for each
|
||||
database: the columns <literal>datistemplate</literal> and
|
||||
<literal>datallowconn</literal>. <literal>datistemplate</literal>
|
||||
may be set to indicate that a database is intended as a template for
|
||||
@@ -382,7 +389,8 @@ gmake CPPFLAGS=-DALLOW_ABSOLUTE_DBPATHS all
|
||||
<title>Destroying a Database</title>
|
||||
|
||||
<para>
|
||||
Databases are destroyed with the command <command>DROP DATABASE</command>:
|
||||
Databases are destroyed with the command <command>DROP
|
||||
DATABASE</command>:<indexterm><primary>DROP DATABASE</></>
|
||||
<synopsis>
|
||||
DROP DATABASE <replaceable>name</>;
|
||||
</synopsis>
|
||||
@@ -403,7 +411,8 @@ DROP DATABASE <replaceable>name</>;
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For convenience, there is also a shell program to drop databases:
|
||||
For convenience, there is also a shell program to drop
|
||||
databases:<indexterm><primary>dropdb</></>
|
||||
<synopsis>
|
||||
dropdb <replaceable class="parameter">dbname</replaceable>
|
||||
</synopsis>
|
||||
|
@@ -1,10 +1,20 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/monitoring.sgml,v 1.20 2003/04/04 03:03:53 tgl Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/monitoring.sgml,v 1.20.2.1 2003/09/07 04:36:42 momjian Exp $
|
||||
-->
|
||||
|
||||
<chapter id="monitoring">
|
||||
<title>Monitoring Database Activity</title>
|
||||
|
||||
<indexterm zone="monitoring">
|
||||
<primary>monitoring</primary>
|
||||
<secondary>database activity</secondary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="monitoring">
|
||||
<primary>database activity</primary>
|
||||
<secondary>monitoring</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
A database administrator frequently wonders, <quote>What is the system
|
||||
doing right now?</quote>
|
||||
@@ -589,6 +599,11 @@ SELECT pg_stat_get_backend_pid(s.backendid) AS procpid,
|
||||
<sect1 id="monitoring-locks">
|
||||
<title>Viewing Locks</title>
|
||||
|
||||
<indexterm zone="monitoring-locks">
|
||||
<primary>lock</primary>
|
||||
<secondary>monitoring</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
Another useful tool for monitoring database activity is the
|
||||
<literal>pg_locks</literal> system table. It allows the
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/mvcc.sgml,v 2.35 2003/03/25 16:15:37 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/mvcc.sgml,v 2.35.2.1 2003/09/07 04:36:42 momjian Exp $
|
||||
-->
|
||||
|
||||
<chapter id="mvcc">
|
||||
@@ -22,6 +22,10 @@ $Header: /cvsroot/pgsql/doc/src/sgml/mvcc.sgml,v 2.35 2003/03/25 16:15:37 petere
|
||||
<sect1 id="mvcc-intro">
|
||||
<title>Introduction</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>MVCC</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
Unlike traditional database systems which use locks for concurrency control,
|
||||
<productname>PostgreSQL</productname>
|
||||
@@ -57,6 +61,10 @@ $Header: /cvsroot/pgsql/doc/src/sgml/mvcc.sgml,v 2.35 2003/03/25 16:15:37 petere
|
||||
<sect1 id="transaction-iso">
|
||||
<title>Transaction Isolation</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>transaction isolation</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
The <acronym>SQL</acronym> standard defines four levels of
|
||||
transaction isolation in terms of three phenomena that must be
|
||||
@@ -108,7 +116,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/mvcc.sgml,v 2.35 2003/03/25 16:15:37 petere
|
||||
|
||||
<para>
|
||||
<indexterm>
|
||||
<primary>isolation levels</primary>
|
||||
<primary>transaction isolation level</primary>
|
||||
</indexterm>
|
||||
The four transaction isolation levels and the corresponding
|
||||
behaviors are described in <xref linkend="mvcc-isolevel-table">.
|
||||
@@ -206,7 +214,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/mvcc.sgml,v 2.35 2003/03/25 16:15:37 petere
|
||||
<title>Read Committed Isolation Level</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>isolation levels</primary>
|
||||
<primary>transaction isolation level</primary>
|
||||
<secondary>read committed</secondary>
|
||||
</indexterm>
|
||||
|
||||
@@ -292,7 +300,7 @@ COMMIT;
|
||||
<title>Serializable Isolation Level</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>isolation levels</primary>
|
||||
<primary>transaction isolation level</primary>
|
||||
<secondary>serializable</secondary>
|
||||
</indexterm>
|
||||
|
||||
@@ -376,7 +384,7 @@ ERROR: Can't serialize access due to concurrent update
|
||||
<title>Explicit Locking</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>locking</primary>
|
||||
<primary>lock</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
@@ -394,6 +402,10 @@ ERROR: Can't serialize access due to concurrent update
|
||||
<sect2 id="locking-tables">
|
||||
<title>Table-Level Locks</title>
|
||||
|
||||
<indexterm zone="locking-tables">
|
||||
<primary>LOCK</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
The list below shows the available lock modes and the contexts in
|
||||
which they are used automatically by
|
||||
@@ -644,6 +656,10 @@ ERROR: Can't serialize access due to concurrent update
|
||||
<sect2 id="locking-deadlocks">
|
||||
<title>Deadlocks</title>
|
||||
|
||||
<indexterm zone="locking-deadlocks">
|
||||
<primary>deadlock</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
The use of explicit locking can increase the likelyhood of
|
||||
<firstterm>deadlocks</>, wherein two (or more) transactions each
|
||||
@@ -813,6 +829,11 @@ UPDATE accounts SET balance = balance - 100.00 WHERE acctnum = 22222;
|
||||
<sect1 id="locking-indexes">
|
||||
<title>Locking and Indexes</title>
|
||||
|
||||
<indexterm zone="locking-indexes">
|
||||
<primary>index</primary>
|
||||
<secondary>locks</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
Though <productname>PostgreSQL</productname>
|
||||
provides nonblocking read/write access to table
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/perform.sgml,v 1.30 2003/06/25 02:07:33 momjian Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/perform.sgml,v 1.30.2.1 2003/09/07 04:36:42 momjian Exp $
|
||||
-->
|
||||
|
||||
<chapter id="performance-tips">
|
||||
@@ -15,6 +15,14 @@ $Header: /cvsroot/pgsql/doc/src/sgml/perform.sgml,v 1.30 2003/06/25 02:07:33 mom
|
||||
<sect1 id="using-explain">
|
||||
<title>Using <command>EXPLAIN</command></title>
|
||||
|
||||
<indexterm zone="using-explain">
|
||||
<primary>EXPLAIN</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="using-explain">
|
||||
<primary>query plan</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
<productname>PostgreSQL</productname> devises a <firstterm>query
|
||||
plan</firstterm> for each query it is given. Choosing the right
|
||||
@@ -336,6 +344,11 @@ EXPLAIN ANALYZE SELECT * FROM tenk1 t1, tenk2 t2 WHERE t1.unique1 < 50 AND t1
|
||||
<sect1 id="planner-stats">
|
||||
<title>Statistics Used by the Planner</title>
|
||||
|
||||
<indexterm zone="planner-stats">
|
||||
<primary>statistics</primary>
|
||||
<secondary>of the planner</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
As we saw in the previous section, the query planner needs to estimate
|
||||
the number of rows retrieved by a query in order to make good choices
|
||||
@@ -381,6 +394,10 @@ SELECT relname, relkind, reltuples, relpages FROM pg_class WHERE relname LIKE 't
|
||||
since it does not read every row of the table.
|
||||
</para>
|
||||
|
||||
<indexterm>
|
||||
<primary>pg_statistic</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
Most queries retrieve only a fraction of the rows in a table, due
|
||||
to having <literal>WHERE</> clauses that restrict the rows to be examined.
|
||||
@@ -393,6 +410,10 @@ SELECT relname, relkind, reltuples, relpages FROM pg_class WHERE relname LIKE 't
|
||||
and are always approximate even when freshly updated.
|
||||
</para>
|
||||
|
||||
<indexterm>
|
||||
<primary>pg_stats</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
Rather than look at <structname>pg_statistic</structname> directly,
|
||||
it's better to look at its view <structname>pg_stats</structname>
|
||||
@@ -538,6 +559,11 @@ SELECT attname, n_distinct, most_common_vals FROM pg_stats WHERE tablename = 'ro
|
||||
<sect1 id="explicit-joins">
|
||||
<title>Controlling the Planner with Explicit <literal>JOIN</> Clauses</title>
|
||||
|
||||
<indexterm zone="explicit-joins">
|
||||
<primary>join</primary>
|
||||
<secondary>controlling the order</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
It is possible
|
||||
to control the query planner to some extent by using the explicit <literal>JOIN</>
|
||||
@@ -700,6 +726,10 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse;
|
||||
<sect2 id="disable-autocommit">
|
||||
<title>Disable Autocommit</title>
|
||||
|
||||
<indexterm zone="disable-autocommit">
|
||||
<primary>autocommit</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
Turn off autocommit and just do one commit at
|
||||
the end. (In plain SQL, this means issuing <command>BEGIN</command>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/plperl.sgml,v 2.19 2003/04/07 01:29:25 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/plperl.sgml,v 2.19.2.1 2003/09/07 04:36:42 momjian Exp $
|
||||
-->
|
||||
|
||||
<chapter id="plperl">
|
||||
@@ -73,11 +73,12 @@ CREATE FUNCTION perl_max (integer, integer) RETURNS integer AS '
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If an SQL null value is passed to a function, the argument value
|
||||
will appear as <quote>undefined</> in Perl. The above function
|
||||
definition will not behave very nicely with null inputs (in fact,
|
||||
it will act as though they are zeroes). We could add
|
||||
<literal>STRICT</> to the function definition to make
|
||||
If an SQL null value<indexterm><primary>null value</><secondary
|
||||
sortas="PL/Perl">in PL/Perl</></indexterm> is passed to a function,
|
||||
the argument value will appear as <quote>undefined</> in Perl. The
|
||||
above function definition will not behave very nicely with null
|
||||
inputs (in fact, it will act as though they are zeroes). We could
|
||||
add <literal>STRICT</> to the function definition to make
|
||||
<productname>PostgreSQL</productname> do something more reasonable:
|
||||
if a null value is passed, the function will not be called at all,
|
||||
but will just return a null result automatically. Alternatively,
|
||||
@@ -170,7 +171,7 @@ SELECT name, empcomp(employee) FROM employee;
|
||||
mirror sites</ulink>). This module makes available a
|
||||
<acronym>DBI</>-compliant database-handle named
|
||||
<varname>$pg_dbh</varname> that can be used to perform queries
|
||||
with normal <acronym>DBI</> syntax.
|
||||
with normal <acronym>DBI</> syntax.<indexterm><primary>DBI</></indexterm>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -180,7 +181,7 @@ SELECT name, empcomp(employee) FROM employee;
|
||||
<varlistentry>
|
||||
<indexterm>
|
||||
<primary>elog</primary>
|
||||
<secondary>PL/Perl</secondary>
|
||||
<secondary>in PL/Perl</secondary>
|
||||
</indexterm>
|
||||
|
||||
<term><function>elog</> <replaceable>level</replaceable>, <replaceable>msg</replaceable></term>
|
||||
@@ -202,6 +203,11 @@ SELECT name, empcomp(employee) FROM employee;
|
||||
<sect1 id="plperl-trusted">
|
||||
<title>Trusted and Untrusted PL/Perl</title>
|
||||
|
||||
<indexterm zone="plperl-trusted">
|
||||
<primary>trusted</primary>
|
||||
<secondary>PL/Perl</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
Normally, PL/Perl is installed as a <quote>trusted</> programming
|
||||
language named <literal>plperl</>. In this setup, certain Perl
|
||||
@@ -231,13 +237,14 @@ CREATE FUNCTION badfunc() RETURNS integer AS '
|
||||
|
||||
<para>
|
||||
Sometimes it is desirable to write Perl functions that are not
|
||||
restricted. For example, one might want a Perl function that
|
||||
sends mail. To handle these cases, PL/Perl can also be installed
|
||||
as an <quote>untrusted</> language (usually called
|
||||
<application>PL/PerlU</application>). In this case the full Perl language is
|
||||
available. If the <command>createlang</command> program is used to
|
||||
install the language, the language name <literal>plperlu</literal>
|
||||
will select the untrusted PL/Perl variant.
|
||||
restricted. For example, one might want a Perl function that sends
|
||||
mail. To handle these cases, PL/Perl can also be installed as an
|
||||
<quote>untrusted</> language (usually called
|
||||
<application>PL/PerlU</application><indexterm><primary>PL/PerlU</></indexterm>).
|
||||
In this case the full Perl language is available. If the
|
||||
<command>createlang</command> program is used to install the
|
||||
language, the language name <literal>plperlu</literal> will select
|
||||
the untrusted PL/Perl variant.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -272,7 +279,9 @@ CREATE FUNCTION badfunc() RETURNS integer AS '
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
PL/Perl cannot be used to write trigger functions.
|
||||
PL/Perl cannot be used to write trigger
|
||||
functions.<indexterm><primary>trigger</><secondary>in
|
||||
PL/Perl</></indexterm>
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/plpgsql.sgml,v 1.20 2003/08/09 22:50:22 tgl Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/plpgsql.sgml,v 1.20.2.1 2003/09/07 04:36:42 momjian Exp $
|
||||
-->
|
||||
|
||||
<chapter id="plpgsql">
|
||||
@@ -63,20 +63,22 @@ $Header: /cvsroot/pgsql/doc/src/sgml/plpgsql.sgml,v 1.20 2003/08/09 22:50:22 tgl
|
||||
</para>
|
||||
|
||||
<para>
|
||||
As each expression and <acronym>SQL</acronym> command is first used
|
||||
in the function, the <application>PL/pgSQL</> interpreter creates
|
||||
a prepared execution plan (using the <acronym>SPI</acronym>
|
||||
manager's <function>SPI_prepare</function> and
|
||||
<function>SPI_saveplan</function> functions). Subsequent visits
|
||||
to that expression or command reuse the prepared plan. Thus, a
|
||||
function with conditional code that contains many statements for
|
||||
which execution plans might be required will only prepare and save
|
||||
those plans that are really used during the lifetime of the
|
||||
database connection. This can substantially reduce the total
|
||||
amount of time required to parse, and generate execution plans for the
|
||||
statements in a <application>PL/pgSQL</> function. A disadvantage is
|
||||
that errors in a specific expression or command may not be detected
|
||||
until that part of the function is reached in execution.
|
||||
As each expression and <acronym>SQL</acronym> command is first
|
||||
used in the function, the <application>PL/pgSQL</> interpreter
|
||||
creates a prepared execution plan (using the
|
||||
<acronym>SPI</acronym> manager's <function>SPI_prepare</function>
|
||||
and <function>SPI_saveplan</function>
|
||||
functions).<indexterm><primary>preparing a query</><secondary>in
|
||||
PL/pgSQL</></> Subsequent visits to that expression or command
|
||||
reuse the prepared plan. Thus, a function with conditional code
|
||||
that contains many statements for which execution plans might be
|
||||
required will only prepare and save those plans that are really
|
||||
used during the lifetime of the database connection. This can
|
||||
substantially reduce the total amount of time required to parse,
|
||||
and generate execution plans for the statements in a
|
||||
<application>PL/pgSQL</> function. A disadvantage is that errors
|
||||
in a specific expression or command may not be detected until that
|
||||
part of the function is reached in execution.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -196,7 +198,7 @@ END;
|
||||
and return the <quote>polymorphic</> types
|
||||
<type>anyelement</type> and <type>anyarray</type>. The actual
|
||||
datatypes handled by a polymorphic function can vary from call to
|
||||
call, as discussed in <xref linkend="types-polymorphic">.
|
||||
call, as discussed in <xref linkend="extend-types-polymorphic">.
|
||||
An example is shown in <xref linkend="plpgsql-declaration-aliases">.
|
||||
</para>
|
||||
|
||||
@@ -563,7 +565,7 @@ END;
|
||||
or <type>anyarray</type>), a special parameter <literal>$0</literal>
|
||||
is created. Its datatype is the actual return type of the function,
|
||||
as deduced from the actual input types (see <xref
|
||||
linkend="types-polymorphic">).
|
||||
linkend="extend-types-polymorphic">).
|
||||
This allows the function to access its actual return type
|
||||
as shown in <xref linkend="plpgsql-declaration-type">.
|
||||
<literal>$0</literal> is initialized to NULL and can be modified by
|
||||
@@ -903,6 +905,11 @@ tax := subtotal * 0.06;
|
||||
<sect2 id="plpgsql-select-into">
|
||||
<title><command>SELECT INTO</command></title>
|
||||
|
||||
<indexterm zone="plpgsql-select-into">
|
||||
<primary>SELECT INTO</primary>
|
||||
<secondary>in PL/pgSQL</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
The result of a <command>SELECT</command> command yielding multiple columns (but
|
||||
only one row) can be assigned to a record variable, row-type
|
||||
@@ -1097,14 +1104,16 @@ EXECUTE ''UPDATE tbl SET ''
|
||||
<para>
|
||||
This example shows use of the functions
|
||||
<function>quote_ident(<type>text</type>)</function> and
|
||||
<function>quote_literal(<type>text</type>)</function>.
|
||||
Variables containing column and table identifiers should be
|
||||
passed to function <function>quote_ident</function>.
|
||||
Variables containing values that should be literal strings in the
|
||||
constructed command should be passed to
|
||||
<function>quote_literal</function>. Both take the
|
||||
appropriate steps to return the input text enclosed in double
|
||||
or single quotes respectively, with any embedded special characters
|
||||
<function>quote_literal(<type>text</type>)</function>.<indexterm><primary>quote_ident</><secondary>use
|
||||
in
|
||||
PL/pgSQL</></indexterm><indexterm><primary>quote_literal</><secondary>use
|
||||
in PL/pgSQL</></indexterm> Variables containing column and table
|
||||
identifiers should be passed to function
|
||||
<function>quote_ident</function>. Variables containing values
|
||||
that should be literal strings in the constructed command should
|
||||
be passed to <function>quote_literal</function>. Both take the
|
||||
appropriate steps to return the input text enclosed in double or
|
||||
single quotes respectively, with any embedded special characters
|
||||
properly escaped.
|
||||
</para>
|
||||
|
||||
@@ -1517,6 +1526,11 @@ END IF;
|
||||
<sect2 id="plpgsql-control-structures-loops">
|
||||
<title>Simple Loops</title>
|
||||
|
||||
<indexterm zone="plpgsql-control-structures-loops">
|
||||
<primary>loop</primary>
|
||||
<secondary>in PL/pgSQL</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
With the <literal>LOOP</>, <literal>EXIT</>, <literal>WHILE</>,
|
||||
and <literal>FOR</> statements, you can arrange for your
|
||||
@@ -1655,6 +1669,11 @@ FOR i IN REVERSE 10..1 LOOP
|
||||
END LOOP;
|
||||
</programlisting>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If the lower bound is greater than the upper bound, the loop body is not
|
||||
executed at all, but no error is raised.
|
||||
</para>
|
||||
</sect3>
|
||||
</sect2>
|
||||
|
||||
@@ -1734,6 +1753,11 @@ END LOOP;
|
||||
<sect1 id="plpgsql-cursors">
|
||||
<title>Cursors</title>
|
||||
|
||||
<indexterm zone="plpgsql-cursors">
|
||||
<primary>cursor</primary>
|
||||
<secondary>in PL/pgSQL</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
Rather than executing a whole query at once, it is possible to set
|
||||
up a <firstterm>cursor</> that encapsulates the query, and then read
|
||||
@@ -2096,6 +2120,11 @@ RAISE EXCEPTION ''Inexistent ID --> %'', user_id;
|
||||
<sect1 id="plpgsql-trigger">
|
||||
<title>Trigger Procedures</title>
|
||||
|
||||
<indexterm zone="plpgsql-trigger">
|
||||
<primary>trigger</primary>
|
||||
<secondary>in PL/pgSQL</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
<application>PL/pgSQL</application> can be used to define trigger
|
||||
procedures. A trigger procedure is created with the
|
||||
@@ -2302,10 +2331,12 @@ CREATE TRIGGER emp_stamp BEFORE INSERT OR UPDATE ON emp
|
||||
|
||||
<indexterm zone="plpgsql-porting">
|
||||
<primary>Oracle</primary>
|
||||
<secondary>porting from PL/SQL to PL/pgSQL</secondary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="plpgsql-porting">
|
||||
<primary>PL/SQL</primary>
|
||||
<primary>PL/SQL (Oracle)</primary>
|
||||
<secondary>porting to PL/pgSQL</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
@@ -2546,7 +2577,8 @@ END;
|
||||
with <literal>OUT</> parameters and string manipulation.
|
||||
<productname>PostgreSQL</> does not have an
|
||||
<function>instr</function> function, but you can work around it
|
||||
using a combination of other functions. In <xref
|
||||
using a combination of other
|
||||
functions.<indexterm><primary>instr</></indexterm> In <xref
|
||||
linkend="plpgsql-porting-appendix"> there is a
|
||||
<application>PL/pgSQL</application> implementation of
|
||||
<function>instr</function> that you can use to make your porting
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/plpython.sgml,v 1.18 2003/07/01 13:52:29 tgl Exp $ -->
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/plpython.sgml,v 1.18.2.1 2003/09/07 04:36:43 momjian Exp $ -->
|
||||
|
||||
<chapter id="plpython">
|
||||
<title>PL/Python - Python Procedural Language</title>
|
||||
@@ -68,9 +68,10 @@ def __plpython_procedure_myfunc_23456():
|
||||
|
||||
<para>
|
||||
If you do not provide a return value, Python returns the default
|
||||
<symbol>None</symbol>. The
|
||||
language module translates Python's <symbol>None</symbol> into the
|
||||
SQL null value.
|
||||
<symbol>None</symbol>. The language module translates Python's
|
||||
<symbol>None</symbol> into the SQL null
|
||||
value.<indexterm><primary>null value</><secondary
|
||||
sortas="PL/Python">in PL/Python</></indexterm>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -87,7 +88,9 @@ def __plpython_procedure_myfunc_23456():
|
||||
The global dictionary <varname>SD</varname> is available to store
|
||||
data between function calls. This variable is private static data.
|
||||
The global dictionary <varname>GD</varname> is public data,
|
||||
available to all Python functions within a session. Use with care.
|
||||
available to all Python functions within a session. Use with
|
||||
care.<indexterm><primary>global data</><secondary>in
|
||||
PL/Python</></indexterm>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -102,6 +105,11 @@ def __plpython_procedure_myfunc_23456():
|
||||
<sect1 id="plpython-trigger">
|
||||
<title>Trigger Functions</title>
|
||||
|
||||
<indexterm zone="plpython-trigger">
|
||||
<primary>trigger</primary>
|
||||
<secondary>in PL/Python</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
When a function is used in a trigger, the dictionary
|
||||
<literal>TD</literal> contains trigger-related values. The trigger
|
||||
@@ -146,7 +154,8 @@ def __plpython_procedure_myfunc_23456():
|
||||
<literal>plpy.error("msg")</literal>, and
|
||||
<literal>plpy.fatal("msg")</literal>. They are mostly equivalent
|
||||
to calling <literal>elog(<replaceable>LEVEL</>, "msg")</literal>
|
||||
from C code. <function>plpy.error</function> and
|
||||
from C code.<indexterm><primary>elog</><secondary>in
|
||||
PL/Python</></indexterm> <function>plpy.error</function> and
|
||||
<function>plpy.fatal</function> actually raise a Python exception
|
||||
which, if uncaught, causes the PL/Python module to call
|
||||
<literal>elog(ERROR, msg)</literal> when the function handler
|
||||
@@ -187,10 +196,11 @@ foo = rv[i]["my_column"]
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The second function, <function>plpy.prepare</function>, prepares the
|
||||
execution plan for a query. It is called with a query string and a
|
||||
list of parameter types, if you have parameter references in the
|
||||
query. For example:
|
||||
<indexterm><primary>preparing a query</><secondary>in PL/Python</></indexterm>
|
||||
The second function, <function>plpy.prepare</function>, prepares
|
||||
the execution plan for a query. It is called with a query string
|
||||
and a list of parameter types, if you have parameter references in
|
||||
the query. For example:
|
||||
<programlisting>
|
||||
plan = plpy.prepare("SELECT last_name FROM my_users WHERE first_name = $1", [ "text" ])
|
||||
</programlisting>
|
||||
@@ -235,7 +245,8 @@ CREATE FUNCTION usesavedplan() RETURNS trigger AS '
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<!-- NOT CURRENTLY SUPPORTED
|
||||
<![IGNORE[
|
||||
<!-- NOT CURRENTLY SUPPORTED -->
|
||||
|
||||
<sect1 id="plpython-trusted">
|
||||
<title>Restricted Environment</title>
|
||||
@@ -259,6 +270,6 @@ CREATE FUNCTION usesavedplan() RETURNS trigger AS '
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
-->
|
||||
]]>
|
||||
|
||||
</chapter>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/pltcl.sgml,v 2.24 2003/06/22 16:17:00 tgl Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/pltcl.sgml,v 2.24.2.1 2003/09/07 04:36:43 momjian Exp $
|
||||
-->
|
||||
|
||||
<chapter id="pltcl">
|
||||
@@ -190,6 +190,11 @@ CREATE FUNCTION overpaid(employee) RETURNS boolean AS '
|
||||
<sect1 id="pltcl-global">
|
||||
<title>Global Data in PL/Tcl</title>
|
||||
|
||||
<indexterm zone="pltcl-global">
|
||||
<primary>global data</primary>
|
||||
<secondary>in PL/Tcl</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
Sometimes it
|
||||
is useful to have some global data that is held between two
|
||||
@@ -298,8 +303,10 @@ spi_exec -array C "SELECT * FROM pg_class" {
|
||||
<term><function>spi_prepare</function> <replaceable>query</replaceable> <replaceable>typelist</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Prepares and saves a query plan for later execution. The saved plan
|
||||
will be retained for the life of the current session.
|
||||
Prepares and saves a query plan for later execution. The
|
||||
saved plan will be retained for the life of the current
|
||||
session.<indexterm><primary>preparing a query</><secondary>in
|
||||
PL/Tcl</></>
|
||||
</para>
|
||||
<para>
|
||||
The query may use parameters, that is, placeholders for
|
||||
@@ -437,7 +444,7 @@ SELECT 'doesn''t' AS ret
|
||||
<varlistentry>
|
||||
<indexterm>
|
||||
<primary>elog</primary>
|
||||
<secondary>PL/Tcl</secondary>
|
||||
<secondary>in PL/Tcl</secondary>
|
||||
</indexterm>
|
||||
<term><function>elog</> <replaceable>level</replaceable> <replaceable>msg</replaceable></term>
|
||||
<listitem>
|
||||
@@ -466,7 +473,7 @@ SELECT 'doesn''t' AS ret
|
||||
<title>Trigger Procedures in PL/Tcl</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>triggers</primary>
|
||||
<primary>trigger</primary>
|
||||
<secondary>in PL/Tcl</secondary>
|
||||
</indexterm>
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/postgres.sgml,v 1.53 2003/06/22 16:16:44 tgl Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/postgres.sgml,v 1.53.2.1 2003/09/07 04:36:43 momjian Exp $
|
||||
-->
|
||||
|
||||
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [
|
||||
@@ -188,7 +188,6 @@ $Header: /cvsroot/pgsql/doc/src/sgml/postgres.sgml,v 1.53 2003/06/22 16:16:44 tg
|
||||
&libpgtcl;
|
||||
&ecpg;
|
||||
&jdbc;
|
||||
&pygresql;
|
||||
&infoschema;
|
||||
|
||||
</part>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/protocol.sgml,v 1.41 2003/08/14 20:09:31 tgl Exp $ -->
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/protocol.sgml,v 1.41.2.1 2003/09/07 04:36:43 momjian Exp $ -->
|
||||
|
||||
<chapter id="protocol">
|
||||
<title>Frontend/Backend Protocol</title>
|
||||
@@ -1005,9 +1005,9 @@
|
||||
ParameterStatus will be generated: they are
|
||||
<literal>server_version</> (a pseudo-parameter that cannot change after
|
||||
startup);
|
||||
<literal>server_encoding</> (also not presently changeable after start);
|
||||
<literal>client_encoding</>,
|
||||
<literal>is_superuser</>, and
|
||||
<literal>is_superuser</>,
|
||||
<literal>session_authorization</literal>, and
|
||||
<literal>DateStyle</>.
|
||||
This set might change in the future, or even become configurable.
|
||||
Accordingly, a frontend should simply ignore ParameterStatus for
|
||||
|
@@ -1,8 +1,16 @@
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/queries.sgml,v 1.22 2003/08/14 23:13:27 tgl Exp $ -->
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/queries.sgml,v 1.22.2.1 2003/09/07 04:36:43 momjian Exp $ -->
|
||||
|
||||
<chapter id="queries">
|
||||
<title>Queries</title>
|
||||
|
||||
<indexterm zone="queries">
|
||||
<primary>query</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="queries">
|
||||
<primary>SELECT</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
The previous chapters explained how to create tables, how to fill
|
||||
them with data, and how to manipulate that data. Now we finally
|
||||
@@ -73,6 +81,10 @@ SELECT random();
|
||||
<sect1 id="queries-table-expressions">
|
||||
<title>Table Expressions</title>
|
||||
|
||||
<indexterm zone="queries-table-expressions">
|
||||
<primary>table expression</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
A <firstterm>table expression</firstterm> computes a table. The
|
||||
table expression contains a <literal>FROM</> clause that is
|
||||
@@ -112,6 +124,10 @@ FROM <replaceable>table_reference</replaceable> <optional>, <replaceable>table_r
|
||||
overall table expression.
|
||||
</para>
|
||||
|
||||
<indexterm>
|
||||
<primary>ONLY</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
When a table reference names a table that is the supertable of a
|
||||
table inheritance hierarchy, the table reference produces rows of
|
||||
@@ -125,7 +141,7 @@ FROM <replaceable>table_reference</replaceable> <optional>, <replaceable>table_r
|
||||
<title>Joined Tables</title>
|
||||
|
||||
<indexterm zone="queries-join">
|
||||
<primary>joins</primary>
|
||||
<primary>join</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
@@ -141,10 +157,14 @@ FROM <replaceable>table_reference</replaceable> <optional>, <replaceable>table_r
|
||||
<term>Cross join</term>
|
||||
|
||||
<indexterm>
|
||||
<primary>joins</primary>
|
||||
<primary>join</primary>
|
||||
<secondary>cross</secondary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>cross join</primary>
|
||||
</indexterm>
|
||||
|
||||
<listitem>
|
||||
<synopsis>
|
||||
<replaceable>T1</replaceable> CROSS JOIN <replaceable>T2</replaceable>
|
||||
@@ -175,10 +195,14 @@ FROM <replaceable>table_reference</replaceable> <optional>, <replaceable>table_r
|
||||
<term>Qualified joins</term>
|
||||
|
||||
<indexterm>
|
||||
<primary>joins</primary>
|
||||
<primary>join</primary>
|
||||
<secondary>outer</secondary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>outer join</primary>
|
||||
</indexterm>
|
||||
|
||||
<listitem>
|
||||
<synopsis>
|
||||
<replaceable>T1</replaceable> { <optional>INNER</optional> | { LEFT | RIGHT | FULL } <optional>OUTER</optional> } JOIN <replaceable>T2</replaceable> ON <replaceable>boolean_expression</replaceable>
|
||||
@@ -227,9 +251,12 @@ FROM <replaceable>table_reference</replaceable> <optional>, <replaceable>table_r
|
||||
|
||||
<para>
|
||||
<indexterm>
|
||||
<primary>joins</primary>
|
||||
<primary>join</primary>
|
||||
<secondary>natural</secondary>
|
||||
</indexterm>
|
||||
<indexterm>
|
||||
<primary>natural join</primary>
|
||||
</indexterm>
|
||||
Finally, <literal>NATURAL</> is a shorthand form of
|
||||
<literal>USING</>: it forms a <literal>USING</> list
|
||||
consisting of exactly those column names that appear in both
|
||||
@@ -256,10 +283,14 @@ FROM <replaceable>table_reference</replaceable> <optional>, <replaceable>table_r
|
||||
<term><literal>LEFT OUTER JOIN</></term>
|
||||
|
||||
<indexterm>
|
||||
<primary>joins</primary>
|
||||
<primary>join</primary>
|
||||
<secondary>left</secondary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>left join</primary>
|
||||
</indexterm>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
First, an inner join is performed. Then, for each row in
|
||||
@@ -274,6 +305,15 @@ FROM <replaceable>table_reference</replaceable> <optional>, <replaceable>table_r
|
||||
<varlistentry>
|
||||
<term><literal>RIGHT OUTER JOIN</></term>
|
||||
|
||||
<indexterm>
|
||||
<primary>join</primary>
|
||||
<secondary>right</secondary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>right join</primary>
|
||||
</indexterm>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
First, an inner join is performed. Then, for each row in
|
||||
@@ -424,13 +464,13 @@ FROM <replaceable>table_reference</replaceable> <optional>, <replaceable>table_r
|
||||
<title>Table and Column Aliases</title>
|
||||
|
||||
<indexterm zone="queries-table-aliases">
|
||||
<primary>label</primary>
|
||||
<secondary>table</secondary>
|
||||
<primary>alias</primary>
|
||||
<secondary>in the FROM clause</secondary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm>
|
||||
<primary>alias</primary>
|
||||
<see>label</see>
|
||||
<primary>label</primary>
|
||||
<see>alias</see>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
@@ -530,7 +570,7 @@ SELECT a.* FROM (my_table AS a JOIN your_table AS b ON ...) AS c
|
||||
<title>Subqueries</title>
|
||||
|
||||
<indexterm zone="queries-subqueries">
|
||||
<primary>subqueries</primary>
|
||||
<primary>subquery</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
@@ -556,6 +596,11 @@ FROM (SELECT * FROM table1) AS alias_name
|
||||
|
||||
<indexterm zone="queries-tablefunctions"><primary>table function</></>
|
||||
|
||||
<indexterm zone="queries-tablefunctions">
|
||||
<primary>function</>
|
||||
<secondary>in the FROM clause</>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
Table functions are functions that produce a set of rows, made up
|
||||
of either base data types (scalar types) or composite data types
|
||||
@@ -628,7 +673,7 @@ SELECT *
|
||||
<title>The WHERE Clause</title>
|
||||
|
||||
<indexterm zone="queries-where">
|
||||
<primary>where</primary>
|
||||
<primary>WHERE</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
@@ -716,7 +761,11 @@ SELECT ... FROM fdt WHERE EXISTS (SELECT c1 FROM t2 WHERE c2 > fdt.c1)
|
||||
<title>The GROUP BY and HAVING Clauses</title>
|
||||
|
||||
<indexterm zone="queries-group">
|
||||
<primary>group</primary>
|
||||
<primary>GROUP BY</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="queries-group">
|
||||
<primary>grouping</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
@@ -827,6 +876,10 @@ SELECT product_id, p.name, (sum(s.units) * p.price) AS sales
|
||||
column names is also allowed.
|
||||
</para>
|
||||
|
||||
<indexterm>
|
||||
<primary>HAVING</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
If a table has been grouped using a <literal>GROUP BY</literal>
|
||||
clause, but then only certain groups are of interest, the
|
||||
@@ -884,7 +937,7 @@ SELECT product_id, p.name, (sum(s.units) * (p.price - p.cost)) AS profit
|
||||
<title>Select Lists</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>select</primary>
|
||||
<primary>SELECT</primary>
|
||||
<secondary>select list</secondary>
|
||||
</indexterm>
|
||||
|
||||
@@ -901,6 +954,10 @@ SELECT product_id, p.name, (sum(s.units) * (p.price - p.cost)) AS profit
|
||||
<sect2 id="queries-select-list-items">
|
||||
<title>Select-List Items</title>
|
||||
|
||||
<indexterm>
|
||||
<primary>*</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
The simplest kind of select list is <literal>*</literal> which
|
||||
emits all columns that the table expression produces. Otherwise,
|
||||
@@ -944,8 +1001,8 @@ SELECT tbl1.a, tbl2.a, tbl1.b FROM ...
|
||||
<title>Column Labels</title>
|
||||
|
||||
<indexterm zone="queries-column-labels">
|
||||
<primary>label</primary>
|
||||
<secondary>column</secondary>
|
||||
<primary>alias</primary>
|
||||
<secondary>in the select list</secondary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
@@ -981,7 +1038,11 @@ SELECT a AS value, b + c AS sum FROM ...
|
||||
<title>DISTINCT</title>
|
||||
|
||||
<indexterm zone="queries-distinct">
|
||||
<primary>distinct</primary>
|
||||
<primary>DISTINCT</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="queries-distinct">
|
||||
<primary>duplicates</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
@@ -997,6 +1058,8 @@ SELECT DISTINCT <replaceable>select_list</replaceable> ...
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<indexterm><primary>null value</><secondary sortas="DISTINCT">in
|
||||
DISTINCT</></indexterm>
|
||||
Obviously, two rows are considered distinct if they differ in at
|
||||
least one column value. Null values are considered equal in this
|
||||
comparison.
|
||||
@@ -1035,13 +1098,25 @@ SELECT DISTINCT ON (<replaceable>expression</replaceable> <optional>, <replaceab
|
||||
<title>Combining Queries</title>
|
||||
|
||||
<indexterm zone="queries-union">
|
||||
<primary>union</primary>
|
||||
<primary>UNION</primary>
|
||||
</indexterm>
|
||||
<indexterm zone="queries-union">
|
||||
<primary>intersection</primary>
|
||||
<primary>INTERSECT</primary>
|
||||
</indexterm>
|
||||
<indexterm zone="queries-union">
|
||||
<primary>except</primary>
|
||||
<primary>EXCEPT</primary>
|
||||
</indexterm>
|
||||
<indexterm zone="queries-union">
|
||||
<primary>set union</primary>
|
||||
</indexterm>
|
||||
<indexterm zone="queries-union">
|
||||
<primary>set intersection</primary>
|
||||
</indexterm>
|
||||
<indexterm zone="queries-union">
|
||||
<primary>set difference</primary>
|
||||
</indexterm>
|
||||
<indexterm zone="queries-union">
|
||||
<primary>set operation</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
@@ -1104,7 +1179,10 @@ SELECT DISTINCT ON (<replaceable>expression</replaceable> <optional>, <replaceab
|
||||
|
||||
<indexterm zone="queries-order">
|
||||
<primary>sorting</primary>
|
||||
<secondary>query results</secondary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="queries-order">
|
||||
<primary>ORDER BY</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
@@ -1173,12 +1251,11 @@ SELECT a AS b FROM table1 ORDER BY a;
|
||||
<title>LIMIT and OFFSET</title>
|
||||
|
||||
<indexterm zone="queries-limit">
|
||||
<primary>limit</primary>
|
||||
<primary>LIMIT</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="queries-limit">
|
||||
<primary>offset</primary>
|
||||
<secondary>with query results</secondary>
|
||||
<primary>OFFSET</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/query.sgml,v 1.32 2003/06/24 23:27:24 momjian Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/query.sgml,v 1.32.2.1 2003/09/07 04:36:43 momjian Exp $
|
||||
-->
|
||||
|
||||
<chapter id="tutorial-sql">
|
||||
@@ -87,7 +87,8 @@ $Header: /cvsroot/pgsql/doc/src/sgml/query.sgml,v 1.32 2003/06/24 23:27:24 momji
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<indexterm><primary>cluster</primary></indexterm>
|
||||
<indexterm><primary>database cluster</primary></indexterm>
|
||||
<indexterm><primary>cluster</primary><secondary>of databases</secondary><see>database cluster</see></indexterm>
|
||||
|
||||
Tables are grouped into databases, and a collection of databases
|
||||
managed by a single <productname>PostgreSQL</productname> server
|
||||
@@ -562,7 +563,7 @@ SELECT *
|
||||
<title>Aggregate Functions</title>
|
||||
|
||||
<indexterm zone="tutorial-agg">
|
||||
<primary>aggregate</primary>
|
||||
<primary>aggregate function</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/abort.sgml,v 1.13 2003/04/26 23:56:51 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/abort.sgml,v 1.13.2.1 2003/09/07 04:36:44 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>abort the current transaction</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-abort">
|
||||
<primary>ABORT</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
ABORT [ WORK | TRANSACTION ]
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_aggregate.sgml,v 1.1 2003/06/27 14:45:25 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_aggregate.sgml,v 1.1.2.1 2003/09/07 04:36:44 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>change the definition of an aggregate function</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-alteraggregate">
|
||||
<primary>ALTER AGGREGATE</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
ALTER AGGREGATE <replaceable>name</replaceable> ( <replaceable>type</replaceable> ) RENAME TO <replaceable>newname</replaceable>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_conversion.sgml,v 1.1 2003/06/27 14:45:25 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_conversion.sgml,v 1.1.2.1 2003/09/07 04:36:44 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>change the definition of a conversion</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-alterconversion">
|
||||
<primary>ALTER CONVERSION</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
ALTER CONVERSION <replaceable>name</replaceable> RENAME TO <replaceable>newname</replaceable>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_database.sgml,v 1.7 2003/06/27 14:45:25 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_database.sgml,v 1.7.2.1 2003/09/07 04:36:44 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>change a database</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-alterdatabase">
|
||||
<primary>ALTER DATABASE</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
ALTER DATABASE <replaceable class="PARAMETER">name</replaceable> SET <replaceable>variable</replaceable> { TO | = } { <replaceable>value</replaceable> | DEFAULT }
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_domain.sgml,v 1.7 2003/01/06 00:31:44 tgl Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_domain.sgml,v 1.7.2.1 2003/09/07 04:36:44 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -8,6 +8,7 @@ PostgreSQL documentation
|
||||
<refentrytitle id="sql-alterdomain-title">ALTER DOMAIN</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>
|
||||
ALTER DOMAIN
|
||||
@@ -16,6 +17,11 @@ PostgreSQL documentation
|
||||
change the definition of a domain
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-alterdomain">
|
||||
<primary>ALTER DOMAIN</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>2002-11-27</date>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_function.sgml,v 1.1 2003/06/27 14:45:25 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_function.sgml,v 1.1.2.1 2003/09/07 04:36:44 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>change the definition of a function</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-alterfunction">
|
||||
<primary>ALTER FUNCTION</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
ALTER FUNCTION <replaceable>name</replaceable> ( [ <replaceable class="parameter">type</replaceable> [, ...] ] ) RENAME TO <replaceable>newname</replaceable>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_group.sgml,v 1.10 2003/06/27 14:45:25 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_group.sgml,v 1.10.2.1 2003/09/07 04:36:44 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>change a user group</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-altergroup">
|
||||
<primary>ALTER GROUP</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
ALTER GROUP <replaceable class="PARAMETER">groupname</replaceable> ADD USER <replaceable class="PARAMETER">username</replaceable> [, ... ]
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_language.sgml,v 1.1 2003/06/27 14:45:25 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_language.sgml,v 1.1.2.1 2003/09/07 04:36:44 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>change the definition of a procedural language</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-alterlanguage">
|
||||
<primary>ALTER LANGUAGE</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
ALTER LANGUAGE <replaceable>name</replaceable> RENAME TO <replaceable>newname</replaceable>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_opclass.sgml,v 1.1 2003/06/27 14:45:26 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_opclass.sgml,v 1.1.2.1 2003/09/07 04:36:44 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>change the definition of an operator class</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-alteropclass">
|
||||
<primary>ALTER OPERATOR CLASS</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
ALTER OPERATOR CLASS <replaceable>name</replaceable> USING <replaceable class="parameter">index_method</replaceable> RENAME TO <replaceable>newname</replaceable>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_schema.sgml,v 1.1 2003/06/27 14:45:26 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_schema.sgml,v 1.1.2.1 2003/09/07 04:36:44 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>change the definition of a schema</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-alterschema">
|
||||
<primary>ALTER SCHEMA</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
ALTER SCHEMA <replaceable>name</replaceable> RENAME TO <replaceable>newname</replaceable>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_sequence.sgml,v 1.2 2003/06/12 07:49:43 momjian Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_sequence.sgml,v 1.2.2.1 2003/09/07 04:36:44 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -8,6 +8,7 @@ PostgreSQL documentation
|
||||
<refentrytitle id="SQL-ALTERSEQUENCE-TITLE">ALTER SEQUENCE</refentrytitle>
|
||||
<refmiscinfo>SQL - Language Statements</refmiscinfo>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>
|
||||
ALTER SEQUENCE
|
||||
@@ -16,6 +17,11 @@ PostgreSQL documentation
|
||||
alter the definition of a sequence generator
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-altersequence">
|
||||
<primary>ALTER SEQUENCE</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<refsynopsisdivinfo>
|
||||
<date>1999-07-20</date>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.59 2003/04/15 13:25:08 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.59.2.1 2003/09/07 04:36:44 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>change the definition of a table</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-altertable">
|
||||
<primary>ALTER TABLE</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
ALTER TABLE [ ONLY ] <replaceable class="PARAMETER">table</replaceable> [ * ]
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_trigger.sgml,v 1.4 2003/04/15 13:25:08 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_trigger.sgml,v 1.4.2.1 2003/09/07 04:36:44 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>change the definition of a trigger</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-altertrigger">
|
||||
<primary>ALTER TRIGGER</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
ALTER TRIGGER <replaceable class="PARAMETER">trigger</replaceable> ON <replaceable class="PARAMETER">table</replaceable>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_user.sgml,v 1.28 2003/06/27 14:45:26 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_user.sgml,v 1.28.2.1 2003/09/07 04:36:44 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>change a database user account</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-alteruser">
|
||||
<primary>ALTER USER</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
ALTER USER <replaceable class="PARAMETER">username</replaceable> [ [ WITH ] <replaceable class="PARAMETER">option</replaceable> [ ... ] ]
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/analyze.sgml,v 1.12 2003/04/15 13:25:08 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/analyze.sgml,v 1.12.2.1 2003/09/07 04:36:44 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>collect statistics about a database</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-analyze">
|
||||
<primary>ANALYZE</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
ANALYZE [ VERBOSE ] [ <replaceable class="PARAMETER">table</replaceable> [ (<replaceable class="PARAMETER">column</replaceable> [, ...] ) ] ]
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/begin.sgml,v 1.24 2003/05/14 03:26:00 tgl Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/begin.sgml,v 1.24.2.1 2003/09/07 04:36:44 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>start a transaction block</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-begin">
|
||||
<primary>BEGIN</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
BEGIN [ WORK | TRANSACTION ]
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/ref/checkpoint.sgml,v 1.9 2003/04/15 13:25:08 petere Exp $ -->
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/ref/checkpoint.sgml,v 1.9.2.1 2003/09/07 04:36:44 momjian Exp $ -->
|
||||
|
||||
<refentry id="sql-checkpoint">
|
||||
<refmeta>
|
||||
@@ -11,6 +11,10 @@
|
||||
<refpurpose>force a transaction log checkpoint</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-checkpoint">
|
||||
<primary>CHECKPOINT</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
CHECKPOINT
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/close.sgml,v 1.14 2003/04/15 13:25:08 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/close.sgml,v 1.14.2.1 2003/09/07 04:36:44 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>close a cursor</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-close">
|
||||
<primary>CLOSE</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
CLOSE <replaceable class="PARAMETER">cursor</replaceable>
|
||||
@@ -31,9 +35,13 @@ CLOSE <replaceable class="PARAMETER">cursor</replaceable>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Every open cursor is implicitly closed when a transaction is
|
||||
terminated by <command>COMMIT</command> or
|
||||
<command>ROLLBACK</command>.
|
||||
Every non-holdable open cursor is implicitly closed when a
|
||||
transaction is terminated by <command>COMMIT</command> or
|
||||
<command>ROLLBACK</command>. Holdable cursors are implicitely
|
||||
closed if the transaction that created them aborts via
|
||||
<command>ROLLBACK</command>; if this does not happen, the holdable
|
||||
cursor remains open until an explicit <command>CLOSE</command> is
|
||||
executed, or the client disconnects.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
@@ -66,10 +74,10 @@ CLOSE <replaceable class="PARAMETER">cursor</replaceable>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><computeroutput>WARNING: PerformPortalClose: portal "<replaceable class="PARAMETER">cursor</replaceable>" not found</computeroutput></term>
|
||||
<term><computeroutput>ERROR: cursor "<replaceable class="PARAMETER">cursor</replaceable>" does not exist</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
This warning is given if <replaceable
|
||||
Message returned if <replaceable
|
||||
class="PARAMETER">cursor</replaceable> is not declared or has
|
||||
already been closed.
|
||||
</para>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/cluster.sgml,v 1.26 2003/04/15 13:25:08 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/cluster.sgml,v 1.26.2.1 2003/09/07 04:36:44 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>cluster a table according to an index</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-cluster">
|
||||
<primary>CLUSTER</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
CLUSTER <replaceable class="PARAMETER">indexname</replaceable> ON <replaceable class="PARAMETER">tablename</replaceable>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/clusterdb.sgml,v 1.10 2003/06/18 12:19:11 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/clusterdb.sgml,v 1.10.2.1 2003/09/07 04:36:44 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -15,6 +15,10 @@ PostgreSQL documentation
|
||||
<refpurpose>cluster a <productname>PostgreSQL</productname> database</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="app-clusterdb">
|
||||
<primary>clusterdb</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<cmdsynopsis>
|
||||
<command>clusterdb</command>
|
||||
@@ -129,10 +133,9 @@ PostgreSQL documentation
|
||||
<term><option>--host <replaceable class="parameter">host</replaceable></></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specifies the host name of the machine on which the
|
||||
server
|
||||
is running. If the value begins with a slash, it is used
|
||||
as the directory for the Unix domain socket.
|
||||
Specifies the host name of the machine on which the server is
|
||||
running. If the value begins with a slash, it is used as the
|
||||
directory for the Unix domain socket.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@@ -182,7 +185,7 @@ PostgreSQL documentation
|
||||
<term><computeroutput>CLUSTER</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Everything went well.
|
||||
The database was successfully clustered.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/comment.sgml,v 1.21 2003/04/15 13:25:08 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/comment.sgml,v 1.21.2.1 2003/09/07 04:36:44 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>define or change the comment of an object</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-comment">
|
||||
<primary>COMMENT</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
COMMENT ON
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/commit.sgml,v 1.15 2003/04/15 13:25:08 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/commit.sgml,v 1.15.2.1 2003/09/07 04:36:44 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>commit the current transaction</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-commit">
|
||||
<primary>COMMIT</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
COMMIT [ WORK | TRANSACTION ]
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/copy.sgml,v 1.46 2003/05/09 21:19:48 tgl Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/copy.sgml,v 1.46.2.1 2003/09/07 04:36:44 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>copy data between files and tables</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-copy">
|
||||
<primary>COPY</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
COPY <replaceable class="parameter">table</replaceable> [ ( <replaceable class="parameter">column</replaceable> [, ...] ) ]
|
||||
@@ -380,7 +384,7 @@ COPY <replaceable class="parameter">table</replaceable> [ ( <replaceable class="
|
||||
The file format used for <command>COPY BINARY</command> changed in
|
||||
<application>PostgreSQL</application> 7.4. The new format consists
|
||||
of a file header, zero or more tuples containing the row data, and
|
||||
a file trailer.
|
||||
a file trailer. Headers and data are now in network byte order.
|
||||
</para>
|
||||
|
||||
<refsect3>
|
||||
@@ -483,6 +487,15 @@ future extension may add a header field that allows per-column format codes
|
||||
to be specified.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To determine the appropriate binary format for the actual tuple data you
|
||||
should consult the <application>PostgreSQL</application> source, in
|
||||
particular the <function>*send</> and <function>*recv</> functions for
|
||||
the data type (typically found in the <filename>src/backend/utils/adt</filename>
|
||||
directory). The <application>contrib/binarycopy</application> module
|
||||
can also be used to create an appropriate format file.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If OIDs are included in the file, the OID field immediately follows the
|
||||
field-count word. It is a normal field except that it's not included
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_aggregate.sgml,v 1.26 2003/06/27 14:45:26 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_aggregate.sgml,v 1.26.2.1 2003/09/07 04:36:44 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>define a new aggregate function</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-createaggregate">
|
||||
<primary>CREATE AGGREGATE</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
CREATE AGGREGATE <replaceable class="PARAMETER">name</replaceable> (
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/ref/create_cast.sgml,v 1.11 2003/04/22 10:08:08 petere Exp $ -->
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/ref/create_cast.sgml,v 1.11.2.1 2003/09/07 04:36:44 momjian Exp $ -->
|
||||
|
||||
<refentry id="SQL-CREATECAST">
|
||||
<refmeta>
|
||||
@@ -11,6 +11,10 @@
|
||||
<refpurpose>define a user-defined cast</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-createcast">
|
||||
<primary>CREATE CAST</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
CREATE CAST (<replaceable>sourcetype</replaceable> AS <replaceable>targettype</replaceable>)
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_constraint.sgml,v 1.9 2003/04/22 10:08:08 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_constraint.sgml,v 1.9.2.1 2003/09/07 04:36:44 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>define a new constraint trigger</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-createconstraint">
|
||||
<primary>CREATE CONSTRAINT</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
CREATE CONSTRAINT TRIGGER <replaceable class="parameter">name</replaceable>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/ref/create_conversion.sgml,v 1.10 2003/06/27 14:45:26 petere Exp $ -->
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/ref/create_conversion.sgml,v 1.10.2.1 2003/09/07 04:36:44 momjian Exp $ -->
|
||||
|
||||
<refentry id="SQL-CREATECONVERSION">
|
||||
<refmeta>
|
||||
@@ -11,6 +11,10 @@
|
||||
<refpurpose>define a user-defined conversion</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-createconversion">
|
||||
<primary>CREATE CONVERSION</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
CREATE [DEFAULT] CONVERSION <replaceable>name</replaceable>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_database.sgml,v 1.34 2003/04/22 10:08:08 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_database.sgml,v 1.34.2.1 2003/09/07 04:36:44 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>create a new database</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-createdatabase">
|
||||
<primary>CREATE DATABASE</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
CREATE DATABASE <replaceable class="PARAMETER">name</replaceable>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_domain.sgml,v 1.13 2003/04/22 10:08:08 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_domain.sgml,v 1.13.2.1 2003/09/07 04:36:44 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>define a new domain</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-createdomain">
|
||||
<primary>CREATE DOMAIN</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
CREATE DOMAIN <replaceable class="parameter">domainname</replaceable> [AS] <replaceable class="parameter">data_type</replaceable>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_function.sgml,v 1.48 2003/06/27 14:45:26 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_function.sgml,v 1.48.2.1 2003/09/07 04:36:45 momjian Exp $
|
||||
-->
|
||||
|
||||
<refentry id="SQL-CREATEFUNCTION">
|
||||
@@ -13,6 +13,10 @@ $Header: /cvsroot/pgsql/doc/src/sgml/ref/create_function.sgml,v 1.48 2003/06/27
|
||||
<refpurpose>define a new function</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-createfunction">
|
||||
<primary>CREATE FUNCTION</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
CREATE [ OR REPLACE ] FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceable class="parameter">argtype</replaceable> [, ...] ] )
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_group.sgml,v 1.11 2003/04/22 10:08:08 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_group.sgml,v 1.11.2.1 2003/09/07 04:36:45 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>define a new user group</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-creategroup">
|
||||
<primary>CREATE GROUP</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
CREATE GROUP <replaceable class="PARAMETER">name</replaceable> [ [ WITH ] <replaceable class="PARAMETER">option</replaceable> [ ... ] ]
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_index.sgml,v 1.39 2003/05/28 16:03:55 tgl Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_index.sgml,v 1.39.2.1 2003/09/07 04:36:45 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>define a new index</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-createindex">
|
||||
<primary>CREATE INDEX</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
CREATE [ UNIQUE ] INDEX <replaceable class="parameter">index_name</replaceable> ON <replaceable class="parameter">table</replaceable> [ USING <replaceable class="parameter">method</replaceable> ]
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_language.sgml,v 1.33 2003/06/27 14:45:26 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_language.sgml,v 1.33.2.1 2003/09/07 04:36:45 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>define a new procedural language</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-createlanguage">
|
||||
<primary>CREATE LANGUAGE</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
CREATE [ TRUSTED ] [ PROCEDURAL ] LANGUAGE <replaceable class="parameter">langname</replaceable>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_opclass.sgml,v 1.8 2003/06/27 14:45:26 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_opclass.sgml,v 1.8.2.1 2003/09/07 04:36:45 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>define a new operator class for indexes</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-createopclass">
|
||||
<primary>CREATE OPERATOR CLASS</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
CREATE OPERATOR CLASS <replaceable class="parameter">name</replaceable> [ DEFAULT ] FOR TYPE <replaceable class="parameter">data_type</replaceable> USING <replaceable class="parameter">index_method</replaceable> AS
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_operator.sgml,v 1.35 2003/04/22 10:08:08 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_operator.sgml,v 1.35.2.1 2003/09/07 04:36:45 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>define a new operator</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-createoperator">
|
||||
<primary>CREATE OPERATOR</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
CREATE OPERATOR <replaceable>name</replaceable> (
|
||||
@@ -43,17 +47,11 @@ CREATE OPERATOR <replaceable>name</replaceable> (
|
||||
The operator name is a sequence of up to <symbol>NAMEDATALEN</>-1
|
||||
(63 by default) characters from the following list:
|
||||
<literallayout>
|
||||
+ - * / < > = ~ ! @ # % ^ & | ` ? $
|
||||
+ - * / < > = ~ ! @ # % ^ & | ` ?
|
||||
</literallayout>
|
||||
|
||||
There are a few restrictions on your choice of name:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>$</literal> cannot be defined as a single-character operator,
|
||||
although it can be part of a multicharacter operator name.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>--</literal> and <literal>/*</literal> cannot appear anywhere in an operator name,
|
||||
@@ -66,7 +64,7 @@ CREATE OPERATOR <replaceable>name</replaceable> (
|
||||
<literal>-</literal>,
|
||||
unless the name also contains at least one of these characters:
|
||||
<literallayout>
|
||||
~ ! @ # % ^ & | ` ? $
|
||||
~ ! @ # % ^ & | ` ?
|
||||
</literallayout>
|
||||
For example, <literal>@-</literal> is an allowed operator name,
|
||||
but <literal>*-</literal> is not.
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_rule.sgml,v 1.39 2003/04/22 10:08:08 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_rule.sgml,v 1.39.2.1 2003/09/07 04:36:45 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>define a new rewrite rule</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-createrule">
|
||||
<primary>CREATE RULE</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
CREATE [ OR REPLACE ] RULE <replaceable class="parameter">name</replaceable> AS ON <replaceable class="parameter">event</replaceable>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_schema.sgml,v 1.6 2003/06/27 14:45:26 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_schema.sgml,v 1.6.2.1 2003/09/07 04:36:45 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>define a new schema</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-createschema">
|
||||
<primary>CREATE SCHEMA</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
CREATE SCHEMA <replaceable class="parameter">schemaname</replaceable> [ AUTHORIZATION <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">schema_element</replaceable> [ ... ] ]
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_sequence.sgml,v 1.33 2003/04/22 10:08:08 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_sequence.sgml,v 1.33.2.1 2003/09/07 04:36:45 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>define a new sequence generator</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-createsequence">
|
||||
<primary>CREATE SEQUENCE</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
CREATE [ TEMPORARY | TEMP ] SEQUENCE <replaceable class="parameter">seqname</replaceable> [ INCREMENT [ BY ] <replaceable class="parameter">increment</replaceable> ]
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_table.sgml,v 1.70 2003/06/12 18:34:06 tgl Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_table.sgml,v 1.70.2.1 2003/09/07 04:36:45 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>define a new table</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-createtable">
|
||||
<primary>CREATE TABLE</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ] TABLE <replaceable class="PARAMETER">table_name</replaceable> (
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_table_as.sgml,v 1.14 2003/07/01 00:04:31 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_table_as.sgml,v 1.14.2.1 2003/09/07 04:36:45 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>create a new table from the results of a query</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-createtableas">
|
||||
<primary>CREATE TABLE AS</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ] TABLE <replaceable>table_name</replaceable> [ (<replaceable>column_name</replaceable> [, ...] ) ]
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_trigger.sgml,v 1.34 2003/04/22 10:08:08 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_trigger.sgml,v 1.34.2.1 2003/09/07 04:36:45 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>define a new trigger</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-createtrigger">
|
||||
<primary>CREATE TRIGGER</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
CREATE TRIGGER <replaceable class="PARAMETER">name</replaceable> { BEFORE | AFTER } { <replaceable class="PARAMETER">event</replaceable> [ OR ... ] }
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_type.sgml,v 1.43 2003/05/09 23:01:44 tgl Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_type.sgml,v 1.43.2.1 2003/09/07 04:36:45 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>define a new data type</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-createtype">
|
||||
<primary>CREATE TYPE</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
CREATE TYPE <replaceable class="parameter">typename</replaceable> AS
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_user.sgml,v 1.26 2003/04/22 10:08:08 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_user.sgml,v 1.26.2.1 2003/09/07 04:36:45 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>define a new database user account</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-createuser">
|
||||
<primary>CREATE USER</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
CREATE USER <replaceable class="PARAMETER">username</replaceable> [ [ WITH ] <replaceable class="PARAMETER">option</replaceable> [ ... ] ]
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_view.sgml,v 1.22 2003/04/22 10:08:08 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_view.sgml,v 1.22.2.1 2003/09/07 04:36:45 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>define a new view</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-createview">
|
||||
<primary>CREATE VIEW</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
CREATE [ OR REPLACE ] VIEW <replaceable class="PARAMETER">name</replaceable> [ ( <replaceable
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/createdb.sgml,v 1.33 2003/05/26 17:50:09 momjian Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/createdb.sgml,v 1.33.2.1 2003/09/07 04:36:45 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -15,6 +15,10 @@ PostgreSQL documentation
|
||||
<refpurpose>create a new <productname>PostgreSQL</productname> database</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="app-createdb">
|
||||
<primary>createdb</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<cmdsynopsis>
|
||||
<command>createdb</command>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/createlang.sgml,v 1.31 2003/03/24 14:32:51 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/createlang.sgml,v 1.31.2.1 2003/09/07 04:36:45 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -15,6 +15,10 @@ PostgreSQL documentation
|
||||
<refpurpose>define a new <productname>PostgreSQL</productname> procedural language</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="app-createlang">
|
||||
<primary>createlang</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<cmdsynopsis>
|
||||
<command>createlang</command>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/createuser.sgml,v 1.34 2003/06/06 15:31:46 momjian Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/createuser.sgml,v 1.34.2.1 2003/09/07 04:36:45 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -15,6 +15,10 @@ PostgreSQL documentation
|
||||
<refpurpose>define a new <productname>PostgreSQL</productname> user account</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="app-createuser">
|
||||
<primary>createuser</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<cmdsynopsis>
|
||||
<command>createuser</command>
|
||||
@@ -276,7 +280,7 @@ PostgreSQL documentation
|
||||
<term><computeroutput>CREATE USER</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
All is well.
|
||||
The user was successfully created.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/deallocate.sgml,v 1.2 2003/04/26 23:56:51 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/deallocate.sgml,v 1.2.2.1 2003/09/07 04:36:45 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>deallocate a prepared statement</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-deallocate">
|
||||
<primary>DEALLOCATE</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
DEALLOCATE [ PREPARE ] <replaceable class="parameter">plan_name</replaceable>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/declare.sgml,v 1.24 2003/05/04 02:23:16 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/declare.sgml,v 1.24.2.1 2003/09/07 04:36:45 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>define a cursor</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-declare">
|
||||
<primary>DECLARE</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
DECLARE <replaceable class="parameter">cursorname</replaceable> [ BINARY ] [ INSENSITIVE ] [ [ NO ] SCROLL ]
|
||||
@@ -202,11 +206,10 @@ DECLARE <replaceable class="parameter">cursorname</replaceable> [ BINARY ] [ INS
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><computeroutput>WARNING: Closing pre-existing portal "<replaceable class="parameter">cursorname</replaceable>"</computeroutput></term>
|
||||
<term><computeroutput>ERROR: cursor "<replaceable class="parameter">cursorname</replaceable>" already exists</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
This message is reported if a cursor with the same name already
|
||||
exists. The previous definition is discarded.
|
||||
This error occurs if a cursor with the same name already exists.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/delete.sgml,v 1.17 2003/04/26 23:56:51 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/delete.sgml,v 1.17.2.1 2003/09/07 04:36:45 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>delete rows of a table</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-delete">
|
||||
<primary>DELETE</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
DELETE FROM [ ONLY ] <replaceable class="PARAMETER">table</replaceable> [ WHERE <replaceable class="PARAMETER">condition</replaceable> ]
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_aggregate.sgml,v 1.23 2003/06/27 14:45:26 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_aggregate.sgml,v 1.23.2.1 2003/09/07 04:36:45 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>remove a user-defined aggregate function</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-dropaggregate">
|
||||
<primary>DROP AGGREGATE</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
DROP AGGREGATE <replaceable class="PARAMETER">name</replaceable> ( <replaceable class="PARAMETER">type</replaceable> ) [ CASCADE | RESTRICT ]
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_cast.sgml,v 1.3 2003/05/04 02:23:16 petere Exp $ -->
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_cast.sgml,v 1.3.2.1 2003/09/07 04:36:45 momjian Exp $ -->
|
||||
|
||||
<refentry id="SQL-DROPCAST">
|
||||
<refmeta>
|
||||
@@ -11,6 +11,10 @@
|
||||
<refpurpose>remove a user-defined cast</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-dropcast">
|
||||
<primary>DROP CAST</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
DROP CAST (<replaceable>sourcetype</replaceable> AS <replaceable>targettype</replaceable>) [ CASCADE | RESTRICT ]
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_conversion.sgml,v 1.5 2003/06/27 14:45:26 petere Exp $ -->
|
||||
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_conversion.sgml,v 1.5.2.1 2003/09/07 04:36:45 momjian Exp $ -->
|
||||
|
||||
<refentry id="SQL-DROPCONVERSION">
|
||||
<refmeta>
|
||||
@@ -11,6 +11,10 @@
|
||||
<refpurpose>remove a user-defined conversion</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-dropconversion">
|
||||
<primary>DROP CONVERSION</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
DROP CONVERSION <replaceable>conversion_name</replaceable> [ CASCADE | RESTRICT ]
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_database.sgml,v 1.16 2003/05/04 02:23:16 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_database.sgml,v 1.16.2.1 2003/09/07 04:36:45 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>remove a database</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-dropdatabase">
|
||||
<primary>DROP DATABASE</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
DROP DATABASE <replaceable class="PARAMETER">name</replaceable>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_domain.sgml,v 1.10 2003/05/04 02:23:16 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_domain.sgml,v 1.10.2.1 2003/09/07 04:36:45 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>remove a domain</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-dropdomain">
|
||||
<primary>DROP DOMAIN</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
DROP DOMAIN <replaceable class="PARAMETER">domainname</replaceable> [, ...] [ CASCADE | RESTRICT ]
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_function.sgml,v 1.25 2003/06/27 14:45:26 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_function.sgml,v 1.25.2.1 2003/09/07 04:36:45 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>remove a user-defined function</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-dropfunction">
|
||||
<primary>DROP FUNCTION</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
DROP FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceable class="parameter">type</replaceable> [, ...] ] ) [ CASCADE | RESTRICT ]
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_group.sgml,v 1.5 2003/05/04 02:23:16 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_group.sgml,v 1.5.2.1 2003/09/07 04:36:45 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>remove a user group</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-dropgroup">
|
||||
<primary>DROP GROUP</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
DROP GROUP <replaceable class="PARAMETER">name</replaceable>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_index.sgml,v 1.18 2003/06/24 23:29:25 momjian Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_index.sgml,v 1.18.2.1 2003/09/07 04:36:45 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>remove an index</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-dropindex">
|
||||
<primary>DROP INDEX</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
DROP INDEX <replaceable class="PARAMETER">name</replaceable> [, ...] [ CASCADE | RESTRICT ]
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_language.sgml,v 1.17 2003/06/27 14:45:26 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_language.sgml,v 1.17.2.1 2003/09/07 04:36:45 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>remove a user-defined procedural language</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-droplanguage">
|
||||
<primary>DROP LANGUAGE</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
DROP [ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">name</replaceable> [ CASCADE | RESTRICT ]
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_opclass.sgml,v 1.4 2003/06/27 14:45:26 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/drop_opclass.sgml,v 1.4.2.1 2003/09/07 04:36:45 momjian Exp $
|
||||
PostgreSQL documentation
|
||||
-->
|
||||
|
||||
@@ -14,6 +14,10 @@ PostgreSQL documentation
|
||||
<refpurpose>remove a user-defined operator class</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm zone="sql-dropopclass">
|
||||
<primary>DROP OPERATOR CLASS</primary>
|
||||
</indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
DROP OPERATOR CLASS <replaceable class="PARAMETER">name</replaceable> USING <replaceable class="PARAMETER">index_method</replaceable> [ CASCADE | RESTRICT ]
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user