diff --git a/doc/src/sgml/ref/alter_group.sgml b/doc/src/sgml/ref/alter_group.sgml index b9819f4a52..31e94d76ef 100644 --- a/doc/src/sgml/ref/alter_group.sgml +++ b/doc/src/sgml/ref/alter_group.sgml @@ -1,5 +1,5 @@ @@ -45,7 +45,7 @@ ALTER GROUP groupname RENAME TO - Parameter + Parameters diff --git a/doc/src/sgml/ref/alter_language.sgml b/doc/src/sgml/ref/alter_language.sgml index 61595252eb..b0374a2c49 100644 --- a/doc/src/sgml/ref/alter_language.sgml +++ b/doc/src/sgml/ref/alter_language.sgml @@ -1,5 +1,5 @@ @@ -35,7 +35,7 @@ ALTER LANGUAGE name RENAME TO newname - Parameter + Parameters diff --git a/doc/src/sgml/ref/alter_schema.sgml b/doc/src/sgml/ref/alter_schema.sgml index 473b57314d..6f61cc5672 100644 --- a/doc/src/sgml/ref/alter_schema.sgml +++ b/doc/src/sgml/ref/alter_schema.sgml @@ -1,5 +1,5 @@ @@ -36,7 +36,7 @@ ALTER SCHEMA name RENAME TO newname - Parameter + Parameters diff --git a/doc/src/sgml/ref/cluster.sgml b/doc/src/sgml/ref/cluster.sgml index 1eaa97e2e1..54efd0c4be 100644 --- a/doc/src/sgml/ref/cluster.sgml +++ b/doc/src/sgml/ref/cluster.sgml @@ -1,5 +1,5 @@ @@ -74,7 +74,7 @@ CLUSTER - Parameter + Parameters diff --git a/doc/src/sgml/ref/clusterdb.sgml b/doc/src/sgml/ref/clusterdb.sgml index 8d4e082ec0..7be6d0959d 100644 --- a/doc/src/sgml/ref/clusterdb.sgml +++ b/doc/src/sgml/ref/clusterdb.sgml @@ -1,5 +1,5 @@ @@ -48,16 +48,17 @@ PostgreSQL documentation clusterdb is a wrapper around the SQL command . There is no effective difference between clustering databases via - this or other methods. The database server must be running at the - targeted host. Also, any default settings and environment - variables used by the libpq front-end - library will apply. + this utility and via other methods for accessing the server. In case of difficulty, see and for discussions of potential problems and error messages. + The database server must be running at the + targeted host. Also, any default connection settings and environment + variables used by the libpq front-end + library will apply. diff --git a/doc/src/sgml/ref/commit.sgml b/doc/src/sgml/ref/commit.sgml index 1c72ea0b45..4b026ccfd5 100644 --- a/doc/src/sgml/ref/commit.sgml +++ b/doc/src/sgml/ref/commit.sgml @@ -1,5 +1,5 @@ @@ -12,8 +12,8 @@ PostgreSQL documentation COMMIT commit the current transaction - - + + COMMIT @@ -74,7 +74,7 @@ COMMIT; - + Compatibility diff --git a/doc/src/sgml/ref/create_database.sgml b/doc/src/sgml/ref/create_database.sgml index ddde0df334..9441c9841b 100644 --- a/doc/src/sgml/ref/create_database.sgml +++ b/doc/src/sgml/ref/create_database.sgml @@ -1,5 +1,5 @@ @@ -36,6 +36,12 @@ CREATE DATABASE name PostgreSQL database. + + To create a database, you must be a superuser or have the special + CREATEDB privilege. + See . + + Normally, the creator becomes the owner of the new database. Superusers can create databases owned by other users using the @@ -63,6 +69,8 @@ CREATE DATABASE name a leading slash (e.g., /usr/local/pgsql/data), are allowed as well. + In either case, the final path name must be absolute and must not + contain any single quotes. @@ -86,7 +94,7 @@ CREATE DATABASE name - Parameter + Parameters @@ -146,80 +154,22 @@ CREATE DATABASE name - - Diagnostics - - - - CREATE DATABASE - - - Message returned if the database was successfully created. - - - - - - ERROR: user 'username' is not allowed to create/drop databases - - - You must have the special CREATEDB privilege to create databases. - See . - - - - - - - ERROR: createdb: database "name" already exists - - - This occurs if a database with the specified name already - exists. - - - - - - ERROR: database path may not contain single quotes - - - The database location - dbpath cannot contain - single quotes. This is required so that the shell commands that - create the database directory can execute safely. - - - - - - ERROR: CREATE DATABASE: may not be called in a transaction block - - - If you have an explicit transaction block in progress you cannot call - CREATE DATABASE. You must finish the transaction first. - - - - - - ERROR: Unable to create database directory 'path'. - ERROR: Could not initialize database directory. - - - These are most likely related to insufficient permissions on the data - directory, a full disk, or other file system problems. The user under - which the database server is running must have access to the location. - - - - - - - Notes + + CREATE DATABASE cannot be executed inside a transaction + block. + + + + Errors along the line of could not initialize database directory + are most likely related to insufficient permissions on the data + directory, a full disk, or other file system problems. When using an + alternate location, the user under + which the database server is running must have access to the location. + + Use to remove a database. @@ -231,7 +181,8 @@ CREATE DATABASE name There are security issues involved with using alternate database - locations specified with absolute path names. See for more information. diff --git a/doc/src/sgml/ref/create_sequence.sgml b/doc/src/sgml/ref/create_sequence.sgml index 5a9210fbcd..089695b1bb 100644 --- a/doc/src/sgml/ref/create_sequence.sgml +++ b/doc/src/sgml/ref/create_sequence.sgml @@ -1,5 +1,5 @@ @@ -196,49 +196,6 @@ SELECT * FROM seqname; - - Diagnostics - - - - CREATE SEQUENCE - - - Message returned if the sequence was successfully created. - - - - - - ERROR: Relation 'seqname' already exists - - - A sequence, table, view, or index of the specified name already exists. - - - - - - ERROR: DefineSequence: MINVALUE (start) can't be >= MAXVALUE (max) - ERROR: DefineSequence: START value (start) can't be < MINVALUE (min) - - - The specified starting value is out of range. - - - - - - ERROR: DefineSequence: MINVALUE (min) can't be >= MAXVALUE (max) - - - The minimum and maximum values are inconsistent. - - - - - - Notes diff --git a/doc/src/sgml/ref/create_view.sgml b/doc/src/sgml/ref/create_view.sgml index 6bf9434a1b..a8d4a20f09 100644 --- a/doc/src/sgml/ref/create_view.sgml +++ b/doc/src/sgml/ref/create_view.sgml @@ -1,5 +1,5 @@ @@ -90,39 +90,6 @@ class="PARAMETER">column_name [, ...] ) ] AS column' has an unknown type - - - The view will be created having a column with an unknown type if - you do not specify it. For example, the following command gives - this warning: - -CREATE VIEW vista AS SELECT 'Hello World' - - whereas this command does not: - -CREATE VIEW vista AS SELECT text 'Hello World' - - - - - - - Notes @@ -137,6 +104,20 @@ CREATE VIEW vista AS SELECT text 'Hello World' Use the DROP VIEW statement to drop views. + + + Be careful that the names and types of the view's columns will be + assigned the way you want. For example, + +CREATE VIEW vista AS SELECT 'Hello World'; + + is bad form in two ways: the column name defaults to ?column?, + and the column datatype defaults to unknown. If you want a + string literal in a view's result, use something like + +CREATE VIEW vista AS SELECT text 'Hello World' AS hello; + + diff --git a/doc/src/sgml/ref/createdb.sgml b/doc/src/sgml/ref/createdb.sgml index 0af10c0584..1c7e0ec4af 100644 --- a/doc/src/sgml/ref/createdb.sgml +++ b/doc/src/sgml/ref/createdb.sgml @@ -1,5 +1,5 @@ @@ -48,12 +48,21 @@ PostgreSQL documentation createdb is a wrapper around the SQL command . The database server must be - running on the targeted host. There is nothing special about creating - databases via this or other methods. Also, any default settings and - environment variables used by the libpq - front-end library will apply. + endterm="SQL-CREATEDATABASE-title">. + There is no effective difference between creating databases via + this utility and via other methods for accessing the server. + + + In case of difficulty, see and for + discussions of potential problems and error messages. + The database server must be running at the + targeted host. Also, any default connection settings and environment + variables used by the libpq front-end + library will apply. + + @@ -212,45 +221,6 @@ PostgreSQL documentation - - Diagnostics - - - - CREATE DATABASE - - The database was successfully created. - - - - - createdb: Database creation failed. - - (Says it all.) - - - - - createdb: Comment creation failed. (Database was created.) - - - The comment/description for the database could not be created. - The database itself will have been created already. You can use the - SQL command COMMENT ON DATABASE to - create the comment later on. - - - - - - - If there is an error condition, the backend error message will be displayed. - See - for possibilities. - - - - Environment diff --git a/doc/src/sgml/ref/createuser.sgml b/doc/src/sgml/ref/createuser.sgml index 0e6935f536..484f7fbe11 100644 --- a/doc/src/sgml/ref/createuser.sgml +++ b/doc/src/sgml/ref/createuser.sgml @@ -1,5 +1,5 @@ @@ -49,17 +49,19 @@ PostgreSQL documentation createuser is a wrapper around the SQL command . The database server must be - running on the targeted host. There is nothing special - about creating users via this or other methods. Also, any - default settings and environment variables used by the - libpq front-end library will apply. + endterm="SQL-CREATEUSER-title">. + There is no effective difference between creating users via + this utility and via other methods for accessing the server. - Passwords can only be added later or changed using the - SQL command . + In case of difficulty, see and for + discussions of potential problems and error messages. + The database server must be running at the + targeted host. Also, any default connection settings and environment + variables used by the libpq front-end + library will apply. @@ -101,6 +103,7 @@ PostgreSQL documentation The new user is not allowed to create other users (i.e., the new user is a regular user, not a superuser). + This is the default. @@ -121,6 +124,7 @@ PostgreSQL documentation The new user is not allowed to create databases. + This is the default. @@ -142,7 +146,7 @@ PostgreSQL documentation Encrypts the user's password stored in the database. If not - specified, the default is used. + specified, the default password behavior is used. @@ -164,7 +168,7 @@ PostgreSQL documentation Does not encrypt the user's password stored in the database. If - not specified, the default is used. + not specified, the default password behavior is used. @@ -272,38 +276,6 @@ PostgreSQL documentation - - Diagnostics - - - - CREATE USER - - - The user was successfully created. - - - - - - createuser: creation of user "username" failed - - - Something went wrong. The user was not created. - - - - - - - - If there is an error condition, the backend error message will be displayed. - See - for possibilities. - - - - Examples diff --git a/doc/src/sgml/ref/declare.sgml b/doc/src/sgml/ref/declare.sgml index 1a3e3ccaff..a1884b5ee0 100644 --- a/doc/src/sgml/ref/declare.sgml +++ b/doc/src/sgml/ref/declare.sgml @@ -1,5 +1,5 @@ @@ -44,9 +44,10 @@ DECLARE cursorname [ BINARY ] [ INS format. Once the information comes back in text form, the client application may need to convert it to a binary format to manipulate it. In addition, data in the text format is often larger in size - than in the binary format. Binary cursors return the data in the - native binary representation. Nevertheless, if you intend to - display the data as text anyway, retrieving it in text form will + than in the binary format. Binary cursors return the data in a + binary representation that may be more easily manipulated. + Nevertheless, if you intend to display the data as text anyway, + retrieving it in text form will save you some effort on the client side. @@ -54,7 +55,8 @@ DECLARE cursorname [ BINARY ] [ INS As an example, if a query returns a value of one from an integer column, you would get a string of 1 with a default cursor whereas with a binary cursor you would get - a 4-byte value containing the internal representation of the value. + a 4-byte field containing the internal representation of the value + (in big-endian byte order). @@ -64,16 +66,16 @@ DECLARE cursorname [ BINARY ] [ INS format. - - The string representation is architecture-neutral whereas binary - representation can differ between different machine architectures. - PostgreSQL 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. - + + + When the client application uses the extended query protocol + to issue a FETCH command, the Bind protocol message + specifies whether data is to be retrieved in text or binary format. + This choice overrides the way that the cursor is defined. The concept + of a binary cursor as such is thus obsolete when using extended query + protocol --- any cursor can be treated as either text or binary. + + @@ -84,8 +86,7 @@ DECLARE cursorname [ BINARY ] [ INS cursorname - The name of the cursor to be used in subsequent - FETCH operations. + The name of the cursor to be created. @@ -192,48 +193,18 @@ DECLARE cursorname [ BINARY ] [ INS - - Diagnostics - - - - DECLARE CURSOR - - - The message returned if the cursor was successfully defined. - - - - - - ERROR: cursor "cursorname" already exists - - - This error occurs if a cursor with the same name already exists. - - - - - - ERROR: DECLARE CURSOR may only be used in begin/end transaction blocks - - - This error occurs if the cursor is not declared within a - transaction block, and WITH HOLD is not - specified. - - - - - - Notes - If WITH HOLD is not specified, the cursor + Unless WITH HOLD is specified, the cursor created by this command can only be used within the current - transaction. Use + transaction. Thus, DECLARE without WITH + HOLD is useless outside a transaction block: the cursor would + survive only to the completion of the statement. Therefore + PostgreSQL reports an error if this + command is used outside a transaction block. + Use , and diff --git a/doc/src/sgml/ref/delete.sgml b/doc/src/sgml/ref/delete.sgml index fea6a268ab..c0a58bd7ff 100644 --- a/doc/src/sgml/ref/delete.sgml +++ b/doc/src/sgml/ref/delete.sgml @@ -1,5 +1,5 @@ @@ -52,7 +52,7 @@ DELETE FROM [ ONLY ] table [ WHERE You must have the DELETE privilege on the table to delete from it, as well as the SELECT - privilege to any table whose values are read in the condition. @@ -84,22 +84,20 @@ DELETE FROM [ ONLY ] table [ WHERE - Diagnostics + Outputs - - - DELETE count - - - Message returned if rows are successfully deleted. The - count is the number - of rows deleted. If count is 0, no rows were - deleted. - - - - + + On successful completion, a DELETE command returns a command + tag of the form + +DELETE count + + The count is the number + of rows deleted. If count is + 0, no rows matched the condition (this is not considered + an error). + diff --git a/doc/src/sgml/ref/drop_database.sgml b/doc/src/sgml/ref/drop_database.sgml index 1224b4142e..afb26d6a49 100644 --- a/doc/src/sgml/ref/drop_database.sgml +++ b/doc/src/sgml/ref/drop_database.sgml @@ -1,5 +1,5 @@ @@ -31,6 +31,9 @@ DROP DATABASE name DROP DATABASE drops a database. It removes the catalog entries for the database and deletes the directory containing the data. It can only be executed by the database owner. + Also, it cannot be executed while you or anyone else are connected + to the target database. (Connect to template1 or any + other database to issue this command.) @@ -53,44 +56,14 @@ DROP DATABASE name - - Diagnostics - - - - DROP DATABASE - - - This message is returned if the command was successful. - - - - - - DROP DATABASE: cannot be executed on the currently open database - - - You cannot be connected to the database you are about to remove. - Instead, connect to template1 or any other - database and run this command again. - - - - - - DROP DATABASE: may not be called in a transaction block - - - You must finish the transaction in progress before you can call this command. - - - - - - Notes + + DROP DATABASE cannot be executed inside a transaction + block. + + This command cannot be executed while connected to the target database. Thus, it might be more convenient to use the program diff --git a/doc/src/sgml/ref/drop_user.sgml b/doc/src/sgml/ref/drop_user.sgml index 143efbca9b..b125c23a8e 100644 --- a/doc/src/sgml/ref/drop_user.sgml +++ b/doc/src/sgml/ref/drop_user.sgml @@ -1,5 +1,5 @@ @@ -49,39 +49,6 @@ DROP USER name - - Diagnostics - - - - DROP USER - - - Message returned if the user was successfully deleted. - - - - - - ERROR: DROP USER: user "name" does not exist - - - Message returned if the specified user does not exist. - - - - - - DROP USER: user "name" owns database "name", cannot be removed - - - You must drop the database first or change its ownership. - - - - - - Notes @@ -91,6 +58,11 @@ DROP USER name same functionality as this command (in fact, it calls this command) but can be run from the command shell. + + + To drop a user who owns a database, first drop the database or change + its ownership. + diff --git a/doc/src/sgml/ref/dropdb.sgml b/doc/src/sgml/ref/dropdb.sgml index 725eaf8991..e1c28fe293 100644 --- a/doc/src/sgml/ref/dropdb.sgml +++ b/doc/src/sgml/ref/dropdb.sgml @@ -1,5 +1,5 @@ @@ -41,12 +41,21 @@ PostgreSQL documentation dropdb is a wrapper around the SQL command . The database server must be - running on the targeted host. There is nothing special - about dropping databases via this or other methods. Also, any - default settings and environment variables used by the - libpq front-end library will apply. + endterm="SQL-DROPDATABASE-title">. + There is no effective difference between dropping databases via + this utility and via other methods for accessing the server. + + + In case of difficulty, see and for + discussions of potential problems and error messages. + The database server must be running at the + targeted host. Also, any default connection settings and environment + variables used by the libpq front-end + library will apply. + + @@ -100,7 +109,7 @@ PostgreSQL documentation - createdb also accepts the following + dropdb also accepts the following command-line arguments for connection parameters: @@ -153,33 +162,6 @@ PostgreSQL documentation - - Diagnostics - - - - DROP DATABASE - - The database was successfully removed. - - - - - dropdb: Database removal failed. - - Something didn't work out. - - - - - - If there is an error condition, the backend error message will be displayed. - See - for possibilities. - - - - Environment diff --git a/doc/src/sgml/ref/dropuser.sgml b/doc/src/sgml/ref/dropuser.sgml index 27d67f9ba8..5c26050db9 100644 --- a/doc/src/sgml/ref/dropuser.sgml +++ b/doc/src/sgml/ref/dropuser.sgml @@ -1,5 +1,5 @@ @@ -43,12 +43,21 @@ PostgreSQL documentation dropuser is a wrapper around the SQL command . The database server must be running - on the targeted host. There is nothing special about removing - users via this or other methods. Also, any default settings and - environment variables used by the libpq - front-end library will apply. + endterm="SQL-DROPUSER-title">. + There is no effective difference between dropping users via + this utility and via other methods for accessing the server. + + + In case of difficulty, see and for + discussions of potential problems and error messages. + The database server must be running at the + targeted host. Also, any default connection settings and environment + variables used by the libpq front-end + library will apply. + + @@ -103,7 +112,7 @@ PostgreSQL documentation - createuser also accepts the following + dropuser also accepts the following command-line arguments for connection parameters: @@ -176,38 +185,6 @@ PostgreSQL documentation - - Diagnostics - - - - DROP USER - - - The user was successfully removed. - - - - - - dropuser: deletion of user "username" failed - - - Something went wrong. The user was not removed. - - - - - - - - If there is an error condition, the backend error message will be displayed. - See - and for possibilities. - - - - Examples diff --git a/doc/src/sgml/ref/end.sgml b/doc/src/sgml/ref/end.sgml index 7772184ae8..115d25f005 100644 --- a/doc/src/sgml/ref/end.sgml +++ b/doc/src/sgml/ref/end.sgml @@ -1,5 +1,5 @@ @@ -30,9 +30,10 @@ END [ WORK | TRANSACTION ] END commits the current transaction. All changes made by the transaction become visible to others and are guaranteed - to be durable if a crash occurs. It is a - PostgreSQL extension that is equivalent - to . + to be durable if a crash occurs. This command is a + PostgreSQL extension + that is equivalent to . @@ -51,31 +52,7 @@ END [ WORK | TRANSACTION ] - - - Diagnostics - - - COMMIT - - - Message returned if the transaction was successfully committed. - - - - - - WARNING: COMMIT: no transaction in progress - - - Message if there is no transaction in progress. - - - - - - Notes @@ -83,6 +60,11 @@ END [ WORK | TRANSACTION ] Use to abort a transaction. + + + Issuing END when not inside a transaction does + no harm, but it will provoke a warning message. + @@ -106,6 +88,16 @@ END; specified in the SQL standard. + + + See Also + + + + + + + @@ -80,7 +80,7 @@ ROLLBACK; - Parameter + Parameters diff --git a/doc/src/sgml/ref/fetch.sgml b/doc/src/sgml/ref/fetch.sgml index 9c1050b835..5f3639d4c7 100644 --- a/doc/src/sgml/ref/fetch.sgml +++ b/doc/src/sgml/ref/fetch.sgml @@ -1,5 +1,5 @@ @@ -45,7 +45,7 @@ where direction can be empty or one Description - FETCH retrieves rows using a cursor. + FETCH retrieves rows using a previously-created cursor. @@ -280,6 +280,23 @@ where direction can be empty or one + + Outputs + + + On successful completion, a FETCH command returns a command + tag of the form + +FETCH count + + The count is the number + of rows fetched (possibly zero). Note that in + psql, the command tag will not actually be + displayed, since psql displays the fetched + rows instead. + + + Notes diff --git a/doc/src/sgml/ref/insert.sgml b/doc/src/sgml/ref/insert.sgml index 76160d6dbe..40ecaccdaf 100644 --- a/doc/src/sgml/ref/insert.sgml +++ b/doc/src/sgml/ref/insert.sgml @@ -1,5 +1,5 @@ @@ -119,30 +119,21 @@ INSERT INTO table [ ( - Diagnostics + Outputs - - - INSERT oid 1 - - - Message returned if only one row was inserted. - oid is the - OID of the inserted row. - - - - - - INSERT 0 count - - - Message returned if more than one rows were inserted. - count is the number of rows inserted. - - - - + + On successful completion, an INSERT command returns a command + tag of the form + +INSERT oid count + + The count is the number + of rows inserted. If count + is exactly one, and the target table has OIDs, then + oid is the + OID assigned to the inserted row. Otherwise + oid is zero. + diff --git a/doc/src/sgml/ref/listen.sgml b/doc/src/sgml/ref/listen.sgml index 7de13387db..8029b5ed03 100644 --- a/doc/src/sgml/ref/listen.sgml +++ b/doc/src/sgml/ref/listen.sgml @@ -1,5 +1,5 @@ @@ -31,6 +31,9 @@ LISTEN name LISTEN registers the current session as a listener on the notification condition name. + If the current session is already registered as a listener for + this notification condition, a warning message appears and nothing + is done. @@ -85,30 +88,6 @@ LISTEN name - - Diagnostics - - - - LISTEN - - - Message returned upon successful completion of registration. - - - - - - WARNING: Async_Listen: We are already listening on name - - - Message returned if this session is already registered for that notification condition. - - - - - - Examples @@ -117,7 +96,7 @@ LISTEN name LISTEN virtual; NOTIFY virtual; -Asynchronous NOTIFY 'virtual' from backend with pid '8448' received. +Asynchronous notification "virtual" received from server process with PID 8448. diff --git a/doc/src/sgml/ref/move.sgml b/doc/src/sgml/ref/move.sgml index 471e052979..c13cdc9ead 100644 --- a/doc/src/sgml/ref/move.sgml +++ b/doc/src/sgml/ref/move.sgml @@ -1,5 +1,5 @@ @@ -41,12 +41,16 @@ MOVE [ direction { FROM | IN } ] - Diagnostics + Outputs - The count returned in MOVE's status string is - the count of the number of rows that would have been returned by - the equivalent FETCH command. + On successful completion, a MOVE command returns a command + tag of the form + +MOVE count + + The count is the number + of rows moved over (possibly zero). diff --git a/doc/src/sgml/ref/postmaster.sgml b/doc/src/sgml/ref/postmaster.sgml index 07c6f2bfc0..77aecf7031 100644 --- a/doc/src/sgml/ref/postmaster.sgml +++ b/doc/src/sgml/ref/postmaster.sgml @@ -1,5 +1,5 @@ @@ -419,73 +419,52 @@ PostgreSQL documentation Diagnostics + + A failure message mentioning semget or shmget + probably indicates you need to configure your kernel to provide adequate + shared memory and semaphores. For more discussion see . + - - - semget: No space left on device - - - If you see this message, you probably need to configure - your kernel for shared memory and semaphores as described in . - If you run multiple instances of - postmaster - on a single host, or have a kernel with particularly small shared memory - and/or semaphore limits, you may have to reconfigure your kernel to increase - its shared memory or semaphore parameters. - + + + You may be able to postpone reconfiguring your kernel by decreasing + shared_buffers to reduce the shared memory consumption + of PostgreSQL, and/or by reducing + max_connections to reduce the semaphore consumption. + + - - - You may be able to postpone - reconfiguring your kernel by decreasing to reduce - the shared memory consumption of PostgreSQL, - and/or by reducing to reduce the semaphore - consumption. - - - - - - - StreamServerPort: cannot bind to port - - - If you see this message, you should make certain that there is no - other postmaster - process already running on the same port number. The easiest way to - determine this is by using the command + + A failure message suggesting that another postmaster is already running + should be checked carefully, for example by using the command $ ps ax | grep postmaster or -$ ps -e | grep postmaster +$ ps -ef | grep postmaster - depending on your system. - - - - If you - are sure that no other - postmaster - processes are running and you still get this error, try specifying a - different port using the - -p - option. You may also get this error if you terminate the - postmaster - and immediately restart it using the same port; in this case, you must - simply wait a few seconds until the operating system closes the port - before trying again. Finally, you may get this error if you specify - a port number that your operating system considers to be reserved. - For example, many versions of Unix consider port numbers under 1024 to - be trusted - and only permit the Unix superuser to access them. - - - - + depending on your system. If you are certain that no conflicting + postmaster is running, you may remove the lock file mentioned in the + message and try again. + + + A failure message indicating inability to bind to a port may indicate + that that port is already in use by some non-PostgreSQL process. + You may also get this error if you terminate the + postmaster + and immediately restart it using the same port; in this case, you must + simply wait a few seconds until the operating system closes the port + before trying again. Finally, you may get this error if you specify + a port number that your operating system considers to be reserved. + For example, many versions of Unix consider port numbers under 1024 to + be trusted + and only permit the Unix superuser to access them. + + diff --git a/doc/src/sgml/ref/set.sgml b/doc/src/sgml/ref/set.sgml index cf9f0468ad..1bdb3d0ebb 100644 --- a/doc/src/sgml/ref/set.sgml +++ b/doc/src/sgml/ref/set.sgml @@ -1,5 +1,5 @@ @@ -224,48 +224,6 @@ SELECT setseed(value); - - Diagnostics - - - - SET - - - Message returned if successful. - - - - - - ERROR: 'name' is not a valid option name - - - The parameter you tried to set does not exist. - - - - - - ERROR: 'name': permission denied - - - You must be a superuser to alter certain settings. - - - - - - ERROR: 'name' cannot be changed after server start - - - Some parameters are fixed once the server is started. - - - - - - Notes diff --git a/doc/src/sgml/ref/truncate.sgml b/doc/src/sgml/ref/truncate.sgml index 3fca869103..fc65f65db5 100644 --- a/doc/src/sgml/ref/truncate.sgml +++ b/doc/src/sgml/ref/truncate.sgml @@ -1,5 +1,5 @@ @@ -36,7 +36,7 @@ TRUNCATE [ TABLE ] name - Parameter + Parameters diff --git a/doc/src/sgml/ref/update.sgml b/doc/src/sgml/ref/update.sgml index 01917b362d..10d5886b3b 100644 --- a/doc/src/sgml/ref/update.sgml +++ b/doc/src/sgml/ref/update.sgml @@ -1,5 +1,5 @@ @@ -118,21 +118,20 @@ UPDATE [ ONLY ] table SET - Diagnostics + Outputs - - - UPDATE count - - - Message returned if successful. The value count is the number of rows - updated. If count - is 0, no rows were updated. - - - - + + On successful completion, an UPDATE command returns a command + tag of the form + +UPDATE count + + The count is the number + of rows updated. If count is + 0, no rows matched the condition (this is not considered + an error). + diff --git a/doc/src/sgml/ref/vacuum.sgml b/doc/src/sgml/ref/vacuum.sgml index 7102a3d0d3..aab2f74bf1 100644 --- a/doc/src/sgml/ref/vacuum.sgml +++ b/doc/src/sgml/ref/vacuum.sgml @@ -1,5 +1,5 @@ @@ -143,49 +143,13 @@ VACUUM [ FULL ] [ FREEZE ] [ VERBOSE ] ANALYZE [ - Diagnostics + Outputs - - - VACUUM - - - The command is complete. - - - - - - INFO: --Relation table-- - - - The report header for table. - - - - - - INFO: Pages 98: Changed 25, Reapped 74, Empty 0, New 0; - Tup 1000: Vac 3000, Crash 0, UnUsed 0, MinLen 188, MaxLen 188; - Re-using: Free/Avail. Space 586952/586952; EndEmpty/Avail. Pages 0/74. - Elapsed 0/0 sec. - - - The analysis for table itself. - - - - - - INFO: Index index: Pages 28; - Tuples 1000: Deleted 3000. Elapsed 0/0 sec. - - - The analysis for an index on the target table. - - - - + + When VERBOSE is specified, VACUUM emits + progress messages to indicate which table is currently being + processed. Various statistics about the tables are printed as well. + @@ -216,25 +180,37 @@ VACUUM [ FULL ] [ FREEZE ] [ VERBOSE ] ANALYZE [ Examples - The following is an example from running VACUUM on a table - in the regression database: + The following is an example from running VACUUM on a + table in the regression database: -=> VACUUM VERBOSE ANALYZE onek; -INFO: --Relation onek-- -INFO: Index onek_unique1: Pages 14; Tuples 1000: Deleted 3000. - CPU 0.00s/0.11u sec elapsed 0.12 sec. -INFO: Index onek_unique2: Pages 16; Tuples 1000: Deleted 3000. - CPU 0.00s/0.10u sec elapsed 0.10 sec. -INFO: Index onek_hundred: Pages 13; Tuples 1000: Deleted 3000. - CPU 0.00s/0.10u sec elapsed 0.10 sec. -INFO: Index onek_stringu1: Pages 31; Tuples 1000: Deleted 3000. - CPU 0.01s/0.09u sec elapsed 0.10 sec. -INFO: Removed 3000 tuples in 70 pages. - CPU 0.02s/0.04u sec elapsed 0.07 sec. -INFO: Pages 94: Changed 0, Empty 0; Tup 1000: Vac 3000, Keep 0, UnUsed 0. - Total CPU 0.05s/0.45u sec elapsed 0.59 sec. -INFO: Analyzing onek +regression=# VACUUM VERBOSE ANALYZE onek; +INFO: vacuuming "public.onek" +INFO: index "onek_unique1" now contains 1000 tuples in 14 pages +DETAIL: 3000 index tuples were removed. +0 index pages have been deleted, 0 are currently reusable. +CPU 0.01s/0.08u sec elapsed 0.18 sec. +INFO: index "onek_unique2" now contains 1000 tuples in 16 pages +DETAIL: 3000 index tuples were removed. +0 index pages have been deleted, 0 are currently reusable. +CPU 0.00s/0.07u sec elapsed 0.23 sec. +INFO: index "onek_hundred" now contains 1000 tuples in 13 pages +DETAIL: 3000 index tuples were removed. +0 index pages have been deleted, 0 are currently reusable. +CPU 0.01s/0.08u sec elapsed 0.17 sec. +INFO: index "onek_stringu1" now contains 1000 tuples in 48 pages +DETAIL: 3000 index tuples were removed. +0 index pages have been deleted, 0 are currently reusable. +CPU 0.01s/0.09u sec elapsed 0.59 sec. +INFO: "onek": removed 3000 tuples in 108 pages +DETAIL: CPU 0.01s/0.06u sec elapsed 0.07 sec. +INFO: "onek": found 3000 removable, 1000 nonremovable tuples in 143 pages +DETAIL: 0 dead tuples cannot be removed yet. +There were 0 unused item pointers. +0 pages are entirely empty. +CPU 0.07s/0.39u sec elapsed 1.56 sec. +INFO: analyzing "public.onek" +INFO: "onek": 36 pages, 1000 rows sampled, 1000 estimated total rows VACUUM diff --git a/doc/src/sgml/ref/vacuumdb.sgml b/doc/src/sgml/ref/vacuumdb.sgml index 31390050c2..63d7b4d3ee 100644 --- a/doc/src/sgml/ref/vacuumdb.sgml +++ b/doc/src/sgml/ref/vacuumdb.sgml @@ -1,5 +1,5 @@ @@ -55,13 +55,19 @@ PostgreSQL documentation vacuumdb is a wrapper around the SQL command . There is no effective difference between vacuuming databases via - this or other methods. The database server must be running at the - targeted host. Also, any default settings and environment + this utility and via other methods for accessing the server. + + + + In case of difficulty, see and for + discussions of potential problems and error messages. + The database server must be running at the + targeted host. Also, any default connection settings and environment variables used by the libpq front-end library will apply. - vacuumdb might need to connect several times to the PostgreSQL server, asking @@ -230,37 +236,6 @@ PostgreSQL documentation - - Diagnostics - - - - - VACUUM - - - The database was successfully vacuumed. - - - - - - vacuumdb: Vacuum failed. - - - Something went wrong. vacuumdb is only a wrapper - script. See - and for a detailed - discussion of error messages and potential problems. - - - - - - - - - Environment