From a27512e63480f6f3e42b4a40aacac0e035700e20 Mon Sep 17 00:00:00 2001 From: "Thomas G. Lockhart" Date: Thu, 22 Jul 1999 15:09:15 +0000 Subject: [PATCH] Complete merge of all old man page information. ecpg reference page still needs formatting. --- doc/src/sgml/ref/abort.sgml | 11 +- doc/src/sgml/ref/allfiles.sgml | 30 +- doc/src/sgml/ref/alter_table.sgml | 41 ++- doc/src/sgml/ref/alter_user.sgml | 15 +- doc/src/sgml/ref/begin.sgml | 62 ++-- doc/src/sgml/ref/close.sgml | 11 +- doc/src/sgml/ref/cluster.sgml | 34 ++- doc/src/sgml/ref/commands.sgml | 34 ++- doc/src/sgml/ref/commit.sgml | 22 +- doc/src/sgml/ref/copy.sgml | 113 ++++---- doc/src/sgml/ref/create_aggregate.sgml | 26 +- doc/src/sgml/ref/create_database.sgml | 75 ++--- doc/src/sgml/ref/create_function.sgml | 119 +++++--- doc/src/sgml/ref/create_index.sgml | 149 +++++++--- doc/src/sgml/ref/create_language.sgml | 51 ++-- doc/src/sgml/ref/create_operator.sgml | 35 ++- doc/src/sgml/ref/create_rule.sgml | 69 +++-- doc/src/sgml/ref/create_sequence.sgml | 39 ++- doc/src/sgml/ref/create_table.sgml | 74 ++++- doc/src/sgml/ref/create_table_as.sgml | 17 +- doc/src/sgml/ref/create_trigger.sgml | 36 ++- doc/src/sgml/ref/create_type.sgml | 90 +++--- doc/src/sgml/ref/create_user.sgml | 15 +- doc/src/sgml/ref/create_view.sgml | 40 ++- doc/src/sgml/ref/createdb.sgml | 12 +- doc/src/sgml/ref/createuser.sgml | 12 +- doc/src/sgml/ref/current_date.sgml | 10 + doc/src/sgml/ref/current_time.sgml | 5 + doc/src/sgml/ref/current_timestamp.sgml | 5 + doc/src/sgml/ref/current_user.sgml | 5 + doc/src/sgml/ref/declare.sgml | 89 +++--- doc/src/sgml/ref/delete.sgml | 18 +- doc/src/sgml/ref/destroydb.sgml | 12 +- doc/src/sgml/ref/destroyuser.sgml | 13 +- doc/src/sgml/ref/drop_aggregate.sgml | 28 +- doc/src/sgml/ref/drop_database.sgml | 36 +-- doc/src/sgml/ref/drop_function.sgml | 53 ++-- doc/src/sgml/ref/drop_index.sgml | 16 +- doc/src/sgml/ref/drop_language.sgml | 24 +- doc/src/sgml/ref/drop_operator.sgml | 16 +- doc/src/sgml/ref/drop_rule.sgml | 20 +- doc/src/sgml/ref/drop_sequence.sgml | 11 +- doc/src/sgml/ref/drop_table.sgml | 11 +- doc/src/sgml/ref/drop_trigger.sgml | 9 +- doc/src/sgml/ref/drop_type.sgml | 21 +- doc/src/sgml/ref/drop_user.sgml | 11 +- doc/src/sgml/ref/drop_view.sgml | 11 +- doc/src/sgml/ref/ecpg-ref.sgml | 367 ++++++++++++++++++++++++ doc/src/sgml/ref/end.sgml | 170 +++++++++++ doc/src/sgml/ref/explain.sgml | 56 +++- doc/src/sgml/ref/fetch.sgml | 105 ++++--- doc/src/sgml/ref/grant.sgml | 13 +- doc/src/sgml/ref/initdb.sgml | 9 +- doc/src/sgml/ref/initlocation.sgml | 9 +- doc/src/sgml/ref/insert.sgml | 36 ++- doc/src/sgml/ref/ipcclean.sgml | 117 ++++++++ doc/src/sgml/ref/listen.sgml | 21 +- doc/src/sgml/ref/load.sgml | 15 +- doc/src/sgml/ref/lock.sgml | 13 +- doc/src/sgml/ref/move.sgml | 37 ++- doc/src/sgml/ref/notify.sgml | 11 +- doc/src/sgml/ref/pg_dump.sgml | 11 +- doc/src/sgml/ref/pg_dumpall.sgml | 13 +- doc/src/sgml/ref/pg_passwd.sgml | 170 +++++++++++ doc/src/sgml/ref/pg_upgrade.sgml | 16 +- doc/src/sgml/ref/pgaccess-ref.sgml | 5 + doc/src/sgml/ref/pgadmin-ref.sgml | 5 + doc/src/sgml/ref/postgres-ref.sgml | 9 +- doc/src/sgml/ref/postmaster.sgml | 9 +- doc/src/sgml/ref/psql-ref.sgml | 9 +- doc/src/sgml/ref/reset.sgml | 32 ++- doc/src/sgml/ref/revoke.sgml | 22 +- doc/src/sgml/ref/rollback.sgml | 11 +- doc/src/sgml/ref/select.sgml | 32 ++- doc/src/sgml/ref/select_into.sgml | 12 +- doc/src/sgml/ref/set.sgml | 13 +- doc/src/sgml/ref/show.sgml | 11 +- doc/src/sgml/ref/unlisten.sgml | 7 +- doc/src/sgml/ref/update.sgml | 19 +- doc/src/sgml/ref/vacuum.sgml | 14 +- doc/src/sgml/ref/vacuumdb.sgml | 9 +- 81 files changed, 2292 insertions(+), 772 deletions(-) create mode 100644 doc/src/sgml/ref/ecpg-ref.sgml create mode 100644 doc/src/sgml/ref/end.sgml create mode 100644 doc/src/sgml/ref/ipcclean.sgml create mode 100644 doc/src/sgml/ref/pg_passwd.sgml diff --git a/doc/src/sgml/ref/abort.sgml b/doc/src/sgml/ref/abort.sgml index 32fc9a27fd..e97654a077 100644 --- a/doc/src/sgml/ref/abort.sgml +++ b/doc/src/sgml/ref/abort.sgml @@ -1,6 +1,11 @@ + + - + ABORT SQL - Language Statements @@ -15,10 +20,10 @@ - 1998-09-27 + 1999-07-20 -ABORT [ TRANSACTION | WORK ] +ABORT [ WORK | TRANSACTION ] diff --git a/doc/src/sgml/ref/allfiles.sgml b/doc/src/sgml/ref/allfiles.sgml index 07ea4d2ef6..a0558440d7 100644 --- a/doc/src/sgml/ref/allfiles.sgml +++ b/doc/src/sgml/ref/allfiles.sgml @@ -1,8 +1,8 @@ - + @@ -38,22 +38,6 @@ - - - - @@ -92,6 +76,7 @@ + @@ -117,12 +102,15 @@ + + + diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml index 25a2b948e4..715836f9ac 100644 --- a/doc/src/sgml/ref/alter_table.sgml +++ b/doc/src/sgml/ref/alter_table.sgml @@ -1,6 +1,11 @@ + + - + ALTER TABLE SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-04-15 + 1999-07-20 ALTER TABLE table @@ -166,9 +171,37 @@ ERROR - [*] following a name of a table indicates that statement + * following a name of a table indicates that the statement should be run over that table and all tables below it in the - inheritance hierarchy. + inheritance hierarchy; + by default, the attribute will not be added to or renamed in any of the subclasses. + + This should always be done when adding or modifying an attribute in a + superclass. If it is not, queries on the inheritance hierarchy + such as + + +SELECT NewColumn FROM SuperClass* + + + will not work because the subclasses will be missing an attribute + found in the superclass. + + + + For efficiency reasons, default values for added attributes are + not placed in existing instances of a class. + That is, existing instances will have NULL values in the new + attributes. If non-NULL values are desired, a subsequent + UPDATE query + () + should be run. + + + + You must own the class in order to change its schema. + Renaming any part of the schema of a system + catalog is not permitted. The PostgreSQL User's Guide has further information on inheritance. diff --git a/doc/src/sgml/ref/alter_user.sgml b/doc/src/sgml/ref/alter_user.sgml index b7dc46e4b1..686684632a 100644 --- a/doc/src/sgml/ref/alter_user.sgml +++ b/doc/src/sgml/ref/alter_user.sgml @@ -1,6 +1,11 @@ + + - + ALTER USER SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-09-08 + 1999-07-20 ALTER USER username [ WITH PASSWORD password ] @@ -126,7 +131,7 @@ ERROR: alterUser: user "username" does not exist ALTER USER is used to change the attributes of a user's Postgres account. Please note that it is not possible - to alter a user's "usesysid" via the alter user + to alter a user's "usesysid" via the alter user statement. Also, it is only possible for the Postgres user or any user with read and modify permissions on @@ -135,7 +140,7 @@ ERROR: alterUser: user "username" does not exist If any of the clauses of the alter user statement are - omitted, the corresponding value in the "pg_shadow" table + omitted, the corresponding value in the pg_shadow table is left unchanged. @@ -205,8 +210,6 @@ ALTER USER miriam IN GROUP sales, payroll; Compatibility - - diff --git a/doc/src/sgml/ref/begin.sgml b/doc/src/sgml/ref/begin.sgml index 09d5fe57de..a6e45aaadb 100644 --- a/doc/src/sgml/ref/begin.sgml +++ b/doc/src/sgml/ref/begin.sgml @@ -1,6 +1,11 @@ - + + + - + BEGIN SQL - Language Statements @@ -16,13 +21,13 @@ - 1999-06-11 + 1999-07-20 BEGIN [ WORK | TRANSACTION ] - + 1999-06-11 @@ -30,11 +35,22 @@ BEGIN [ WORK | TRANSACTION ] Inputs - None. + + + + WORK + TRANSACTION + + + Optional keywords. They have no effect. + + + + - + 1999-06-11 @@ -70,7 +86,7 @@ NOTICE: BeginTransactionBlock and not in default state - + 1999-06-11 @@ -88,7 +104,9 @@ NOTICE: BeginTransactionBlock and not in default state (if execution was successful, otherwise a rollback is done). BEGIN initiates a user transaction in chained mode, i.e. all user statements after BEGIN command will - be executed in a single transaction until an explicit COMMIT, ROLLBACK + be executed in a single transaction until an explicit + , + , or execution abort. Statements in chained mode are executed much faster, because transaction start/commit requires significant CPU and disk activity. Execution of multiple statements inside a transaction @@ -102,7 +120,7 @@ NOTICE: BeginTransactionBlock and not in default state is READ COMMITTED, where queries inside the transaction see only changes committed before query execution. So, you have to use SET TRANSACTION ISOLATION LEVEL SERIALIZABLE - just after BEGIN if you need more rigorous transaction isolation. + just after BEGIN if you need more rigorous transaction isolation. In SERIALIZABLE mode queries will see only changes committed before the entire transaction began (actually, before execution of the first DML statement @@ -116,7 +134,7 @@ NOTICE: BeginTransactionBlock and not in default state (atomic, consistent, isolatable, and durable) property. - + 1999-06-11 @@ -129,7 +147,8 @@ NOTICE: BeginTransactionBlock and not in default state - Refer to the LOCK statement for further information + Refer to + for further information about locking tables inside a transaction. @@ -142,7 +161,7 @@ NOTICE: BeginTransactionBlock and not in default state - + Usage @@ -156,25 +175,26 @@ BEGIN WORK; - + Compatibility - - BEGIN - is a Postgres language extension. - - + + 1999-06-11 SQL92 - - There is no explicit BEGIN WORK command in SQL92; + + + BEGIN + is a Postgres language extension. + There is no explicit BEGIN + command in SQL92; transaction initiation is always implicit and it terminates either - with a COMMIT or with a ROLLBACK statement. + with a COMMIT or ROLLBACK statement. diff --git a/doc/src/sgml/ref/close.sgml b/doc/src/sgml/ref/close.sgml index 6925849d60..1a470c00b8 100644 --- a/doc/src/sgml/ref/close.sgml +++ b/doc/src/sgml/ref/close.sgml @@ -1,6 +1,11 @@ + + - + CLOSE SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-09-08 + 1999-07-20 CLOSE cursor @@ -131,8 +136,6 @@ CLOSE liahona; Compatibility - - diff --git a/doc/src/sgml/ref/cluster.sgml b/doc/src/sgml/ref/cluster.sgml index bfae55585e..2b66cf8690 100644 --- a/doc/src/sgml/ref/cluster.sgml +++ b/doc/src/sgml/ref/cluster.sgml @@ -1,6 +1,11 @@ + + - + CLUSTER SQL - Language Statements @@ -10,12 +15,12 @@ CLUSTER - Gives storage clustering advice to the backend + Gives storage clustering advice to the server - 1998-09-08 + 1999-07-20 CLUSTER indexname ON table @@ -72,7 +77,7 @@ CLUSTER -ERROR: relation <tablerelation_number> inherits "invoice" +ERROR: relation <tablerelation_number> inherits "table" @@ -85,12 +90,12 @@ ERROR: relation <tablerelation_number -ERROR: Relation x does not exist! +ERROR: Relation table does not exist! - The relation complained of was not shown in the error message, + The specified relation was not shown in the error message, which contained a random string instead of the relation name. @@ -111,12 +116,13 @@ ERROR: Relation x does not exist! CLUSTER instructs Postgres to cluster the class specified - by classname approximately + by table approximately based on the index specified by indexname. The index must already have been defined on classname. + When a class is clustered, it is physically reordered based on the index information. The clustering is static. @@ -150,7 +156,8 @@ ERROR: Relation x does not exist! - Another place CLUSTER is helpful is in cases where you use an + Another place where CLUSTER is helpful is in + cases where you use an index to pull out several rows from a table. If you are requesting a range of indexed values from a table, or a single indexed value that has multiple rows that match, @@ -173,11 +180,14 @@ ERROR: Relation x does not exist! Another way to cluster data is to use + -SELECT ... INTO TABLE temp FROM ... ORDER BY ... +SELECT columnlist INTO TABLE newtable + FROM table ORDER BY columnlist - This uses the Postgres sorting code in - ORDER BY to match the index, and is much faster for + + which uses the Postgres sorting code in + the ORDER BY clause to match the index, and which is much faster for unordered data. You then drop the old table, use ALTER TABLE/RENAME to rename temp to the old name, and @@ -205,8 +215,6 @@ CLUSTER emp_ind ON emp; Compatibility - - diff --git a/doc/src/sgml/ref/commands.sgml b/doc/src/sgml/ref/commands.sgml index dced732e17..6ed2873c38 100644 --- a/doc/src/sgml/ref/commands.sgml +++ b/doc/src/sgml/ref/commands.sgml @@ -1,3 +1,8 @@ + + SQL Commands @@ -45,6 +50,7 @@ &dropType &dropUser; &dropView; + &end; &explain; &fetch; &grant; @@ -88,7 +94,7 @@ functions supported by Postgres. --> - + Applications @@ -103,19 +109,37 @@ functions supported by Postgres. &createuser; &destroydb; &destroyuser; - &initdb; - &initlocation; + &ecpgRef; &pgAccess; &pgAdmin; &pgDump; &pgDumpall; - &postgres; - &postmaster; &psqlRef; &vacuumdb; + + System Applications + + + + This is reference information for + Postgres + servers and support utilities. + + + + &initdb; + &initlocation; + &ipcclean; + &pgPasswd; + &pgUpgrade; + &postgres; + &postmaster; + + + + @@ -16,7 +21,7 @@ - 1998-09-08 + 1999-07-20 COMMIT [ WORK | TRANSACTION ] @@ -30,7 +35,18 @@ COMMIT [ WORK | TRANSACTION ] Inputs - None. + + + + WORK + TRANSACTION + + + Optional keywords. They have no effect. + + + + @@ -116,8 +132,6 @@ COMMIT WORK; Compatibility - - diff --git a/doc/src/sgml/ref/copy.sgml b/doc/src/sgml/ref/copy.sgml index 20081eb2e6..cc67e878c2 100644 --- a/doc/src/sgml/ref/copy.sgml +++ b/doc/src/sgml/ref/copy.sgml @@ -1,6 +1,11 @@ + + - + COPY SQL - Language Statements @@ -15,16 +20,14 @@ - 1998-09-08 + 1999-07-20 COPY [ BINARY ] table [ WITH OIDS ] - FROM { 'filename' | - stdin } + FROM { 'filename' | stdin } [ USING DELIMITERS 'delimiter' ] COPY [ BINARY ] table [ WITH OIDS ] - TO { 'filename' | - stdout } + TO { 'filename' | stdout } [ USING DELIMITERS 'delimiter' ] @@ -47,6 +50,7 @@ COPY [ BINARY ] table [ WITH OIDS ] + table @@ -55,6 +59,7 @@ COPY [ BINARY ] table [ WITH OIDS ] + WITH OIDS @@ -63,6 +68,7 @@ COPY [ BINARY ] table [ WITH OIDS ] + filename @@ -71,6 +77,7 @@ COPY [ BINARY ] table [ WITH OIDS ] + stdin @@ -79,6 +86,7 @@ COPY [ BINARY ] table [ WITH OIDS ] + stdout @@ -87,6 +95,7 @@ COPY [ BINARY ] table [ WITH OIDS ] + delimiter @@ -121,7 +130,7 @@ COPY -ERROR: error message +ERROR: reason @@ -144,7 +153,7 @@ ERROR: error message COPY moves data between Postgres tables and - standard Unix files. + standard file-system files. COPY instructs the Postgres backend @@ -175,8 +184,10 @@ ERROR: error message - You must have select access on any table whose values are read by - COPY, and either insert or update access to a + You must have select access on any table + whose values are read by + COPY, and either + insert or update access to a table into which values are being inserted by COPY. The backend also needs appropriate Unix permissions for any file read or written by COPY. @@ -195,6 +206,44 @@ ERROR: error message + + + COPY neither invokes rules nor acts on column defaults. + It does invoke triggers, however. + + + COPY stops operation at the first error. This + should not lead to problems in the event of + a COPY FROM, but the + target relation will, of course, be partially modified in a + COPY TO. + VACUUM should be used to clean up + after a failed copy. + + + Because the Postgres backend's current working directory + is not usually the same as the user's + working directory, the result of copying to a file + "foo" (without + additional path information) may yield unexpected results for the + naive user. In this case, foo + will wind up in $PGDATA/foo. In + general, the full pathname as it would appear to the backend server machine + should be used when specifying files to + be copied. + + + Files used as arguments to COPY + must reside on or be + accessible to the database server machine by being either on + local disks or on a networked file system. + + + When a TCP/IP connection from one machine to another is used, and a + target file is specified, the target file will be written on the + machine where the backend is running rather than the user's + machine. + @@ -249,6 +298,7 @@ ERROR: error message properly. + 1998-05-04 @@ -385,53 +435,10 @@ has the termination sequence on the last line): - - Bugs and features - - COPY neither invokes rules nor acts on column defaults. - It does invoke triggers, however. - - - COPY stops operation at the first error. This - should not lead to problems in the event of - a COPY FROM, but the - target relation will, of course, be partially modified in a -COPY TO. - The VACUUM query should be used to clean up - after a failed copy. - - - Because the Postgres backend's current working directory - is not usually the same as the user's - working directory, the result of copying to a file - "foo" (without - additional path information) may yield unexpected results for the - naive user. In this case, foo - will wind up in $PGDATA/foo. In - general, the full pathname as it would appear to the backend server machine -should be used when specifying files to - be copied. - - - Files used as arguments to COPY -must reside on or be - accessible to the database server machine by being either on - local disks or on a networked file system. - - - When a TCP/IP connection from one machine to another is used, and a - target file is specified, the target file will be written on the - machine where the backend is running rather than the user's - machine. - - - Compatibility - - diff --git a/doc/src/sgml/ref/create_aggregate.sgml b/doc/src/sgml/ref/create_aggregate.sgml index 07cb8f15a2..936ee2b43b 100644 --- a/doc/src/sgml/ref/create_aggregate.sgml +++ b/doc/src/sgml/ref/create_aggregate.sgml @@ -1,6 +1,11 @@ + + - + CREATE AGGREGATE SQL - Language Statements @@ -16,19 +21,15 @@ - 1998-09-09 + 1999-07-20 -CREATE AGGREGATE name [ AS ] - ( BASETYPE = data_type - [ , SFUNC1 = sfunc1 - , STYPE1 = sfunc1_return_type ] - [ , SFUNC2 = sfunc2 - , STYPE2 = sfunc2_return_type ] +CREATE AGGREGATE name [ AS ] ( BASETYPE = data_type + [ , SFUNC1 = sfunc1, STYPE1 = sfunc1_return_type ] + [ , SFUNC2 = sfunc2, STYPE2 = sfunc2_return_type ] [ , FINALFUNC = ffunc ] [ , INITCOND1 = initial_condition1 ] - [ , INITCOND2 = initial_condition2 ] - ) + [ , INITCOND2 = initial_condition2 ] ) @@ -296,10 +297,9 @@ CREATE Refer to the chapter on aggregate functions - in the PostgreSQL Programmer's Guide - on aggregate functions for + in the PostgreSQL Programmer's Guide for complete examples of usage. - + diff --git a/doc/src/sgml/ref/create_database.sgml b/doc/src/sgml/ref/create_database.sgml index cb0f18a589..0be80b994c 100644 --- a/doc/src/sgml/ref/create_database.sgml +++ b/doc/src/sgml/ref/create_database.sgml @@ -1,6 +1,11 @@ + + - + CREATE DATABASE SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-04-15 + 1999-07-20 CREATE DATABASE name [ WITH LOCATION = 'dbpath' ] @@ -43,12 +48,7 @@ CREATE DATABASE name [ WITH LOCATIO dbpath - An alternate location can be specified as either an - environment variable known to the backend server - (e.g. 'PGDATA2') or as an absolute path name - (e.g. '/usr/local/pgsql/data'). - In either case, the location must be pre-configured - by initlocation. + An alternate location for the new database. See below for caveats. @@ -114,6 +114,16 @@ ERROR: Unable to create database directory direc The creator becomes the administrator of the new database. + + An alternate location can be specified as either an + environment variable known to the backend server + (e.g. 'PGDATA2') or, if the server is built to + allow it, as an absolute path name + (e.g. '/usr/local/pgsql/data'). + In either case, the location must be pre-configured + by initlocation. + + 1998-04-15 @@ -128,6 +138,28 @@ ERROR: Unable to create database directory direc Use DROP DATABASE to remove a database. + + + There are security and data integrity issues + involved with using alternate database locations + specified with absolute path names, and by default + only an environment variable known to the backend may be + specified for an alternate location. + See the Administrator's Guide for more information. + + + @@ -166,31 +198,6 @@ ERROR: Unable to create database directory direc - - - Bugs - - - There are security and data integrity issues - involved with using alternate database locations - specified with absolute path names, and by default - only an environment variable known to the backend may be - specified for an alternate location. - See the Administrator's Guide for more information. - - - - - Compatibility @@ -205,8 +212,6 @@ Not sure if the dump/reload would guarantee that the alternate data area gets re There is no CREATE DATABASE statement in SQL92. - - The equivalent command in standard SQL is CREATE SCHEMA. diff --git a/doc/src/sgml/ref/create_function.sgml b/doc/src/sgml/ref/create_function.sgml index 7ba3391a66..84f4f5c958 100644 --- a/doc/src/sgml/ref/create_function.sgml +++ b/doc/src/sgml/ref/create_function.sgml @@ -1,6 +1,11 @@ + + - + CREATE FUNCTION SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-09-09 + 1999-07-20 CREATE FUNCTION name ( [ ftype [, ...] ] ) @@ -47,6 +52,10 @@ CREATE FUNCTION name ( [ The data type of function arguments. + The input types may be base or complex types, or + opaque. + opaque indicates that the function + accepts arguments of an invalid type such as char *. @@ -55,6 +64,12 @@ CREATE FUNCTION name ( [ The return data type. + The output type may be specified as a base type, complex type, + setof type, + or opaque. + The setof + modifier indicates that the function will return a set of items, + rather than a single item. @@ -77,7 +92,9 @@ CREATE FUNCTION name ( [ plname', where 'plname' is the name of a created procedural - language. See CREATE LANGUAGE for details. + language. See + + for details. @@ -133,43 +150,52 @@ CREATE Notes - Refer to the chapter on functions -in the PostgreSQL Programmer's Guide - for further information. + Refer to the chapter in + the PostgreSQL Programmer's Guide + on extending + Postgres via functions + for further information on writing external functions. + Use DROP FUNCTION to drop user-defined functions. - - Postgres allows function "overloading"; - that is, the same name can be used for several different functions - so long as they have distinct argument types. This facility must be - used with caution for INTERNAL and C-language functions, however. - + + Postgres allows function "overloading"; + that is, the same name can be used for several different functions + so long as they have distinct argument types. This facility must be + used with caution for internal + and C-language functions, however. + - - Two INTERNAL functions cannot have the same C name without causing - errors at link time. To get around that, give them different C names - (for example, use the argument types as part of the C names), then - specify those names in the AS clause of CREATE FUNCTION. - If the AS clause is left empty then CREATE FUNCTION - assumes the C name of the function is the same as the SQL name. - + + Two internal + functions cannot have the same C name without causing + errors at link time. To get around that, give them different C names + (for example, use the argument types as part of the C names), then + specify those names in the AS clause of CREATE FUNCTION. + If the AS clause is left empty then CREATE FUNCTION + assumes the C name of the function is the same as the SQL name. + - - For dynamically-loaded C functions, the SQL name of the function must - be the same as the C function name, because the AS clause is used to - give the path name of the object file containing the C code. In this - situation it is best not to try to overload SQL function names. It - might work to load a C function that has the same C name as an internal - function or another dynamically-loaded function --- or it might not. - On some platforms the dynamic loader may botch the load in interesting - ways if there is a conflict of C function names. So, even if it works - for you today, you might regret overloading names later when you try - to run the code somewhere else. - + + For dynamically-loaded C functions, the SQL name of the function must + be the same as the C function name, because the AS clause is used to + give the path name of the object file containing the C code. In this + situation it is best not to try to overload SQL function names. It + might work to load a C function that has the same C name as an internal + function or another dynamically-loaded function --- or it might not. + On some platforms the dynamic loader may botch the load in interesting + ways if there is a conflict of C function names. So, even if it works + for you today, you might regret overloading names later when you try + to run the code somewhere else. + + + + A C function cannot return a set of values. + @@ -195,7 +221,7 @@ SELECT one() AS answer; - To create a C function, calling a routine from a user-created + This example creates a C function by calling a routine from a user-created shared library. This particular routine calculates a check digit and returns TRUE if the check digit in the function parameters is correct. It is intended for use in a CHECK contraint. @@ -216,25 +242,26 @@ CREATE TABLE product ( - - - Bugs - - - A C function cannot return a set of values. - - - Compatibility - - CREATE FUNCTION is - a Postgres language extension. - + + 1998-04-15 + + + SQL92 + + + + CREATE FUNCTION is + a Postgres language extension. + + + + 1998-09-09 diff --git a/doc/src/sgml/ref/create_index.sgml b/doc/src/sgml/ref/create_index.sgml index 860a793c6c..55608187e6 100644 --- a/doc/src/sgml/ref/create_index.sgml +++ b/doc/src/sgml/ref/create_index.sgml @@ -1,6 +1,11 @@ + + - + CREATE INDEX SQL - Language Statements @@ -15,15 +20,13 @@ - 1998-09-09 + 1999-07-20 -CREATE [ UNIQUE ] INDEX index_name - ON table [ USING acc_name ] - ( column [ ops_name] [, ...] ) -CREATE [ UNIQUE ] INDEX index_name - ON table [ USING acc_name ] - ( func_name( r">colle> [, ... ]) ops_name ) +CREATE [ UNIQUE ] INDEX index_name ON table + [ USING acc_name ] ( column [ ops_name] [, ...] ) +CREATE [ UNIQUE ] INDEX index_name ON table + [ USING acc_name ] ( func_name( r">colle> [, ... ]) ops_name ) @@ -48,6 +51,7 @@ CREATE [ UNIQUE ] INDEX index_name + index_name @@ -56,6 +60,7 @@ CREATE [ UNIQUE ] INDEX index_name + table @@ -64,6 +69,7 @@ CREATE [ UNIQUE ] INDEX index_name + acc_name @@ -71,6 +77,7 @@ CREATE [ UNIQUE ] INDEX index_name the name of the access method which is to be used for the index. The default access method is BTREE. Postgres provides three access methods for secondary indexes: + BTREE @@ -81,6 +88,7 @@ CREATE [ UNIQUE ] INDEX index_name + RTREE @@ -89,6 +97,7 @@ CREATE [ UNIQUE ] INDEX index_name + HASH @@ -98,7 +107,6 @@ CREATE [ UNIQUE ] INDEX index_name - @@ -111,27 +119,16 @@ CREATE [ UNIQUE ] INDEX index_name + ops_name - An associated operator class. - The following select list returns all ops_names: - - -SELECT am.amname AS acc_name, - opc.opcname AS ops_name, - opr.oprname AS ops_comp - FROM pg_am am, pg_amop amop, - pg_opclass opc, pg_operator opr - WHERE amop.amopid = am.oid AND - amop.amopclaid = opc.oid AND - amop.amopopr = opr.oid - ORDER BY acc_name, ops_name, ops_comp - + An associated operator class. See below for details. + func_name @@ -190,9 +187,8 @@ ERROR: Cannot create index: 'index_name' already exists. CREATE INDEX constructs an index - index_name. - on the specified - table. + index_name + on the specified table. @@ -201,6 +197,7 @@ ERROR: Cannot create index: 'index_name' already exists. + In the first syntax shown above, the key fields for the index are specified as column names; a column may also have @@ -213,16 +210,30 @@ ERROR: Cannot create index: 'index_name' already exists. operator class is the appropriate operator class for that field type. + - In the second syntax, an index is defined + In the second syntax shown above, an index is defined on the result of a user-defined function func_name applied - to one or more attributes of a single class. These functional - indexes can be used to obtain fast access to data + to one or more attributes of a single class. + These functional indices + can be used to obtain fast access to data based on operators that would normally require some transformation to apply them to the base data. + + Postgres provides btree, rtree and hash access methods for + secondary indices. The btree access method is an implementation of + the Lehman-Yao high-concurrency btrees. The rtree access method + implements standard rtrees using Guttman's quadratic split algorithm. + The hash access method is an implementation of Litwin's linear + hashing. We mention the algorithms used solely to indicate that all + of these access methods are fully dynamic and do not have to be + optimized periodically (as is the case with, for example, static hash + access methods). + + 1998-09-09 @@ -230,14 +241,90 @@ ERROR: Cannot create index: 'index_name' already exists. Notes + + + The Postgres query optimizer will consider using btree indices in a scan + whenever an indexed attribute is involved in a comparison using one of: + + + < + <= + = + >= + > + + + + + Both box classes support indices on the box data + type in Postgres. + The difference between them is that bigbox_ops + scales box coordinates down, to avoid floating point exceptions from + doing multiplication, addition, and subtraction on very large + floating-point coordinates. If the field on which your rectangles lie + is about 20,000 units square or larger, you should use + bigbox_ops. + The poly_ops operator class supports rtree + indices on polygon data. + + + + The Postgres + query optimizer will consider using an rtree index whenever + an indexed attribute is involved in a comparison using one of: + + + << + &< + &> + >> + @ + ~= + && + + + + + The Postgres + query optimizer will consider using a hash index whenever + an indexed attribute is involved in a comparison using + the = operator. + + Currently, only the BTREE access method supports multi-column indexes. Up to 7 keys may be specified. + - Use DROP INDEX + Use to remove an index. + + + The int24_ops + operator class is useful for constructing indices on int2 data, and + doing comparisons against int4 data in query qualifications. + Similarly, int42_ops + support indices on int4 data that is to be compared against int2 data + in queries. + + + + The following select list returns all ops_names: + + +SELECT am.amname AS acc_name, + opc.opcname AS ops_name, + opr.oprname AS ops_comp + FROM pg_am am, pg_amop amop, + pg_opclass opc, pg_operator opr + WHERE amop.amopid = am.oid AND + amop.amopclaid = opc.oid AND + amop.amopopr = opr.oid + ORDER BY acc_name, ops_name, ops_comp + + @@ -276,8 +363,6 @@ SELECT * FROM points Compatibility - - diff --git a/doc/src/sgml/ref/create_language.sgml b/doc/src/sgml/ref/create_language.sgml index 0089ee90ca..7cdb403825 100644 --- a/doc/src/sgml/ref/create_language.sgml +++ b/doc/src/sgml/ref/create_language.sgml @@ -1,6 +1,11 @@ + + - + CREATE LANGUAGE SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-09-09 + 1999-07-20 CREATE [ TRUSTED ] PROCEDURAL LANGUAGE 'langname' @@ -59,7 +64,8 @@ CREATE [ TRUSTED ] PROCEDURAL LANGUAGE 'langname< Postgres. - + + HANDLER call_handler @@ -71,6 +77,7 @@ CREATE [ TRUSTED ] PROCEDURAL LANGUAGE 'langname< + comment @@ -242,32 +249,22 @@ C |/bin/cc sql |postgres + + + Since the call handler for a procedural language must be + registered with Postgres in the 'C' language, + it inherits + all the capabilities and restrictions of 'C' functions. + + + + At present, the definitions for a procedural language cannot be + changed once they have been created. - - - Restrictions - - - Since the call handler for a procedural language must be - registered with Postgres in the 'C' language, - it inherits - all the capabilities and restrictions of 'C' functions. - - - - - Bugs - - - At present, the definitions for a procedural language cannot be - changed once they have been created. - - - Usage @@ -340,9 +337,6 @@ CREATE PROCEDURAL LANGUAGE 'plsample' <title> Compatibility - - CREATE LANGUAGE is a Postgres extension. - @@ -351,7 +345,10 @@ CREATE PROCEDURAL LANGUAGE 'plsample' SQL92 + + CREATE LANGUAGE + is a Postgres extension. There is no CREATE LANGUAGE statement in SQL92. diff --git a/doc/src/sgml/ref/create_operator.sgml b/doc/src/sgml/ref/create_operator.sgml index b6bb748ce2..7f06c4cece 100644 --- a/doc/src/sgml/ref/create_operator.sgml +++ b/doc/src/sgml/ref/create_operator.sgml @@ -1,6 +1,11 @@ + + - + CREATE OPERATOR SQL - Language Statements @@ -15,21 +20,14 @@ - 1999-04-14 + 1999-07-20 -CREATE OPERATOR name ( - PROCEDURE = func_name - [, LEFTARG = type1 ] - [, RIGHTARG = type2 ] - [, COMMUTATOR = com_op ] - [, NEGATOR = neg_op ] - [, RESTRICT = res_proc ] - [, JOIN = join_proc ] - [, HASHES ] - [, SORT1 = left_sort_op ] - [, SORT2 = right_sort_op ] - ) +CREATE OPERATOR name ( PROCEDURE = func_name + [, LEFTARG = type1 ] [, RIGHTARG = type2 ] + [, COMMUTATOR = com_op ] [, NEGATOR = neg_op ] + [, RESTRICT = res_proc ] [, JOIN = join_proc ] + [, HASHES ] [, SORT1 = left_sort_op ] [, SORT2 = right_sort_op ] ) @@ -384,9 +382,6 @@ CREATE OPERATOR === ( Compatibility - - CREATE OPERATOR is a Postgres extension. - @@ -395,8 +390,12 @@ CREATE OPERATOR === ( SQL92 + - There is no CREATE OPERATOR statement in SQL92. + CREATE OPERATOR + is a Postgres extension. + There is no CREATE OPERATOR + statement in SQL92. diff --git a/doc/src/sgml/ref/create_rule.sgml b/doc/src/sgml/ref/create_rule.sgml index 829f584d5f..e81de58afd 100644 --- a/doc/src/sgml/ref/create_rule.sgml +++ b/doc/src/sgml/ref/create_rule.sgml @@ -1,6 +1,11 @@ + + - + CREATE RULE SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-09-11 + 1999-07-20 CREATE RULE name AS ON event @@ -117,6 +122,15 @@ CREATE Description + + + The Postgres + rule system allows one to define an + alternate action to be performed on updates, inserts, or deletions + from database tables or classes. Currently, rules are used to + implement table views. + + The semantics of a rule is that at the time an individual instance is accessed, updated, inserted or deleted, there is a current instance (for @@ -131,6 +145,7 @@ CREATE current.attribute-name and new.attribute-name. + The action part of the rule executes with the same command and transaction identifier as the user @@ -209,13 +224,32 @@ CREATE RULE bad_rule_combination_2 AS SELECT * FROM emp; - + You must have rule definition access to a class in order to define a rule on it. Use GRANT and REVOKE to change permissions. + + + The object in a SQL rule cannot be an array reference and + cannot have parameters. + + + + Aside from the "oid" field, system attributes cannot be + referenced anywhere in a rule. Among other things, this + means that functions of instances (e.g., foo(emp) where + emp is a class) cannot be called anywhere in a rule. + + + + The rule system stores the rule text and query plans as + text attributes. This implies that creation of rules may + fail if the rule plus its various internal representations + exceed some value that is on the order of one page (8KB). + @@ -284,36 +318,10 @@ CREATE RULE example_5 AS - - - Bugs - - - The object in a SQL rule cannot be an array reference and - cannot have parameters. - - - Aside from the "oid" field, system attributes cannot be - referenced anywhere in a rule. Among other things, this - means that functions of instances (e.g., "foo(emp)" where - "emp" is a class) cannot be called anywhere in a rule. - - - The rule system stores the rule text and query plans as - text attributes. This implies that creation of rules may - fail if the rule plus its various internal representations - exceed some value that is on the order of one page (8KB). - - - Compatibility - - CREATE RULE statement is a Postgres - language extension. - @@ -322,7 +330,10 @@ CREATE RULE example_5 AS SQL92 + + CREATE RULE statement is a Postgres + language extension. There is no CREATE RULE statement in SQL92. diff --git a/doc/src/sgml/ref/create_sequence.sgml b/doc/src/sgml/ref/create_sequence.sgml index 352c839f91..6f802346fd 100644 --- a/doc/src/sgml/ref/create_sequence.sgml +++ b/doc/src/sgml/ref/create_sequence.sgml @@ -1,6 +1,11 @@ + + - + CREATE SEQUENCE SQL - Language Statements @@ -15,16 +20,12 @@ - 1998-04-15 + 1999-07-20 -CREATE SEQUENCE seqname - [ INCREMENT increment ] - [ MINVALUE minvalue ] - [ MAXVALUE maxvalue ] - [ START start ] - [ CACHE cache ] - [ CYCLE ] +CREATE SEQUENCE seqname [ INCREMENT increment ] + [ MINVALUE minvalue ] [ MAXVALUE maxvalue ] + [ START start ] [ CACHE cache ] [ CYCLE ] @@ -45,6 +46,7 @@ CREATE SEQUENCE seqname + increment @@ -57,6 +59,7 @@ CREATE SEQUENCE seqname + minvalue @@ -69,6 +72,7 @@ CREATE SEQUENCE seqname + maxvalue @@ -81,6 +85,7 @@ CREATE SEQUENCE seqname + start @@ -96,6 +101,7 @@ CREATE SEQUENCE seqname + cache @@ -108,6 +114,7 @@ CREATE SEQUENCE seqname + CYCLE @@ -208,6 +215,7 @@ ERROR: DefineSequence: MINVALUE (minseqname. The generator will be "owned" by the user issuing the command. + After a sequence is created, you may use the function nextval(seqname) @@ -228,18 +236,24 @@ ERROR: DefineSequence: MINVALUE (min Use a query like + SELECT * FROM sequence_name; + to get the parameters of a sequence. + Aside from fetching the original parameters, you can use + SELECT last_value FROM sequence_name; + to obtain the last value allocated by any backend. parameters, you can use + Low-level locking is used to enable multiple simultaneous calls to a generator. @@ -332,10 +346,6 @@ END; Compatibility - - CREATE SEQUENCE is a Postgres - language extension. - @@ -344,7 +354,10 @@ END; SQL92 + + CREATE SEQUENCE is a Postgres + language extension. There is no CREATE SEQUENCE statement in SQL92. diff --git a/doc/src/sgml/ref/create_table.sgml b/doc/src/sgml/ref/create_table.sgml index 9e0732d729..9a25bc1b5e 100644 --- a/doc/src/sgml/ref/create_table.sgml +++ b/doc/src/sgml/ref/create_table.sgml @@ -1,6 +1,11 @@ + + - + CREATE TABLE SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-09-11 + 1999-07-20 CREATE [ TEMPORARY | TEMP ] TABLE table ( @@ -56,7 +61,7 @@ CREATE [ TEMPORARY | TEMP ] TABLE tabletable - The name of a new table to be created. + The name of a new class or table to be created. @@ -213,11 +218,49 @@ ERROR: DEFAULT: type mismatched Description + - CREATE TABLE will enter a new table into the current data - base. The table will be "owned" by the user issuing the + CREATE TABLE will enter a new class or table + into the current data base. The table will be "owned" by the user issuing the command. + + + Each type + may be a simple type, a complex type (set) or an array type. + Each attribute may be specified to be non-null and + each may have a default value, specified by the + . + + + + + + As of Postgres version 6.0, consistant array dimensions within an + attribute are not enforced. This will likely change in a future + release. + + + + + + The optional INHERITS + clause specifies a collection of class names from which this class + automatically inherits all fields. If any inherited field name + appears more than once, Postgres reports an error. Postgres automatically + allows the created class to inherit functions on classes above it in + the inheritance hierarchy. Inheritance of functions is done according + to the conventions of the Common Lisp Object System (CLOS). + + + + Each new table or class table + is automatically created as a type. Therefore, one or more instances + from the class are automatically a type and can be used in + + or other CREATE TABLE statements. + + The new table is created as a heap with no initial data. A table can have no more than 1600 columns (realistically, @@ -232,7 +275,7 @@ ERROR: DEFAULT: type mismatched 1998-09-11 - + <title id="R1-SQL-DEFAULTCLAUSE-1-TITLE"> DEFAULT Clause @@ -427,7 +470,7 @@ CREATE TABLE distributors ( 1998-09-11 - + <title id="R1-SQL-COLUMNCONSTRAINT-1-TITLE"> Column CONSTRAINT Clause @@ -446,6 +489,7 @@ CREATE TABLE distributors ( Inputs + name @@ -523,20 +567,34 @@ CREATE TABLE distributors ( Description + - A Constraint is a named rule: an SQL object which helps define + The optional constraint + clauses specify constraints or tests which new or updated entries + must satisfy for an insert or update operation to succeed. Each constraint + must evaluate to a boolean expression. Multiple attributes may be referenced within + a single constraint. The use of PRIMARY KEY + as a table constraint + is mutually incompatible with PRIMARY KEY as a column constraint. + + + + A constraint is a named rule: an SQL object which helps define valid sets of values by putting limits on the results of INSERT, UPDATE or DELETE operations performed on a Base Table. + There are two ways to define integrity constraints: table constraints, covered later, and column constraints, covered here. + A column constraint is an integrity constraint defined as part of a column definition, and logically becomes a table constraint as soon as it is created. The column constraints available are: + PRIMARY KEY REFERENCES diff --git a/doc/src/sgml/ref/create_table_as.sgml b/doc/src/sgml/ref/create_table_as.sgml index 27ce6df645..9ecac6b02b 100644 --- a/doc/src/sgml/ref/create_table_as.sgml +++ b/doc/src/sgml/ref/create_table_as.sgml @@ -1,6 +1,11 @@ - + + + - + CREATE TABLE AS SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-09-22 + 1999-07-20 CREATE TABLE table [ (column [, ...] ) ] @@ -87,8 +92,10 @@ CREATE TABLE table [ (column - CREATE TABLE AS enables a table to be created from the contents of - an existing table. It has functionality equivalent to SELECT TABLE INTO, + CREATE TABLE AS enables a table to be created + from the contents of an existing table. + It is functionality equivalent to + , but with perhaps a more direct syntax. diff --git a/doc/src/sgml/ref/create_trigger.sgml b/doc/src/sgml/ref/create_trigger.sgml index 32952a29ce..da116628cc 100644 --- a/doc/src/sgml/ref/create_trigger.sgml +++ b/doc/src/sgml/ref/create_trigger.sgml @@ -1,6 +1,11 @@ + + - + CREATE TRIGGER SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-09-21 + 1999-07-20 CREATE TRIGGER name { BEFORE | AFTER } { event [OR ...] } @@ -101,29 +106,37 @@ CREATE Description + CREATE TRIGGER will enter a new trigger into the current data base. The trigger will be associated with the relation relname and will execute the specified function funcname. + - The trigger can be specified to fire either before the + The trigger can be specified to fire either before BEFORE the operation is attempted on a tuple (before constraints - are checked and the INSERT, UPDATE or DELETE is attempted) or - after the operation has been attempted (e.g. after constraints - are checked and the INSERT, UPDATE or DELETE has completed). If the + are checked and the INSERT, UPDATE or + DELETE is attempted) or + AFTER the operation has been attempted (e.g. after constraints + are checked and the INSERT, + UPDATE or DELETE has + completed). If the trigger fires before the event, the trigger may skip the operation for the current tuple, or change the tuple - being inserted (for INSERT and UPDATE operations only). If + being inserted (for INSERT and + UPDATE operations only). If the trigger fires after the event, all changes, including the last insertion, update, or deletion, are "visible" to the trigger. + Refer to the chapters on SPI and Triggers in the -PostgreSQL Programmer's Guide for more + PostgreSQL Programmer's Guide for more information. + 1998-09-21 @@ -133,7 +146,7 @@ CREATE CREATE TRIGGER is a Postgres - language extension. + language extension. Only the relation owner may create a trigger on this relation. @@ -177,8 +190,6 @@ CREATE TRIGGER if_film_exists Compatibility - - @@ -187,6 +198,7 @@ CREATE TRIGGER if_film_exists SQL92 + There is no CREATE TRIGGER in SQL92. @@ -207,7 +219,7 @@ CREATE TABLE distributors ( - However, foreign keys are not yet implemented (as of version 6.4) in + However, foreign keys are not yet implemented (as of version 6.5) in Postgres. diff --git a/doc/src/sgml/ref/create_type.sgml b/doc/src/sgml/ref/create_type.sgml index 93f77c188a..91a8b7d15d 100644 --- a/doc/src/sgml/ref/create_type.sgml +++ b/doc/src/sgml/ref/create_type.sgml @@ -1,3 +1,8 @@ + + @@ -15,21 +20,15 @@ - 1998-09-21 + 1999-07-20 -CREATE TYPE typename ( - INPUT = input_function - , OUTPUT = output_function - , INTERNALLENGTH = (internallength | VARIABLE) - [ , EXTERNALLENGTH = (externallength | VARIABLE) ] - [ , ELEMENT = element ] - [ , DELIMITER = delimiter ] - [ , DEFAULT = "default" ] - [ , SEND = send_function ] - [ , RECEIVE = receive_function ] - [ , PASSEDBYVALUE ] -) +CREATE TYPE typename ( INPUT = input_function, OUTPUT = output_function + , INTERNALLENGTH = { internallength | VARIABLE } [ , EXTERNALLENGTH = { externallength | VARIABLE } ] + [ , DEFAULT = "default" ] + [ , ELEMENT = element ] [ , DELIMITER = delimiter ] + [ , SEND = send_function ] [ , RECEIVE = receive_function ] + [ , PASSEDBYVALUE ] ) @@ -50,8 +49,9 @@ CREATE TYPE typename ( + - INTERNALLENGTH internallength + internallength A literal value, which specifies the internal length of @@ -59,8 +59,9 @@ CREATE TYPE typename ( + - EXTERNALLENGTH externallength + externallength A literal value, which specifies the external length of @@ -68,18 +69,21 @@ CREATE TYPE typename ( + - INPUT input_function + input_function - The name of a function, created by CREATE FUNCTION, which + The name of a function, created by + CREATE FUNCTION, which converts data from its external form to the type's internal form. + - OUTPUT output_function + output_function The name of a function, created by CREATE FUNCTION, which @@ -88,6 +92,7 @@ CREATE TYPE typename ( + element @@ -97,6 +102,7 @@ CREATE TYPE typename ( + delimiter @@ -105,6 +111,7 @@ CREATE TYPE typename ( + default @@ -118,10 +125,9 @@ CREATE TYPE typename ( send_function - The name of a function, created by CREATE FUNCTION, which + The name of a function, created by CREATE FUNCTION, which converts data of this type into a form suitable for transmission to another machine. - Is this right? @@ -129,10 +135,9 @@ CREATE TYPE typename ( receive_function - The name of a function, created by CREATE FUNCTION, which + The name of a function, created by CREATE FUNCTION, which converts data of this type from a form suitable for transmission from another machine to internal form. - Is this right? @@ -172,6 +177,7 @@ CREATE Description + CREATE TYPE allows the user to register a new user data type with Postgres for use in the current data base. The @@ -180,6 +186,7 @@ CREATE the name of the new type and must be unique within the types defined for this database. + CREATE TYPE requires the registration of two functions (using create function) before defining the type. The @@ -193,6 +200,7 @@ CREATE the input and output functions must be declared to take one or two arguments of type "opaque". + New base data types can be fixed length, in which case internallength is a @@ -207,6 +215,7 @@ CREATE externallength keyword. + To indicate that a type is an array and to indicate that a type has array elements, indicate the type of the array @@ -214,6 +223,7 @@ CREATE an array of 4 byte integers ("int4"), specify ELEMENT = int4 + To indicate the delimiter to be used on arrays of this type, delimiter @@ -221,6 +231,7 @@ CREATE set to a specific character. The default delimiter is the comma (","). + A default value is optionally available in case a user wants some specific bit pattern to mean "data not present." @@ -228,8 +239,9 @@ CREATE How does the user specify that bit pattern and associate it with the fact that the data is not present> + - The optional functions + The optional arguments send_function and receive_function are used when the application program requesting Postgres @@ -246,6 +258,7 @@ CREATE characters do not have to be converted if passed from a Sun-4 to a DECstation, but many other types do. + The optional flag, , indicates that operators and functions which use this data type should be passed an @@ -253,6 +266,7 @@ CREATE may not pass by value types whose internal representation is more than four bytes. + For new base types, a user can define operators, functions and aggregates using the appropriate facilities described @@ -287,15 +301,16 @@ CREATE This command creates the box data type and then uses the type in a class definition: - - + CREATE TYPE box (INTERNALLENGTH = 8, INPUT = my_procedure_1, OUTPUT = my_procedure_2); CREATE TABLE myboxes (id INT4, description box); - + + + This command creates a variable length array type with - integer elements. + integer elements: CREATE TYPE int4array (INPUT = array_in, OUTPUT = array_out, @@ -303,6 +318,7 @@ CREATE TYPE int4array (INPUT = array_in, OUTPUT = array_out, CREATE TABLE myarrays (id int4, numbers int4array); + This command creates a large object type and uses it in a class definition: @@ -314,17 +330,6 @@ CREATE TABLE big_objs (id int4, obj bigobj); - - Restrictions - - Type names cannot begin with the underscore character - ("_") and can only be 31 characters long. This is because - Postgres silently creates an array type for each base type - with a name consisting of the base type's name prepended - with an underscore. - - - 1998-09-21 @@ -332,6 +337,15 @@ CREATE TABLE big_objs (id int4, obj bigobj); Notes + + + Type names cannot begin with the underscore character + ("_") and can only be 31 characters long. This is because + Postgres silently creates an array type for each base type + with a name consisting of the base type's name prepended + with an underscore. + + Refer to DROP TYPE to remove an existing type. diff --git a/doc/src/sgml/ref/create_user.sgml b/doc/src/sgml/ref/create_user.sgml index 73849962a0..2fb2c24eb1 100644 --- a/doc/src/sgml/ref/create_user.sgml +++ b/doc/src/sgml/ref/create_user.sgml @@ -1,3 +1,8 @@ + + @@ -15,13 +20,12 @@ - 1998-09-21 + 1999-07-20 CREATE USER username [ WITH PASSWORD password ] - [ CREATEDB | NOCREATEDB ] - [ CREATEUSER | NOCREATEUSER ] + [ CREATEDB | NOCREATEDB ] [ CREATEUSER | NOCREATEUSER ] [ IN GROUP groupname [, ...] ] [ VALID UNTIL 'abstime' ] @@ -34,6 +38,7 @@ CREATE USER username Inputs + username @@ -170,6 +175,7 @@ CREATE USER CREATE USER will add a new user to an instance of Postgres. + The new user will be given a usesysid of: @@ -270,8 +276,6 @@ CREATE USER manuel WITH PASSWORD jw8s0F4 CREATEDB Compatibility - - @@ -280,6 +284,7 @@ CREATE USER manuel WITH PASSWORD jw8s0F4 CREATEDB SQL92 + There is no CREATE USER statement in SQL92. diff --git a/doc/src/sgml/ref/create_view.sgml b/doc/src/sgml/ref/create_view.sgml index 5a0048f0d9..dbfdc5261a 100644 --- a/doc/src/sgml/ref/create_view.sgml +++ b/doc/src/sgml/ref/create_view.sgml @@ -1,6 +1,11 @@ + + - + CREATE VIEW SQL - Language Statements @@ -15,11 +20,10 @@ - 1998-09-21 + 1999-07-20 -CREATE VIEW view - AS SELECT query +CREATE VIEW view AS SELECT query @@ -30,6 +34,7 @@ CREATE VIEW view Inputs + view @@ -116,10 +121,10 @@ CREATE VIEW vista AS SELECT 'Hello World'::text Description - CREATE VIEW will define a view of a table. This view is - not physically materialized. Specifically, a query - rewrite retrieve rule is automatically generated - to support retrieve operations on views. + CREATE VIEW will define a view of a table or + class. This view is not physically materialized. Specifically, a query + rewrite retrieve rule is automatically generated to support + retrieve operations on views. @@ -129,21 +134,14 @@ CREATE VIEW vista AS SELECT 'Hello World'::text Notes - - Use the DROP VIEW statement to drop views. - - - - - 1998-09-21 - - - Bugs - Currently, views are read only. + + + Use the DROP VIEW statement to drop views. + @@ -174,8 +172,6 @@ C_701|There's a Girl in my Soup|107|1970-06-11|Comedy | 01:36 Compatibility - - @@ -210,6 +206,7 @@ CREATE VIEW view [ + LOCAL @@ -218,6 +215,7 @@ CREATE VIEW view [ + CASCADE diff --git a/doc/src/sgml/ref/createdb.sgml b/doc/src/sgml/ref/createdb.sgml index f9c8e21101..906e2dbf6e 100644 --- a/doc/src/sgml/ref/createdb.sgml +++ b/doc/src/sgml/ref/createdb.sgml @@ -1,6 +1,11 @@ + + - + createdb Application @@ -15,7 +20,7 @@ - 1998-10-02 + 1999-07-20 createdb [ dbname ] @@ -224,8 +229,7 @@ createdb: database creation failed on dbnamePGREALM environment variables will be passed on to psql - and processed as described in . + and processed as described in . diff --git a/doc/src/sgml/ref/createuser.sgml b/doc/src/sgml/ref/createuser.sgml index 0207b4f922..b6302506a1 100644 --- a/doc/src/sgml/ref/createuser.sgml +++ b/doc/src/sgml/ref/createuser.sgml @@ -1,6 +1,11 @@ + + - + createuser Application @@ -15,7 +20,7 @@ - 1998-10-02 + 1999-07-20 createuser [ username ] @@ -246,7 +251,8 @@ database access failed PGREALM environment variables will be passed on to psql - and processed as described in . + and processed as described in + . diff --git a/doc/src/sgml/ref/current_date.sgml b/doc/src/sgml/ref/current_date.sgml index 7d0e1ec881..b1aa4604d4 100644 --- a/doc/src/sgml/ref/current_date.sgml +++ b/doc/src/sgml/ref/current_date.sgml @@ -1,3 +1,13 @@ + + + + diff --git a/doc/src/sgml/ref/current_time.sgml b/doc/src/sgml/ref/current_time.sgml index be03cc0bcd..617b3dba91 100644 --- a/doc/src/sgml/ref/current_time.sgml +++ b/doc/src/sgml/ref/current_time.sgml @@ -1,3 +1,8 @@ + + diff --git a/doc/src/sgml/ref/current_timestamp.sgml b/doc/src/sgml/ref/current_timestamp.sgml index 35a84807c1..2343821802 100644 --- a/doc/src/sgml/ref/current_timestamp.sgml +++ b/doc/src/sgml/ref/current_timestamp.sgml @@ -1,3 +1,8 @@ + + diff --git a/doc/src/sgml/ref/current_user.sgml b/doc/src/sgml/ref/current_user.sgml index a70d7682b2..62a44986b3 100644 --- a/doc/src/sgml/ref/current_user.sgml +++ b/doc/src/sgml/ref/current_user.sgml @@ -1,3 +1,8 @@ + + diff --git a/doc/src/sgml/ref/declare.sgml b/doc/src/sgml/ref/declare.sgml index dab2d85542..26cd9da61b 100644 --- a/doc/src/sgml/ref/declare.sgml +++ b/doc/src/sgml/ref/declare.sgml @@ -1,6 +1,11 @@ + + - + DECLARE SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-09-04 + 1999-07-20 DECLARE cursor [ BINARY ] [ INSENSITIVE ] [ SCROLL ] @@ -181,27 +186,25 @@ ERROR: Named portals may only be used in begin/end transaction blocks Description - DECLARE allows a user to create cursors, which can be used to retrieve - a small number of rows at a time out of a larger query. Cursors can return - data either in text or in binary foramt. + DECLARE allows a user to create cursors, which + can be used to retrieve + a small number of rows at a time out of a larger query. Cursors can + return data either in text or in binary format using + . - Normal cursors return data in text format, either ASCII or another + Normal cursors return data in text format, either ASCII or another encoding scheme depending on how the Postgres backend was built. Since data is stored natively in binary format, the system must do a conversion to produce the text format. In addition, text formats are often larger in size than the corresponding binary format. Once the information comes back in text form, the client - application may have to convert it to a binary format to - manipulate it anyway. - - - + application may need to convert it to a binary format to + manipulate it. BINARY cursors give you back the data in the native binary - representation. So binary cursors will tend to be a - little faster since they suffer less conversion overhead. + representation. @@ -209,23 +212,26 @@ ERROR: Named portals may only be used in begin/end transaction blocks you would get a string of '1' with a default cursor whereas with a binary cursor you would get a 4-byte value equal to control-A ('^A'). - - - - BINARY cursors should be used carefully. User applications such - as psql are not aware of binary cursors - and expect data to come back in a text format. - - - However, string representation is architecture-neutral whereas binary - representation can differ between different machine architectures. + BINARY cursors should be used carefully. User applications such + as psql are not aware of binary cursors + and expect data to come back in a text format. + + + + String representation is architecture-neutral whereas binary + representation can differ between different machine architectures + and Postgres does not resolve + byte ordering or representation issues for binary cursors. Therefore, if your client machine and server machine use different representations (e.g. "big-endian" versus "little-endian"), you will probably not want your data returned in binary format. + However, binary cursors may be a + little more efficient since there is less conversion overhead in + the server to client data transfer. @@ -243,23 +249,26 @@ ERROR: Named portals may only be used in begin/end transaction blocks Notes - - Cursors are only available in transactions. - - - Postgres - does not have an explicit OPEN cursor - statement; a cursor is considered to be open when it is declared. - - - In SQL92 cursors are only available in - embedded applications. ecpg, the - embedded SQL preprocessor for Postgres, - supports the SQL92 conventions, including those - involving DECLARE and OPEN statements. - - + + Cursors are only available in transactions. Use to + , + + and + + to define a transaction block. + + + + In SQL92 cursors are only available in + embedded SQL (ESQL) applications. + The Postgres backend + does not implement an explicit OPEN cursor + statement; a cursor is considered to be open when it is declared. + However, ecpg, the + embedded SQL preprocessor for Postgres, + supports the SQL92 cursor conventions, including those + involving DECLARE and OPEN statements. @@ -282,8 +291,6 @@ DECLARE liahona CURSOR Compatibility - - diff --git a/doc/src/sgml/ref/delete.sgml b/doc/src/sgml/ref/delete.sgml index 38a7cd8111..230a8b687f 100644 --- a/doc/src/sgml/ref/delete.sgml +++ b/doc/src/sgml/ref/delete.sgml @@ -1,6 +1,11 @@ + + - + DELETE SQL - Language Statements @@ -16,7 +21,7 @@ - 1998-04-15 + 1999-07-20 DELETE FROM table [ WHERE condition ] @@ -93,15 +98,18 @@ DELETE count Description + DELETE removes rows which satisfy the WHERE clause from the specified table. + If the condition (WHERE clause) is absent, the effect is to delete all rows in the table. The result is a valid, but empty table. + You must have write access to the table in order to modify it, as well as read access to any table whose values are @@ -119,12 +127,14 @@ DELETE count DELETE FROM films WHERE kind <> 'Musical'; SELECT * FROM films; + code |title |did| date_prod|kind |len -----+-------------------------+---+----------+----------+------ UA501|West Side Story |105|1961-01-03|Musical | 02:32 TC901|The King and I |109|1956-08-11|Musical | 02:13 WD101|Bed Knobs and Broomsticks|111| |Musical | 01:57 (3 rows) + @@ -134,9 +144,11 @@ WD101|Bed Knobs and Broomsticks|111| |Musical | 01:57 DELETE FROM films; SELECT * FROM films; + code|title|did|date_prod|kind|len ----+-----+---+---------+----+--- (0 rows) + @@ -145,8 +157,6 @@ code|title|did|date_prod|kind|len Compatibility - - diff --git a/doc/src/sgml/ref/destroydb.sgml b/doc/src/sgml/ref/destroydb.sgml index 8cfd13d534..dab739c54f 100644 --- a/doc/src/sgml/ref/destroydb.sgml +++ b/doc/src/sgml/ref/destroydb.sgml @@ -1,6 +1,11 @@ + + - + destroydb Application @@ -15,7 +20,7 @@ - 1998-10-02 + 1999-07-20 destroydb [ dbname ] @@ -230,8 +235,7 @@ destroydb: database destroy failed on dbnamePGREALM environment variables will be passed on to psql - and processed as described in . + and processed as described in . diff --git a/doc/src/sgml/ref/destroyuser.sgml b/doc/src/sgml/ref/destroyuser.sgml index 697e4cc0cf..f500da36ee 100644 --- a/doc/src/sgml/ref/destroyuser.sgml +++ b/doc/src/sgml/ref/destroyuser.sgml @@ -1,6 +1,11 @@ + + - + destroyuser Application @@ -15,7 +20,7 @@ - 1998-10-02 + 1999-07-20 destroyuser [ username ] @@ -225,9 +230,9 @@ delete of user username was UNSUCCE PGREALM environment variables will be passed on to psql - and processed as described in . + and processed as described in . + Once invoked, destroyuser will warn you about the databases that will be destroyed in the diff --git a/doc/src/sgml/ref/drop_aggregate.sgml b/doc/src/sgml/ref/drop_aggregate.sgml index 3bdf67037f..5d091b8c99 100644 --- a/doc/src/sgml/ref/drop_aggregate.sgml +++ b/doc/src/sgml/ref/drop_aggregate.sgml @@ -1,6 +1,11 @@ + + - + DROP AGGREGATE SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-04-15 + 1999-07-20 DROP AGGREGATE name type @@ -109,14 +114,11 @@ WARN RemoveAggregate: aggregate 'agg Notes + - The DROP AGGREGATE statement is a - Postgres - language extension. - - - Refer to the CREATE AGGREGATE statement to - create aggregate functions. + Use + + to create aggregate functions. @@ -138,8 +140,6 @@ DROP AGGREGATE myavg int4; Compatibility - - @@ -148,8 +148,12 @@ DROP AGGREGATE myavg int4; SQL92 + - There is no DROP AGGREGATE statement in SQL92. + There is no DROP AGGREGATE statement + in SQL92; the statement is a + Postgres + language extension. diff --git a/doc/src/sgml/ref/drop_database.sgml b/doc/src/sgml/ref/drop_database.sgml index d53d83efe6..a60cd7f5f6 100644 --- a/doc/src/sgml/ref/drop_database.sgml +++ b/doc/src/sgml/ref/drop_database.sgml @@ -1,6 +1,11 @@ + + - + DROP DATABASE SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-04-15 + 1999-07-20 DROP DATABASE name @@ -110,21 +115,17 @@ WARN: destroydb: database "name" do - DROP DATABASE statement is a Postgres - language extension. - - - - This query cannot be executed while connected to the target - database. It is usually preferable to use the - destroydb script instead. - - + This query cannot be executed while connected to the target + database. It is usually preferable to use + + instead. - Refer to the CREATE DATABASE statement for - information on how to create a database. + Refer to + and + + for information on how to create a database. @@ -133,8 +134,6 @@ WARN: destroydb: database "name" do Compatibility - - @@ -143,8 +142,11 @@ WARN: destroydb: database "name" do SQL92 + - There is no DROP DATABASE in SQL92. + DROP DATABASE statement is a + Postgres language extension; + there is no such command in SQL92. diff --git a/doc/src/sgml/ref/drop_function.sgml b/doc/src/sgml/ref/drop_function.sgml index bf6e778c37..888929e928 100644 --- a/doc/src/sgml/ref/drop_function.sgml +++ b/doc/src/sgml/ref/drop_function.sgml @@ -1,6 +1,11 @@ + + - + DROP FUNCTION SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-04-15 + 1999-07-20 DROP FUNCTION name ( [ type [, ...] ] ) @@ -108,9 +113,16 @@ WARN RemoveFunction: Function "name Notes + - Refer to CREATE FUNCTION - to create aggregate functions. + Refer to + + for information on creating aggregate functions. + + + + No checks are made to ensure that types, operators or access + methods that rely on the function have been removed first. @@ -119,6 +131,7 @@ WARN RemoveFunction: Function "name Usage + This command removes the square root function: @@ -128,25 +141,26 @@ DROP FUNCTION sqrt(int4); - - - Bugs - - - No checks are made to ensure that types, operators or access - methods that rely on the function have been removed first. - - - Compatibility - - DROP FUNCTION is a Postgres language extension. - + + 1999-07-20 + + + SQL92 + + + + DROP FUNCTION + is a Postgres language extension. + + + + 1998-04-15 @@ -156,9 +170,10 @@ DROP FUNCTION sqrt(int4); SQL/PSM is a proposed standard to enable function extensibility. The SQL/PSM DROP FUNCTION statement has the following syntax: - + + DROP [ SPECIFIC ] FUNCTION name { RESTRICT | CASCADE } - + diff --git a/doc/src/sgml/ref/drop_index.sgml b/doc/src/sgml/ref/drop_index.sgml index 54d6f12a8d..22b7ce2c96 100644 --- a/doc/src/sgml/ref/drop_index.sgml +++ b/doc/src/sgml/ref/drop_index.sgml @@ -1,6 +1,11 @@ + + - + DROP INDEX SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-04-15 + 1999-07-20 DROP INDEX index_name @@ -102,8 +107,9 @@ ERROR: index "index_name" nonexiste language extension. - Refer to the CREATE INDEX statement for - information on how to create indexes. + Refer to + + for information on how to create indexes. @@ -125,8 +131,6 @@ ERROR: index "index_name" nonexiste Compatibility - - diff --git a/doc/src/sgml/ref/drop_language.sgml b/doc/src/sgml/ref/drop_language.sgml index 425cc9efce..a0764724d0 100644 --- a/doc/src/sgml/ref/drop_language.sgml +++ b/doc/src/sgml/ref/drop_language.sgml @@ -1,6 +1,11 @@ + + - + DROP LANGUAGE SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-04-15 + 1999-07-20 DROP PROCEDURAL LANGUAGE 'name' @@ -104,18 +109,11 @@ ERROR: Language "name" doesn't exis a Postgres language extension. - Refer to CREATE PROCEDURAL LANGUAGE + Refer to + for information on how to create procedural languages. - - - - - 1998-04-15 - - - Bugs - + No checks are made if functions or trigger procedures registered in this language still exist. To re-enable them without having @@ -143,8 +141,6 @@ DROP PROCEDURAL LANGUAGE 'plsample'; Compatibility - - diff --git a/doc/src/sgml/ref/drop_operator.sgml b/doc/src/sgml/ref/drop_operator.sgml index d70324edc7..e97c74fe47 100644 --- a/doc/src/sgml/ref/drop_operator.sgml +++ b/doc/src/sgml/ref/drop_operator.sgml @@ -1,6 +1,11 @@ + + - + DROP OPERATOR SQL - Language Statements @@ -16,7 +21,7 @@ - 1998-09-22 + 1999-07-20 DROP OPERATOR id ( type | NONE [,...] ) @@ -138,8 +143,9 @@ ERROR: RemoveOperator: right unary operator 'ope language extension. - Refer to CREATE OPERATOR for - information on how to create operators. + Refer to + + for information on how to create operators. It is the user's responsibility to remove any access methods and @@ -178,8 +184,6 @@ DROP OPERATOR ! (int4, none); Compatibility - - diff --git a/doc/src/sgml/ref/drop_rule.sgml b/doc/src/sgml/ref/drop_rule.sgml index 8634c33fcc..cb14be418c 100644 --- a/doc/src/sgml/ref/drop_rule.sgml +++ b/doc/src/sgml/ref/drop_rule.sgml @@ -1,6 +1,11 @@ + + - + DROP RULE SQL - Language Statements @@ -103,19 +108,12 @@ ERROR: RewriteGetRuleEventRel: rule "namePostgres language extension. + Refer to CREATE RULE for information on how to create rules. - - - - 1998-09-22 - - - Bugs - Once a rule is dropped, access to historical information the rule has written may disappear. @@ -140,9 +138,7 @@ DROP RULE newrule; Compatibility - - - + 1998-09-22 diff --git a/doc/src/sgml/ref/drop_sequence.sgml b/doc/src/sgml/ref/drop_sequence.sgml index 1367369374..a6c39c1b6f 100644 --- a/doc/src/sgml/ref/drop_sequence.sgml +++ b/doc/src/sgml/ref/drop_sequence.sgml @@ -1,6 +1,11 @@ + + - + DROP SEQUENCE SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-09-22 + 1999-07-20 DROP SEQUENCE name [, ...] @@ -127,8 +132,6 @@ DROP SEQUENCE serial; Compatibility - - diff --git a/doc/src/sgml/ref/drop_table.sgml b/doc/src/sgml/ref/drop_table.sgml index 5f979f5227..5c90c18b1f 100644 --- a/doc/src/sgml/ref/drop_table.sgml +++ b/doc/src/sgml/ref/drop_table.sgml @@ -1,6 +1,11 @@ + + - + DROP TABLE SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-09-22 + 1999-07-20 DROP TABLE name [, ...] @@ -127,8 +132,6 @@ DROP TABLE films, distributors; Compatibility - - diff --git a/doc/src/sgml/ref/drop_trigger.sgml b/doc/src/sgml/ref/drop_trigger.sgml index 333b8b9e90..beb5f20263 100644 --- a/doc/src/sgml/ref/drop_trigger.sgml +++ b/doc/src/sgml/ref/drop_trigger.sgml @@ -1,6 +1,11 @@ + + - + DROP TRIGGER SQL - Language Statements @@ -135,8 +140,6 @@ DROP TRIGGER if_dist_exists ON films; Compatibility - - diff --git a/doc/src/sgml/ref/drop_type.sgml b/doc/src/sgml/ref/drop_type.sgml index 94745bb963..35e1d1d391 100644 --- a/doc/src/sgml/ref/drop_type.sgml +++ b/doc/src/sgml/ref/drop_type.sgml @@ -1,6 +1,11 @@ + + - + DROP TYPE SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-09-22 + 1999-07-20 DROP TYPE typename @@ -111,15 +116,7 @@ ERROR: RemoveType: type 'typename' functions, aggregates, access methods, subtypes, and classes that use a deleted type. - - - - 1998-09-22 - - - Bugs - If a built-in type is removed, the behavior of the backend is unpredictable. @@ -144,8 +141,6 @@ DROP TYPE box; Compatibility - - @@ -155,7 +150,7 @@ DROP TYPE box; SQL3 - DROP TYPE is a SQL3 statement. + DROP TYPE is a SQL3 statement. diff --git a/doc/src/sgml/ref/drop_user.sgml b/doc/src/sgml/ref/drop_user.sgml index c9a32f4f82..8f594b8314 100644 --- a/doc/src/sgml/ref/drop_user.sgml +++ b/doc/src/sgml/ref/drop_user.sgml @@ -1,6 +1,11 @@ + + - + DROP USER SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-09-22 + 1999-07-20 DROP USER name @@ -129,8 +134,6 @@ DROP USER Jonathan; Compatibility - - diff --git a/doc/src/sgml/ref/drop_view.sgml b/doc/src/sgml/ref/drop_view.sgml index 32e5c34e20..7d08cbf485 100644 --- a/doc/src/sgml/ref/drop_view.sgml +++ b/doc/src/sgml/ref/drop_view.sgml @@ -1,6 +1,11 @@ + + - + DROP VIEW SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-09-22 + 1999-07-20 DROP VIEW name @@ -126,8 +131,6 @@ DROP VIEW kinds; Compatibility - - diff --git a/doc/src/sgml/ref/ecpg-ref.sgml b/doc/src/sgml/ref/ecpg-ref.sgml new file mode 100644 index 0000000000..04f86d57fe --- /dev/null +++ b/doc/src/sgml/ref/ecpg-ref.sgml @@ -0,0 +1,367 @@ + + + + + + ecpg + + Application + + + + ecpg + + + Embedded SQL C preprocessor + + + + + 1999-07-20 + + +ecpg [ -v ] [ -t ] [ -I include-path ] [ -o outfile ] file1 [ file2 ] [ ... ] + + + + + 1999-07-20 + + + Inputs + + + ecpg accepts the following command + line arguments: + + + + file + + + + + + + + + + + + 1998-11-05 + + + Outputs + + + ecpg will create a file or + write to stdout. + + + + + + + + + + + + + + + + + + 1998-11-05 + + + Description + + + + + + + + + diff --git a/doc/src/sgml/ref/end.sgml b/doc/src/sgml/ref/end.sgml new file mode 100644 index 0000000000..0b5f6ce41b --- /dev/null +++ b/doc/src/sgml/ref/end.sgml @@ -0,0 +1,170 @@ + + + + + + END + + SQL - Language Statements + + + + END + + + Commits the current transaction + + + + + + 1999-07-20 + + +END [ WORK | TRANSACTION ] + + + + + 1998-09-08 + + + Inputs + + + + + + WORK + TRANSACTION + + + Optional keywords. They have no effect. + + + + + + + + + + 1998-09-08 + + + Outputs + + + + + + +END + + + + Message returned if the transaction is successfully committed. + + + + + +NOTICE EndTransactionBlock and not inprogress/abort state + + + + If there is no transaction in progress. + + + + + + + + + + + 1998-09-08 + + + Description + + + + END is a Postgres + synonym for + . + + + + + 1998-09-08 + + + Notes + + + The keywords WORK and TRANSACTION are noise and can be omitted. + + + + Use + to abort a transaction. + + + + + + + Usage + + + To make all changes permanent: + + +END WORK; + + + + + + + Compatibility + + + + + 1998-09-08 + + + SQL92 + + + + END is a Postgres + extension which provides functionality equivalent to + . + + + + + + diff --git a/doc/src/sgml/ref/explain.sgml b/doc/src/sgml/ref/explain.sgml index 7f57112570..cc73bcf7ff 100644 --- a/doc/src/sgml/ref/explain.sgml +++ b/doc/src/sgml/ref/explain.sgml @@ -1,6 +1,11 @@ + + - + EXPLAIN SQL - Language Statements @@ -16,7 +21,7 @@ - 1998-09-01 + 1999-07-20 EXPLAIN [ VERBOSE ] query @@ -95,6 +100,7 @@ EXPLAIN Description + This command outputs details about the supplied query. The default output is the computed query cost. @@ -127,16 +133,54 @@ EXPLAIN Usage + - To show a query plan for a simple query: + To show a query plan for a simple query on a table with a single + int4 column and 128 rows: -EXPLAIN select * from foo; +EXPLAIN SELECT * FROM foo; + NOTICE: QUERY PLAN: -Seq Scan on foo (cost=0.00 rows=0 width=4) +Seq Scan on foo (cost=5.22 rows=128 width=4) EXPLAIN + + + + + + For the same table with an index to support an + equijoin condition on the query, + EXPLAIN will show a different plan: + + +EXPLAIN SELECT * FROM foo WHERE i = 4; + +NOTICE: QUERY PLAN: + +Index Scan using fi on foo (cost=2.05 rows=1 width=4) + +EXPLAIN + + + + + + And finally, for the same table with an index to support an + equijoin condition on the query, + EXPLAIN will show the following for a query + using an aggregate function: + + +EXPLAIN SELECT sum(i) FROM foo WHERE i = 4; + +NOTICE: QUERY PLAN: + +Aggregate (cost=2.05 rows=1 width=4) + -> Index Scan using fi on foo (cost=2.05 rows=1 width=4) + @@ -145,8 +189,6 @@ EXPLAIN Compatibility - - diff --git a/doc/src/sgml/ref/fetch.sgml b/doc/src/sgml/ref/fetch.sgml index bd384fabed..db072d9f5f 100644 --- a/doc/src/sgml/ref/fetch.sgml +++ b/doc/src/sgml/ref/fetch.sgml @@ -1,6 +1,11 @@ + + - + FETCH SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-09-01 + 1999-07-20 FETCH [ selector ] [ count ] { IN | FROM } cursor @@ -212,8 +217,9 @@ FETCH RELATIVE 0 FROM cursor Description + - FETCH allows a user to retrieve rows using a cursor. + FETCH allows a user to retrieve rows using a cursor. The number of rows retrieved is specified by #. If the number of rows remaining in the cursor is less @@ -226,38 +232,13 @@ FETCH RELATIVE 0 FROM cursor - Negative numbers are now allowed to be specified for the + Negative numbers are allowed to be specified for the row count. A negative number is equivalent to reversing the sense of the FORWARD and BACKWARD keywords. For example, FORWARD -1 is the same as BACKWARD 1. - - Note that the FORWARD and BACKWARD keywords are - Postgres extensions. - The SQL92 syntax is also supported, specified - in the second form of the command. See below for details - on compatibility issues. - - - Once all rows are fetched, every other fetch access returns - no rows. - - - - Updating data in a cursor is not supported by - Postgres, - because mapping cursor updates back to base tables is - not generally possible, as is also the case with VIEW updates. - Consequently, - users must issue explicit UPDATE commands to replace data. - - - - Cursors may only be used inside of transactions because - the data that they store spans multiple user queries. - @@ -266,11 +247,45 @@ FETCH RELATIVE 0 FROM cursor Notes + - Use MOVE to change cursor position. - DECLARE will define a cursor. - Refer to BEGIN, COMMIT, and - ROLLBACK + Note that the FORWARD and BACKWARD keywords are + Postgres extensions. + The SQL92 syntax is also supported, specified + in the second form of the command. See below for details + on compatibility issues. + + + + Once all rows are fetched, every other fetch access returns + no rows. + + + + Updating data in a cursor is not supported by + Postgres, + because mapping cursor updates back to base tables is + not generally possible, as is also the case with VIEW updates. + Consequently, + users must issue explicit UPDATE commands to replace data. + + + + Cursors may only be used inside of transactions because + the data that they store spans multiple user queries. + + + + Use + + to change cursor position. + + will define a cursor. + Refer to + , + , + and + for further information about transactions. @@ -280,7 +295,10 @@ FETCH RELATIVE 0 FROM cursor Usage + + The following examples traverses a table using a cursor. + --set up and use a cursor: -- @@ -292,6 +310,7 @@ FETCH RELATIVE 0 FROM cursor -- FETCH FORWARD 5 IN liahona; + code |title |did| date_prod|kind |len -----+-----------------------+---+----------+----------+------ BL101|The Third Man |101|1949-12-23|Drama | 01:44 @@ -299,15 +318,17 @@ FETCH RELATIVE 0 FROM cursor JL201|Une Femme est une Femme|102|1961-03-12|Romantic | 01:25 P_301|Vertigo |103|1958-11-14|Action | 02:08 P_302|Becket |103|1964-02-03|Drama | 02:28 - + --Fetch previous row: -- FETCH BACKWARD 1 IN liahona; + code |title |did| date_prod|kind |len -----+-----------------------+---+----------+----------+------ P_301|Vertigo |103|1958-11-14|Action | 02:08 + -- close the cursor and commit work: -- @@ -321,11 +342,6 @@ FETCH RELATIVE 0 FROM cursor Compatibility - - The non-embedded use of cursors is a Postgres - extension. The syntax and usage of cursors is being compared - against the embedded form of cursors defined in SQL92. - @@ -334,6 +350,17 @@ FETCH RELATIVE 0 FROM cursor SQL92 + + + + + The non-embedded use of cursors is a Postgres + extension. The syntax and usage of cursors is being compared + against the embedded form of cursors defined in SQL92. + + + + SQL92 allows absolute positioning of the cursor for FETCH, and allows placing the results into explicit variables. diff --git a/doc/src/sgml/ref/grant.sgml b/doc/src/sgml/ref/grant.sgml index 395f90061d..ff7f1529bc 100644 --- a/doc/src/sgml/ref/grant.sgml +++ b/doc/src/sgml/ref/grant.sgml @@ -1,6 +1,11 @@ + + - + GRANT SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-09-23 + 1999-07-20 GRANT privilege [, ...] ON object [, ...] @@ -216,6 +221,7 @@ ERROR: ChangeAcl: class "object" n Description + GRANT allows the creator of an object to give specific permissions to all users (PUBLIC) or to a certain user or group. @@ -274,6 +280,7 @@ ERROR: ChangeAcl: class "object" n Currently, to create a GROUP you have to insert data manually into table pg_group as: + INSERT INTO pg_group VALUES ('todos'); CREATE USER miriam IN GROUP todos; @@ -313,8 +320,6 @@ GRANT ALL ON kinds TO manuel; Compatibility - - diff --git a/doc/src/sgml/ref/initdb.sgml b/doc/src/sgml/ref/initdb.sgml index f8702f2779..200c030ed4 100644 --- a/doc/src/sgml/ref/initdb.sgml +++ b/doc/src/sgml/ref/initdb.sgml @@ -1,6 +1,11 @@ + + - + initdb Application @@ -15,7 +20,7 @@ - 1998-10-02 + 1999-07-20 initdb [ --pgdata=dbdir | -r dbdir ] diff --git a/doc/src/sgml/ref/initlocation.sgml b/doc/src/sgml/ref/initlocation.sgml index 5d47009843..edbc6613ed 100644 --- a/doc/src/sgml/ref/initlocation.sgml +++ b/doc/src/sgml/ref/initlocation.sgml @@ -1,6 +1,11 @@ + + - + initlocation Application @@ -15,7 +20,7 @@ - 1998-10-02 + 1999-07-20 initlocation [ --location=er">alble> | -D altdir ] diff --git a/doc/src/sgml/ref/insert.sgml b/doc/src/sgml/ref/insert.sgml index 2860f89e1e..933a04f26a 100644 --- a/doc/src/sgml/ref/insert.sgml +++ b/doc/src/sgml/ref/insert.sgml @@ -1,6 +1,11 @@ + + - + INSERT SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-09-23 + 1999-07-20 INSERT INTO table [ ( column [, ...] ) ] @@ -118,16 +123,27 @@ INSERT 0 # Description + - INSERT allows one to insert new rows into a table. One can insert + INSERT allows one to insert new rows into a + class or table. One can insert a single row at time or several rows as a result of a query. The columns in the target list may be listed in any order. - In every column not present in the target list will be inserted - the default value, if column has not a declared default value - it will be assumed as NULL. If the expression for each column + + + + Each column not present in the target list will be inserted + using a default value, either a declared DEFAULT value + or NULL. Postgres will reject the new + column if a NULL is inserted into a column declared NOT NULL. + + + + If the expression for each column is not of the correct data type, automatic type coercion will be attempted. + You must have insert privilege to a table in order to append to it, as well as select privilege on any table specified @@ -177,7 +193,8 @@ INSERT INTO films SELECT * FROM tmp; - Insert into arrays (refer to The PostgreSQL User's Guide for further + Insert into arrays (refer to + The PostgreSQL User's Guide for further information about arrays): @@ -197,8 +214,6 @@ INSERT INTO tictactoe (game, board) Compatibility - - @@ -211,7 +226,8 @@ INSERT INTO tictactoe (game, board) INSERT is fully compatible with SQL92. Possible limitations in features of the query - clause are documented for the SELECT statement. + clause are documented for + . diff --git a/doc/src/sgml/ref/ipcclean.sgml b/doc/src/sgml/ref/ipcclean.sgml new file mode 100644 index 0000000000..6063c33293 --- /dev/null +++ b/doc/src/sgml/ref/ipcclean.sgml @@ -0,0 +1,117 @@ + + + + + + ipcclean + + Application + + + + ipcclean + + + Clean up shared memory and semaphores from aborted backends + + + + + 1999-07-20 + + +ipcclean + + + + + 1999-07-20 + + + Inputs + + + None. + + + + + + 1999-07-30 + + + Outputs + + + None. + + + + + + + 1999-07-20 + + + Description + + + ipcclean + cleans up shared memory and semaphore space from aborted backends by + deleting all instances owned by user postgres. + Only the DBA + should execute this program as it can cause bizarre behavior (i.e., + crashes) if run during multi-user execution. This program should be + executed if messages such as + + +semget: No space left on device + + + are encountered when starting up the + postmaster or the backend server. + + + + If this command is executed while postmaster + is running, the shared memory and semaphores allocated by the + postmaster + will be deleted. This will result in a general failure of the + backends servers started by that + postmaster. + + + + This script is a hack, but in the many years since it was written, no + one has come up with an equally effective and portable solution. + Suggestions are welcome. + + + + The script makes assumption about the format of output of the + ipcs + utility which may not be true across different operating systems. + Therefore, it may not work on your particular OS. + + + + + diff --git a/doc/src/sgml/ref/listen.sgml b/doc/src/sgml/ref/listen.sgml index 1cb5d259f1..b03ea67808 100644 --- a/doc/src/sgml/ref/listen.sgml +++ b/doc/src/sgml/ref/listen.sgml @@ -1,6 +1,11 @@ + + - + LISTEN SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-10-07 + 1999-07-20 LISTEN name @@ -85,11 +90,14 @@ NOTICE Async_Listen: We are already listening on Description + - LISTEN registers the current Postgres backend as a + LISTEN registers the current + Postgres backend as a listener on the notify condition name. + Whenever the command NOTIFY name @@ -99,11 +107,13 @@ NOTICE Async_Listen: We are already listening on frontend application. See the discussion of NOTIFY for more information. + A backend can be unregistered for a given notify condition with the UNLISTEN command. Also, a backend's listen registrations are automatically cleared when the backend process exits. + The method a frontend application must use to detect notify events depends on which Postgres application programming interface it @@ -116,8 +126,10 @@ NOTICE Async_Listen: We are already listening on LISTEN or UNLISTEN directly. See the documentation for the library you are using for more details. + - The reference page for NOTIFY contains a more extensive + + contains a more extensive discussion of the use of LISTEN and NOTIFY. @@ -129,6 +141,7 @@ NOTICE Async_Listen: We are already listening on Notes + name can be any string valid as a name; diff --git a/doc/src/sgml/ref/load.sgml b/doc/src/sgml/ref/load.sgml index 77a154c7c4..8fb5fafdb8 100644 --- a/doc/src/sgml/ref/load.sgml +++ b/doc/src/sgml/ref/load.sgml @@ -1,6 +1,11 @@ + + - + LOAD SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-09-24 + 1999-07-20 LOAD 'filename' @@ -86,12 +91,14 @@ ERROR: LOAD: could not open file 'filename Description + Loads an object (or ".o") file into the Postgres backend address space. Once a file is loaded, all functions in that file can be accessed. This function is used in support of user-defined types and functions. + If a file is not loaded using LOAD, @@ -102,6 +109,7 @@ ERROR: LOAD: could not open file 'filename + 1998-09-24 @@ -109,6 +117,7 @@ ERROR: LOAD: could not open file 'filename Notes + Functions in loaded object files should not call functions in other object files loaded through the @@ -157,8 +166,6 @@ LOAD '/usr/postgres/demo/circle.o' Compatibility - - diff --git a/doc/src/sgml/ref/lock.sgml b/doc/src/sgml/ref/lock.sgml index 9147f6a085..79d558da12 100644 --- a/doc/src/sgml/ref/lock.sgml +++ b/doc/src/sgml/ref/lock.sgml @@ -1,6 +1,11 @@ + + - + LOCK SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-09-24 + 1999-07-20 LOCK [ TABLE ] table @@ -356,8 +361,6 @@ COMMIT WORK; Compatibility - - @@ -369,7 +372,7 @@ COMMIT WORK; There is no LOCK TABLE in SQL92, which instead uses SET TRANSACTION to specify - concurrency level on transactions. We support that too; see + concurrency levels on transactions. We support that too; see for details. diff --git a/doc/src/sgml/ref/move.sgml b/doc/src/sgml/ref/move.sgml index fdac32aca4..eeb74bd9aa 100644 --- a/doc/src/sgml/ref/move.sgml +++ b/doc/src/sgml/ref/move.sgml @@ -1,6 +1,11 @@ + + - + MOVE SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-09-24 + 1999-07-20 MOVE [ selector ] [ count ] @@ -39,7 +44,9 @@ MOVE [ selector ] [ - Refer to the FETCH command for details on syntax and usage. + Refer to + + for details on syntax and usage. @@ -49,16 +56,24 @@ MOVE [ selector ] [ Notes + MOVE is a Postgres language extension. + - Refer to FETCH for a description - of valid arguments. - Refer to DECLARE to declare a cursor. - Refer to BEGIN WORK, COMMIT WORK, - ROLLBACK WORK statements + Refer to + + for a description of valid arguments. + Refer to + + to define a cursor. + Refer to + , + , + and + for further information about transactions. @@ -100,8 +115,6 @@ COMMIT WORK; Compatibility - - @@ -111,10 +124,10 @@ COMMIT WORK; SQL92 - There is no SQL92 MOVE statement. + There is no SQL92 MOVE statement. Instead, SQL92 allows one to FETCH rows from an absolute cursor position, - implicitly moving the cursor to the correct place. + implicitly moving the cursor to the correct position. diff --git a/doc/src/sgml/ref/notify.sgml b/doc/src/sgml/ref/notify.sgml index bf35a5c403..91dc5f4a10 100644 --- a/doc/src/sgml/ref/notify.sgml +++ b/doc/src/sgml/ref/notify.sgml @@ -1,6 +1,11 @@ + + - + NOTIFY SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-10-07 + 1999-07-20 NOTIFY name @@ -215,8 +220,6 @@ ASYNC NOTIFY of 'virtual' from backend pid '11239' received Compatibility - - diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml index f96d278b4b..a11a366b43 100644 --- a/doc/src/sgml/ref/pg_dump.sgml +++ b/doc/src/sgml/ref/pg_dump.sgml @@ -1,6 +1,11 @@ - + + + - + pg_dump Application @@ -15,7 +20,7 @@ - 1998-11-05 + 1999-07-20 pg_dump [ dbname ] diff --git a/doc/src/sgml/ref/pg_dumpall.sgml b/doc/src/sgml/ref/pg_dumpall.sgml index f06d430e69..b604ed6c55 100644 --- a/doc/src/sgml/ref/pg_dumpall.sgml +++ b/doc/src/sgml/ref/pg_dumpall.sgml @@ -1,6 +1,11 @@ - + + + - + pg_dumpall Application @@ -15,7 +20,7 @@ - 1998-10-04 + 1999-07-20 pg_dumpall @@ -256,7 +261,7 @@ dumpSequence(table): SELECT failed Refer to - + for more information on this capability. diff --git a/doc/src/sgml/ref/pg_passwd.sgml b/doc/src/sgml/ref/pg_passwd.sgml new file mode 100644 index 0000000000..19d776abc9 --- /dev/null +++ b/doc/src/sgml/ref/pg_passwd.sgml @@ -0,0 +1,170 @@ + + + + + + pg_passwd + + Application + + + + pg_passwd + + + Manipulate the flat password file + + + + + 1999-07-20 + + +pg_passwd filename + + + + + + 1999-07-20 + + + Description + + + pg_passwd + is a tool to manipulate the + flat password file functionality of + Postgres. This style of password + authentication is not required in an + installation, but is one of several supported security mechanisms. + + + + Specify the password file in the same style of + Ident authentication in + $PGDATA/pg_hba.conf: + + +host unv 133.65.96.250 255.255.255.255 password passwd + + + where the above line allows access from 133.65.96.250 using the passwords listed + in $PGDATA/passwd. + The format of the password file follows those of + /etc/passwd + and + /etc/shadow. + The first field is the user name, and the second field + is the encrypted password. + The rest is completely ignored. + Thus the following three sample lines specify the same user and password pair: + + +pg_guest:/nB7.w5Auq.BY:10031:::::: +pg_guest:/nB7.w5Auq.BY:93001:930::/home/guest:/bin/tcsh +pg_guest:/nB7.w5Auq.BY:93001 + + + + + Supply the password file to the pg_passwd command. + In the case described above, after changing the working directory to + PGDATA, the following command execution specify + the new password for pg_guest: + + + % pg_passwd passwd + Username: pg_guest + Password: + Re-enter password: + + + where the Password: + and Re-enter password: + prompts require the same password input which are not displayed + on the terminal. + The original password file is renamed to + passwd.bk. + + + + psql + uses the + option to invoke this style of + authentication. + + + + The following lines show the sample usage of the option: + + +% psql -h hyalos -u unv +Username: pg_guest +Password: +Welcome to the POSTGRESQL interactive sql monitor: + Please read the file COPYRIGHT for copyright terms of POSTGRESQL + type \? for help on slash commands + type \q to quit + type \g or terminate with semicolon to execute query + You are currently connected to the database: unv +unv=> + + + + + Perl5 authentication + uses the new style of the Pg.pm like this: + + +$conn = Pg::connectdb("host=hyalos dbname=unv + user=pg_guest password=xxxxxxx"); + + + For more details, refer to + src/interfaces/perl5/Pg.pm. + + + + Pg{tcl,tk}sh authentication + uses the + pg_connect + command with the + + option thusly: + + +% set conn [pg_connect -conninfo \\ + "host=hyalos dbname=unv \\ + user=pg_guest password=xxxxxxx "] + + + You can list all of the keys for the option by executing the following + command: + + +% puts [ pg_conndefaults] + + + + + + diff --git a/doc/src/sgml/ref/pg_upgrade.sgml b/doc/src/sgml/ref/pg_upgrade.sgml index 46ad32c7a9..78f67cb9a4 100644 --- a/doc/src/sgml/ref/pg_upgrade.sgml +++ b/doc/src/sgml/ref/pg_upgrade.sgml @@ -1,6 +1,11 @@ + + - + pg_upgrade Application @@ -12,9 +17,10 @@ Allows upgrade from a previous release without reloading data + - 1998-10-04 + 1999-07-20 pg_upgrade @@ -29,10 +35,14 @@ pg_upgrade [ -f filename ] Description + pg_upgrade is a utility for upgrading from a previous PostgreSQL release without reloading all the data. + Not all Postgres releases can be handled + this way; check the release notes for details on your installation. + Upgrading <productname>Postgres</productname> @@ -107,6 +117,8 @@ pg_upgrade [ -f filename ] data.old/ directory when you are finished. + + diff --git a/doc/src/sgml/ref/pgaccess-ref.sgml b/doc/src/sgml/ref/pgaccess-ref.sgml index 2f7b94d8f2..469f8100f5 100644 --- a/doc/src/sgml/ref/pgaccess-ref.sgml +++ b/doc/src/sgml/ref/pgaccess-ref.sgml @@ -1,3 +1,8 @@ + + diff --git a/doc/src/sgml/ref/pgadmin-ref.sgml b/doc/src/sgml/ref/pgadmin-ref.sgml index b605505d61..1ffd705673 100644 --- a/doc/src/sgml/ref/pgadmin-ref.sgml +++ b/doc/src/sgml/ref/pgadmin-ref.sgml @@ -1,3 +1,8 @@ + + diff --git a/doc/src/sgml/ref/postgres-ref.sgml b/doc/src/sgml/ref/postgres-ref.sgml index 57775152f8..add30e27e4 100644 --- a/doc/src/sgml/ref/postgres-ref.sgml +++ b/doc/src/sgml/ref/postgres-ref.sgml @@ -1,6 +1,11 @@ + + - + postgres Application @@ -15,7 +20,7 @@ - 1999-05-19 + 1999-07-20 postgres [ dbname ] diff --git a/doc/src/sgml/ref/postmaster.sgml b/doc/src/sgml/ref/postmaster.sgml index 33081915f2..7b249d17e2 100644 --- a/doc/src/sgml/ref/postmaster.sgml +++ b/doc/src/sgml/ref/postmaster.sgml @@ -1,6 +1,11 @@ + + - + postmaster Application @@ -15,7 +20,7 @@ - 1999-05-19 + 1999-07-20 postmaster [ -B nBuffers ] [ -D DataDir ] [ -i ] diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index 22c3f96fb0..7d148873fe 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -1,6 +1,11 @@ + + - + psql Application @@ -15,7 +20,7 @@ - 1998-09-26 + 1999-07-20 psql [ dbname ] diff --git a/doc/src/sgml/ref/reset.sgml b/doc/src/sgml/ref/reset.sgml index 9b1452816b..3630fcc54b 100644 --- a/doc/src/sgml/ref/reset.sgml +++ b/doc/src/sgml/ref/reset.sgml @@ -1,6 +1,11 @@ + + - + RESET SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-09-24 + 1999-07-20 RESET variable @@ -34,7 +39,9 @@ RESET variable variable - Refer to the SET statement for more information on available + Refer to + + for more information on available variables. @@ -80,10 +87,14 @@ RESET VARIABLE RESET restores variables to the default values. - Refer to the SET command for details on - allowed values and defaults. + Refer to + + for details on allowed values and defaults. RESET is an alternate form for - SET variable = DEFAULT + + +SET variable = DEFAULT + @@ -93,12 +104,17 @@ RESET VARIABLE Notes + - The RESET statement is a Postgres + RESET is a Postgres language extension. + - Refer to SET/SHOW statements to set/show variable values. + Use to + and + + to manipulate variable values. diff --git a/doc/src/sgml/ref/revoke.sgml b/doc/src/sgml/ref/revoke.sgml index c267651a65..b769a815cf 100644 --- a/doc/src/sgml/ref/revoke.sgml +++ b/doc/src/sgml/ref/revoke.sgml @@ -1,6 +1,11 @@ + + - + REVOKE SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-09-24 + 1999-07-20 REVOKE privilege [, ...] @@ -84,7 +89,8 @@ REVOKE privilege [, ...] Privilege to define rules on table/view. - (See CREATE RULE). + (See + ). @@ -297,6 +303,7 @@ REVOKE ALL ON kinds FROM manuel; SQL92 + The SQL92 syntax for REVOKE has additional capabilities for rescinding @@ -316,7 +323,9 @@ REVOKE { INSERT | UPDATE | REFERENCES } [, ...] [ ( + for details on individual fields. @@ -333,8 +342,9 @@ REVOKE GRANT OPTION FOR privilege [ Rescinds authority for a user to grant the specified privilege to others. - Refer to the GRANT command for details - on individual fields. + Refer to + + for details on individual fields. diff --git a/doc/src/sgml/ref/rollback.sgml b/doc/src/sgml/ref/rollback.sgml index 2ad271e246..17832debd1 100644 --- a/doc/src/sgml/ref/rollback.sgml +++ b/doc/src/sgml/ref/rollback.sgml @@ -1,3 +1,8 @@ + + @@ -15,7 +20,7 @@ - 1998-09-24 + 1999-07-20 ROLLBACK [ WORK | TRANSACTION ] @@ -97,6 +102,8 @@ ABORT Use to successfully terminate a transaction. + is a + synonym for ROLLBACK. @@ -118,8 +125,6 @@ ROLLBACK WORK; Compatibility - - diff --git a/doc/src/sgml/ref/select.sgml b/doc/src/sgml/ref/select.sgml index 9e9d7d7ed1..0e17cc1c8b 100644 --- a/doc/src/sgml/ref/select.sgml +++ b/doc/src/sgml/ref/select.sgml @@ -1,3 +1,8 @@ + + @@ -14,7 +19,7 @@ - 1998-09-24 + 1999-07-20 SELECT [ ALL | DISTINCT [ ON column ] ] @@ -264,16 +269,31 @@ SELECT [ ALL | DISTINCT [ ON column WHERE Clause + The optional WHERE condition has the general form: -WHERE expr ETER">ce"PARreplaceable> [ log_op ... ] +WHERE boolean_expr - where cond_op can be - one of: =, <, <=, >, >= or <>, - a conditional operator like ALL, ANY, IN, LIKE, et cetera or a + boolean_expr + can consist of any expression which evaluates to a boolean value. + In many cases, this expression will be + + + expr cond_op expr + + + or + + + log_op expr + + + where cond_op + can be one of: =, <, <=, >, >= or <>, + a conditional operator like ALL, ANY, IN, LIKE, or a locally-defined operator, and log_op can be one of: AND, OR, NOT. @@ -624,8 +644,6 @@ Woody Allen Compatibility - - diff --git a/doc/src/sgml/ref/select_into.sgml b/doc/src/sgml/ref/select_into.sgml index a75d5a028b..6617d07e5a 100644 --- a/doc/src/sgml/ref/select_into.sgml +++ b/doc/src/sgml/ref/select_into.sgml @@ -1,6 +1,11 @@ + + - + SELECT INTO SQL - Language Statements @@ -14,7 +19,7 @@ - 1998-09-22 + 1999-07-20 SELECT [ ALL | DISTINCT ] expression [ AS name ] [, ...] @@ -70,7 +75,8 @@ SELECT [ ALL | DISTINCT ] expression - CREATE TABLE AS is functionally equivalent to the SELECT INTO command. + + is functionally equivalent to the SELECT INTO command. diff --git a/doc/src/sgml/ref/set.sgml b/doc/src/sgml/ref/set.sgml index 39aa7c6ea0..5117757064 100644 --- a/doc/src/sgml/ref/set.sgml +++ b/doc/src/sgml/ref/set.sgml @@ -1,12 +1,17 @@ + + - + SET SQL - Language Statements - + SET @@ -15,7 +20,7 @@ - 1998-09-24 + 1999-07-20 SET variable { TO | = } { 'value' | DEFAULT } @@ -662,8 +667,6 @@ SELECT CURRENT_TIMESTAMP AS today; Compatibility - - diff --git a/doc/src/sgml/ref/show.sgml b/doc/src/sgml/ref/show.sgml index e19a8cf0e8..14b43d8234 100644 --- a/doc/src/sgml/ref/show.sgml +++ b/doc/src/sgml/ref/show.sgml @@ -1,6 +1,11 @@ + + - + SHOW SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-09-24 + 1999-07-20 SHOW keyword @@ -157,8 +162,6 @@ NOTICE:GEQO is ON Compatibility - - diff --git a/doc/src/sgml/ref/unlisten.sgml b/doc/src/sgml/ref/unlisten.sgml index 51e5c0c93a..d872dd98a0 100644 --- a/doc/src/sgml/ref/unlisten.sgml +++ b/doc/src/sgml/ref/unlisten.sgml @@ -1,3 +1,8 @@ + + @@ -95,7 +100,7 @@ UNLISTEN { notifyname | * } - + contains a more extensive discussion of the use of LISTEN and NOTIFY. diff --git a/doc/src/sgml/ref/update.sgml b/doc/src/sgml/ref/update.sgml index 7383e7de68..8808f9e799 100644 --- a/doc/src/sgml/ref/update.sgml +++ b/doc/src/sgml/ref/update.sgml @@ -1,6 +1,11 @@ + + - + UPDATE SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-09-24 + 1999-07-20 UPDATE table SET R">colle> = expression [, ...] @@ -119,11 +124,12 @@ UPDATE # UPDATE changes the values of the columns specified for all rows which satisfy condition. Only the columns - to be modified need appear as column. + to be modified need appear as columns in the statement. - Array references use the same syntax found in SELECT. + Array references use the same syntax found in + . That is, either single array elements, a range of array elements or the entire array may be replaced with a single query. @@ -165,8 +171,6 @@ SELECT * FROM films WHERE kind = 'Dramatic' OR kind = 'Drama'; Compatibility - - @@ -176,7 +180,8 @@ SELECT * FROM films WHERE kind = 'Dramatic' OR kind = 'Drama'; SQL92 - SQL92 defines a different syntax for positioned UPDATE statement: + SQL92 defines a different syntax for + the positioned UPDATE statement: UPDATE table SET column = expression [, ...] diff --git a/doc/src/sgml/ref/vacuum.sgml b/doc/src/sgml/ref/vacuum.sgml index 2e9a3fe653..87666f4727 100644 --- a/doc/src/sgml/ref/vacuum.sgml +++ b/doc/src/sgml/ref/vacuum.sgml @@ -1,6 +1,11 @@ - + + + - + VACUUM SQL - Language Statements @@ -15,7 +20,7 @@ - 1998-10-04 + 1999-07-20 VACUUM [ VERBOSE ] [ ANALYZE ] [ table ] @@ -225,6 +230,7 @@ VACUUM Compatibility + 1998-10-04 @@ -233,7 +239,7 @@ VACUUM SQL92 - There is no VACUUM statement in SQL92. + There is no VACUUM statement in SQL92. diff --git a/doc/src/sgml/ref/vacuumdb.sgml b/doc/src/sgml/ref/vacuumdb.sgml index 55774395e3..1bff5bb1c0 100644 --- a/doc/src/sgml/ref/vacuumdb.sgml +++ b/doc/src/sgml/ref/vacuumdb.sgml @@ -1,6 +1,11 @@ + + - + vacuumdb Application @@ -225,7 +230,7 @@ FATAL 1: SetUserId: user 'username - See for more details. + See for more details.