mirror of
https://github.com/postgres/postgres.git
synced 2025-06-13 07:41:39 +03:00
A few minor psql enhancements
Initdb help correction Changed end/abort to commit/rollback and changed related notices Commented out way old printing functions in libpq Fixed a typo in alter table / alter column
This commit is contained in:
@ -274,8 +274,8 @@ PostgresPollingStatusType *PQconnectPoll(PQconn *conn)
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To begin, call conn=PQconnectStart("<connection_info_string>"). If
|
||||
conn is NULL, then libpq has been unable to allocate a new PGconn
|
||||
To begin, call <literal>conn=PQconnectStart("<connection_info_string>")</literal>.
|
||||
If conn is NULL, then libpq has been unable to allocate a new PGconn
|
||||
structure. Otherwise, a valid PGconn pointer is returned (though not yet
|
||||
representing a valid connection to the database). On return from
|
||||
PQconnectStart, call status=PQstatus(conn). If status equals
|
||||
@ -1019,6 +1019,9 @@ const char * PQcmdTuples(const PGresult *res);
|
||||
<synopsis>
|
||||
Oid PQoidValue(const PGresult *res);
|
||||
</synopsis>
|
||||
The type <type>Oid</type> and the constant <literal>Invalid</literal>
|
||||
will be defined if you include the <application>libpq</application>
|
||||
header file. They will both be some integer type.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
@ -1031,7 +1034,8 @@ Oid PQoidValue(const PGresult *res);
|
||||
<synopsis>
|
||||
const char * PQoidStatus(const PGresult *res);
|
||||
</synopsis>
|
||||
The function is deprecated in favor of <function>PQoidValue</function>.
|
||||
The function is deprecated in favor of <function>PQoidValue</function>
|
||||
and is not thread-safe.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
@ -1045,57 +1049,25 @@ void PQprint(FILE* fout, /* output stream */
|
||||
const PGresult *res,
|
||||
const PQprintOpt *po);
|
||||
|
||||
struct _PQprintOpt {
|
||||
pqbool header; /* print output field headings and row count */
|
||||
pqbool align; /* fill align the fields */
|
||||
pqbool standard; /* old brain dead format */
|
||||
pqbool html3; /* output html tables */
|
||||
pqbool expanded; /* expand tables */
|
||||
pqbool pager; /* use pager for output if needed */
|
||||
struct {
|
||||
int header; /* print output field headings and row count */
|
||||
int align; /* fill align the fields */
|
||||
int standard; /* old brain dead format */
|
||||
int html3; /* output html tables */
|
||||
int expanded; /* expand tables */
|
||||
int pager; /* use pager for output if needed */
|
||||
char *fieldSep; /* field separator */
|
||||
char *tableOpt; /* insert to HTML <table ...> */
|
||||
char *caption; /* HTML <caption> */
|
||||
char **fieldName; /* null terminated array of replacement field names */
|
||||
}
|
||||
} PQprintOpt;
|
||||
</synopsis>
|
||||
This function is intended to replace PQprintTuples(), which is
|
||||
now obsolete. The <filename>psql</filename> program uses
|
||||
<function>PQprint()</function> to display query results.
|
||||
This function was formerly used by <application>psql</application>
|
||||
to print query results, but this is no longer the case and this
|
||||
function is no longer supported.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
<function>PQprintTuples</function>
|
||||
Prints out all the tuples and, optionally, the
|
||||
attribute names to the specified output stream.
|
||||
<synopsis>
|
||||
void PQprintTuples(const PGresult *res,
|
||||
FILE *fout, /* output stream */
|
||||
int printAttName,/* print attribute names or not*/
|
||||
int terseOutput, /* delimiter bars or not?*/
|
||||
int width); /* width of column, variable width if 0*/
|
||||
</synopsis>
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>
|
||||
<function>PQdisplayTuples</function>
|
||||
Prints out all the tuples and, optionally, the
|
||||
attribute names to the specified output stream.
|
||||
<synopsis>
|
||||
void PQdisplayTuples(const PGresult* res,
|
||||
FILE *fout, /* output stream */
|
||||
int fillAlign, /* space fill to align columns */
|
||||
const char *fieldSep, /* field separator */
|
||||
int printHeader, /* display headers? */
|
||||
int quiet); /* suppress print of row count at end */
|
||||
</synopsis>
|
||||
<function>PQdisplayTuples()</function> was intended to supersede
|
||||
<function>PQprintTuples()</function>, and
|
||||
is in turn superseded by <function>PQprint()</function>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/abort.sgml,v 1.4 1999/07/22 15:09:05 thomas Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/abort.sgml,v 1.5 2000/01/29 16:58:27 petere Exp $
|
||||
Postgres documentation
|
||||
-->
|
||||
|
||||
@ -52,7 +52,7 @@ ABORT [ WORK | TRANSACTION ]
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
ABORT
|
||||
ROLLBACK
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
@ -62,8 +62,8 @@ ABORT
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
NOTICE: UserAbortTransactionBlock and not in in-progress state
|
||||
ABORT
|
||||
NOTICE: ROLLBACK: no transaction in progress
|
||||
ROLLBACK
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
@ -130,7 +130,7 @@ ABORT WORK;
|
||||
SQL92
|
||||
</title>
|
||||
<para>
|
||||
This command is a <productname>Postgres</productname> extension present
|
||||
This command is a <productname>PostgreSQL</productname> extension present
|
||||
for historical reasons. <command>ROLLBACK</command> is the <acronym>SQL92</acronym>
|
||||
equivalent command.
|
||||
</para>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.9 2000/01/09 17:35:27 momjian Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/alter_table.sgml,v 1.10 2000/01/29 16:58:27 petere Exp $
|
||||
Postgres documentation
|
||||
-->
|
||||
|
||||
@ -23,11 +23,14 @@ Postgres documentation
|
||||
<date>1999-07-20</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
|
||||
[ * ] ADD [ COLUMN ] <replaceable class="PARAMETER">column</replaceable> <replaceable
|
||||
ALTER TABLE <replaceable class="PARAMETER">table</replaceable> [ * ]
|
||||
ADD [ COLUMN ] <replaceable class="PARAMETER">column</replaceable> <replaceable
|
||||
class="PARAMETER">type</replaceable>
|
||||
ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
|
||||
[ * ] RENAME [ COLUMN ] <replaceable class="PARAMETER">column</replaceable> TO <replaceable
|
||||
ALTER TABLE <replaceable class="PARAMETER">table</replaceable> [ * ]
|
||||
ALTER [ COLUMN ] <replaceable class="PARAMETER">column</replaceable> { SET DEFAULT <replaceable
|
||||
class="PARAMETER">value</replaceable> | DROP DEFAULT }
|
||||
ALTER TABLE <replaceable class="PARAMETER">table</replaceable> [ * ]
|
||||
RENAME [ COLUMN ] <replaceable class="PARAMETER">column</replaceable> TO <replaceable
|
||||
class="PARAMETER">newcolumn</replaceable>
|
||||
ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
|
||||
RENAME TO <replaceable class="PARAMETER">newtable</replaceable>
|
||||
@ -82,7 +85,7 @@ ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
|
||||
<term><replaceable class="PARAMETER"> newtable </replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
New name for an existing column.
|
||||
New name for the table.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@ -101,9 +104,7 @@ ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
ALTER
|
||||
</computeroutput></term>
|
||||
<term><computeroutput>ALTER</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Message returned from column or table renaming.
|
||||
@ -112,20 +113,7 @@ ALTER
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
NEW
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Message returned from column addition.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
ERROR
|
||||
</computeroutput></term>
|
||||
<term><computeroutput>ERROR</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Message returned if table or column is not available.
|
||||
@ -146,9 +134,12 @@ ERROR
|
||||
</title>
|
||||
<para>
|
||||
<command>ALTER TABLE</command> changes the definition of an existing table.
|
||||
The new columns and their types are specified in the same style
|
||||
and with the the same restrictions as in <command>CREATE TABLE</command>.
|
||||
The RENAME clause causes the name of a table or column
|
||||
The <literal>ADD COLUMN</literal> form adds a new column to the table
|
||||
using the same syntax as <xref linkend="SQL-CREATETABLE"
|
||||
endterm="SQL-CREATETABLE-title">. The <literal>ALTER COLUMN</literal> form
|
||||
allows you to set or remove the default for the column. Note that defaults
|
||||
only apply to newly inserted rows.
|
||||
The <literal>RENAME</literal> clause causes the name of a table or column
|
||||
to change without changing any of the data contained in
|
||||
the affected table. Thus, the table or column will
|
||||
remain of the same type and size after this command is
|
||||
@ -189,13 +180,12 @@ SELECT <replaceable>NewColumn</replaceable> FROM <replaceable>SuperClass</replac
|
||||
</para>
|
||||
|
||||
<para>
|
||||
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
|
||||
<command>UPDATE</command> query
|
||||
(<xref linkend="sql-update-title" endterm="sql-update-title">)
|
||||
should be run.
|
||||
In the current implementation, default and constraint clauses for the
|
||||
new column will be ignored. You can use the <literal>SET DEFAULT</literal>
|
||||
form of <command>ALTER TABLE</command> to set the default later.
|
||||
(You will also have to update the already existing rows to the
|
||||
new default value, using <xref linkend="sql-update-title"
|
||||
endterm="sql-update-title">.)
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@ -248,87 +238,38 @@ ALTER TABLE distributors RENAME TO suppliers;
|
||||
<refsect2info>
|
||||
<date>1998-04-15</date>
|
||||
</refsect2info>
|
||||
<title>
|
||||
SQL92
|
||||
</title>
|
||||
<para>
|
||||
<command>ALTER TABLE/RENAME</command>
|
||||
is a <productname>Postgres</productname> language extension.
|
||||
</para>
|
||||
<title>SQL92</title>
|
||||
<para>
|
||||
The <literal>ADD COLUMN</literal> form is compliant with the exception that
|
||||
it does not support defaults and constraints, as explained above.
|
||||
The <literal>ALTER COLUMN</literal> form is in full compliance.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
SQL92 specifies some additional capabilities for <command>ALTER TABLE</command>
|
||||
statement which are not yet directly supported by
|
||||
<productname>Postgres</productname>:
|
||||
</para>
|
||||
<para>
|
||||
SQL92 specifies some additional capabilities for <command>ALTER TABLE</command>
|
||||
statement which are not yet directly supported by <productname>PostgreSQL</productname>:
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<synopsis>
|
||||
ALTER TABLE <replaceable class="PARAMETER">table</replaceable> ALTER [
|
||||
COLUMN ] <replaceable class="PARAMETER">column</replaceable>
|
||||
SET DEFAULT <replaceable class="PARAMETER">default</replaceable>
|
||||
ALTER TABLE <replaceable class="PARAMETER">table</replaceable> ALTER [
|
||||
COLUMN ] <replaceable class="PARAMETER">column</replaceable>
|
||||
ADD [ CONSTRAINT <replaceable class="PARAMETER">>constrain</replaceable>> ] <replaceable
|
||||
class="PARAMETER">table-constraint</replaceable>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<synopsis>
|
||||
ALTER TABLE <replaceable class="PARAMETER">table</replaceable> ADD <replaceable class="PARAMETER">table constraint definition</replaceable>
|
||||
ALTER TABLE <replaceable class="PARAMETER">table</replaceable> DROP CONSTRAINT <replaceable class="PARAMETER">constraint</replaceable> { RESTRICT | CASCADE }
|
||||
</synopsis>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Puts the default value or constraint specified into the
|
||||
definition of column in the table.
|
||||
See <command>CREATE TABLE</command> for the
|
||||
syntax of the default and table-constraint clauses.
|
||||
If a default clause already exists, it will be replaced by
|
||||
the new definition. If any constraints on this column already
|
||||
exist, they will be retained using a boolean AND with the new
|
||||
constraint.
|
||||
Adds or removes a table constraint (such as a check constraint,
|
||||
unique constraint, or foreign key constraint). To create
|
||||
or remove a unique constraint, create or drop a unique index,
|
||||
respectively (see <xref linkend="SQL-CREATEINDEX" endterm="SQL-CREATEINDEX-title">).
|
||||
To change other kinds of constraints you need to recreate
|
||||
and reload the table, using other parameters to the
|
||||
<xref linkend="SQL-CREATETABLE" endterm="SQL-CREATETABLE-title">
|
||||
command.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Currently, to set new default constraints on an existing column
|
||||
the table must be recreated and reloaded:
|
||||
|
||||
<programlisting>
|
||||
CREATE TABLE temp AS SELECT * FROM distributors;
|
||||
DROP TABLE distributors;
|
||||
CREATE TABLE distributors (
|
||||
did DECIMAL(3) DEFAULT 1,
|
||||
name VARCHAR(40) NOT NULL,
|
||||
city VARCHAR(30)
|
||||
);
|
||||
INSERT INTO distributors SELECT * FROM temp;
|
||||
DROP TABLE temp;
|
||||
</programlisting>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<synopsis>
|
||||
ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
|
||||
DROP DEFAULT <replaceable class="PARAMETER">default</replaceable>
|
||||
ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
|
||||
DROP CONSTRAINT <replaceable class="PARAMETER">constraint</replaceable> { RESTRICT | CASCADE }
|
||||
</synopsis>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Removes the default value specified by default or the rule
|
||||
specified by constraint from the definition of a table.
|
||||
If RESTRICT is specified only a constraint with no dependent
|
||||
constraints can be destroyed.
|
||||
If CASCADE is specified, Any constraints that are dependent on
|
||||
this constraint are also dropped.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Currently, to remove a default value or constraints on an
|
||||
existing column the table must be recreated and reloaded:
|
||||
|
||||
For example, to drop any constraints on a table <literal>distributors</literal>:
|
||||
<programlisting>
|
||||
CREATE TABLE temp AS SELECT * FROM distributors;
|
||||
DROP TABLE distributors;
|
||||
@ -342,23 +283,14 @@ DROP TABLE temp;
|
||||
<varlistentry>
|
||||
<term>
|
||||
<synopsis>
|
||||
ALTER TABLE <replaceable class="PARAMETER">table</replaceable>
|
||||
DROP [ COLUMN ] <replaceable class="PARAMETER">column</replaceable> { RESTRICT | CASCADE }
|
||||
ALTER TABLE <replaceable class="PARAMETER">table</replaceable> DROP [ COLUMN ] <replaceable class="PARAMETER">column</replaceable> { RESTRICT | CASCADE }
|
||||
</synopsis>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Removes a column from a table.
|
||||
If RESTRICT is specified only a column with no dependent
|
||||
objects can be destroyed.
|
||||
If CASCADE is specified, all objects that are dependent on
|
||||
this column are also dropped.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Currently, to remove an existing column the table must be
|
||||
recreated and reloaded:
|
||||
|
||||
<programlisting>
|
||||
CREATE TABLE temp AS SELECT did, city FROM distributors;
|
||||
DROP TABLE distributors;
|
||||
@ -373,6 +305,13 @@ DROP TABLE temp;
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The clauses to rename columns and tables are <productname>PostgreSQL</productname>
|
||||
extensions. SQL92 does not provide for them.
|
||||
</para>
|
||||
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/begin.sgml,v 1.9 1999/07/22 15:09:06 thomas Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/begin.sgml,v 1.10 2000/01/29 16:58:27 petere Exp $
|
||||
Postgres documentation
|
||||
-->
|
||||
|
||||
@ -72,7 +72,7 @@ BEGIN
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
NOTICE: BeginTransactionBlock and not in default state
|
||||
NOTICE: BEGIN: already a transaction in progress
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
@ -95,7 +95,7 @@ NOTICE: BeginTransactionBlock and not in default state
|
||||
</title>
|
||||
|
||||
<para>
|
||||
By default, <productname>Postgres</productname> executes transactions
|
||||
By default, <productname>PostgreSQL</productname> executes transactions
|
||||
in <firstterm>unchained mode</firstterm>
|
||||
(also known as <quote>autocommit</quote> in other database
|
||||
systems).
|
||||
@ -116,7 +116,7 @@ NOTICE: BeginTransactionBlock and not in default state
|
||||
|
||||
<para>
|
||||
The default transaction isolation level in
|
||||
<productname>Postgres</productname>
|
||||
<productname>PostgreSQL</productname>
|
||||
is READ COMMITTED, where queries inside the transaction see only changes
|
||||
committed before query execution. So, you have to use
|
||||
<command>SET TRANSACTION ISOLATION LEVEL SERIALIZABLE</command>
|
||||
@ -128,7 +128,7 @@ NOTICE: BeginTransactionBlock and not in default state
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If the transaction is committed, <productname>Postgres</productname>
|
||||
If the transaction is committed, <productname>PostgreSQL</productname>
|
||||
will ensure either that all updates are done or else that none of
|
||||
them are done. Transactions have the standard <acronym>ACID</acronym>
|
||||
(atomic, consistent, isolatable, and durable) property.
|
||||
@ -141,11 +141,6 @@ NOTICE: BeginTransactionBlock and not in default state
|
||||
<title>
|
||||
Notes
|
||||
</title>
|
||||
<para>
|
||||
The keyword TRANSACTION is just a cosmetic alternative to WORK.
|
||||
Neither keyword need be specified.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Refer to <xref linkend="sql-lock-title" endterm="sql-lock-title">
|
||||
for further information
|
||||
@ -190,7 +185,7 @@ BEGIN WORK;
|
||||
|
||||
<para>
|
||||
<command>BEGIN</command>
|
||||
is a <productname>Postgres</productname> language extension.
|
||||
is a <productname>PostgreSQL</productname> language extension.
|
||||
There is no explicit <command>BEGIN</command>
|
||||
command in <acronym>SQL92</acronym>;
|
||||
transaction initiation is always implicit and it terminates either
|
||||
@ -204,6 +199,12 @@ BEGIN WORK;
|
||||
</note>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Incidentally, the <literal>BEGIN</literal> keyword is used for a different
|
||||
purpose in embedded SQL. You are advised to be careful about the transaction
|
||||
semantics when porting database applications.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<acronym>SQL92</acronym> also requires SERIALIZABLE to be the default
|
||||
transaction isolation level.
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/commit.sgml,v 1.8 1999/07/22 15:09:06 thomas Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/commit.sgml,v 1.9 2000/01/29 16:58:27 petere Exp $
|
||||
Postgres documentation
|
||||
-->
|
||||
|
||||
@ -62,7 +62,7 @@ COMMIT [ WORK | TRANSACTION ]
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
END
|
||||
COMMIT
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
@ -72,7 +72,7 @@ END
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
NOTICE EndTransactionBlock and not inprogress/abort state
|
||||
NOTICE: COMMIT: no transaction in progress
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
@ -141,7 +141,8 @@ COMMIT WORK;
|
||||
SQL92
|
||||
</title>
|
||||
<para>
|
||||
Full compatibility.
|
||||
<acronym>SQL92</acronym> only specifies the two forms <literal>COMMIT</literal>
|
||||
and <literal>COMMIT WORK</literal>. Otherwise full compatibility.
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/end.sgml,v 1.1 1999/07/22 15:09:11 thomas Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/end.sgml,v 1.2 2000/01/29 16:58:27 petere Exp $
|
||||
Postgres documentation
|
||||
-->
|
||||
|
||||
@ -62,7 +62,7 @@ END [ WORK | TRANSACTION ]
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
END
|
||||
COMMIT
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
@ -72,7 +72,7 @@ END
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
NOTICE EndTransactionBlock and not inprogress/abort state
|
||||
NOTICE: COMMIT: no transaction in progress
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
@ -94,7 +94,7 @@ NOTICE EndTransactionBlock and not inprogress/abort state
|
||||
</title>
|
||||
|
||||
<para>
|
||||
<command>END</command> is a <productname>Postgres</productname>
|
||||
<command>END</command> is a <productname>PostgreSQL</productname>
|
||||
synonym for
|
||||
<xref linkend="sql-commit-title" endterm="sql-commit-title">.
|
||||
</para>
|
||||
@ -144,7 +144,7 @@ END WORK;
|
||||
</title>
|
||||
|
||||
<para>
|
||||
<command>END</command> is a <productname>Postgres</productname>
|
||||
<command>END</command> is a <productname>PostgreSQL</productname>
|
||||
extension which provides functionality equivalent to
|
||||
<xref linkend="sql-commit-title" endterm="sql-commit-title">.
|
||||
</para>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.21 2000/01/18 23:30:19 petere Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.22 2000/01/29 16:58:27 petere Exp $
|
||||
Postgres documentation
|
||||
-->
|
||||
|
||||
@ -1944,7 +1944,7 @@ testdb=> <userinput>\set content `sed -e "s/'/\\\\\\'/g" < my_file.txt`</userinp
|
||||
|
||||
<varlistentry>
|
||||
<term><literal>%#</literal></term>
|
||||
<listitem><para>If the username is <literal>postgres</literal>, a
|
||||
<listitem><para>If the current user is a database superuser, then a
|
||||
<quote>#</quote>, otherwise a <quote>></quote>.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
@ -2020,10 +2020,9 @@ testdb=> <userinput>\set content `sed -e "s/'/\\\\\\'/g" < my_file.txt`</userinp
|
||||
|
||||
<para>
|
||||
Before starting up in interactive mode, <application>psql</application> attempts
|
||||
to read and execute the files <filename>/etc/psqlrc</filename> and
|
||||
<filename>$HOME/.psqlrc</filename>. They could be used to set up the client or
|
||||
the server to taste (using the <command>\set</command> and <command>SET</command>
|
||||
commands).
|
||||
to read and execute commands from the file <filename>$HOME/.psqlrc</filename>. It
|
||||
could be used to set up the client or the server to taste (using the <command>\set
|
||||
</command> and <command>SET</command> commands).
|
||||
</para>
|
||||
|
||||
</refsect2>
|
||||
@ -2034,7 +2033,7 @@ testdb=> <userinput>\set content `sed -e "s/'/\\\\\\'/g" < my_file.txt`</userinp
|
||||
<para>
|
||||
<application>psql</application> supports the readline and history libraries for
|
||||
convenienent line editing and retrieval. The command history is stored in a file
|
||||
named <filename>.psqlrc</filename> in your home directory and is reloaded when
|
||||
named <filename>.psql_history</filename> in your home directory and is reloaded when
|
||||
<application>psql</application> starts up.
|
||||
Tab-completion is also supported, although
|
||||
the completion logic makes no claim to be an <acronym>SQL</acronym> parser.
|
||||
@ -2088,7 +2087,7 @@ $ ./configure --with-includes=/opt/gnu/include --with-libraries=/opt/gnu/lib ..
|
||||
Notice the changing prompt.
|
||||
<programlisting>
|
||||
testdb=> <userinput>CREATE TABLE my_table (</userinput>
|
||||
testdb-> <userinput> first int4 not null default 0,</userinput>
|
||||
testdb-> <userinput> first integer not null default 0,</userinput>
|
||||
testdb-> <userinput> second text</userinput>
|
||||
testdb-> <userinput>);</userinput>
|
||||
CREATE
|
||||
@ -2096,11 +2095,11 @@ CREATE
|
||||
Now look at the table definition again:
|
||||
<programlisting>
|
||||
testdb=> <userinput>\d my_table</userinput>
|
||||
Table "my_table"
|
||||
Attribute | Type | Info
|
||||
-----------+------+--------------------
|
||||
first | int4 | not null default 0
|
||||
second | text |
|
||||
Table "my_table"
|
||||
Attribute | Type | Modifier
|
||||
-----------+---------+--------------------
|
||||
first | integer | not null default 0
|
||||
second | text |
|
||||
|
||||
</programlisting>
|
||||
At this point you decide to change the prompt to something more
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/rollback.sgml,v 1.6 1999/07/22 15:09:14 thomas Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/rollback.sgml,v 1.7 2000/01/29 16:58:27 petere Exp $
|
||||
Postgres documentation
|
||||
-->
|
||||
|
||||
@ -61,8 +61,7 @@ ABORT
|
||||
|
||||
<varlistentry>
|
||||
<term><computeroutput>
|
||||
NOTICE: UserAbortTransactionBlock and not in in-progress state
|
||||
ABORT
|
||||
NOTICE: ROLLBACK: no transaction in progress
|
||||
</computeroutput></term>
|
||||
<listitem>
|
||||
<para>
|
||||
@ -95,10 +94,6 @@ ABORT
|
||||
<title>
|
||||
Notes
|
||||
</title>
|
||||
<para>
|
||||
The keywords WORK and TRANSACTION are noise and can be omitted.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Use <xref linkend="SQL-COMMIT-TITLE" endterm="SQL-COMMIT-TITLE">
|
||||
to successfully terminate a transaction.
|
||||
@ -134,8 +129,8 @@ ROLLBACK WORK;
|
||||
SQL92
|
||||
</title>
|
||||
<para>
|
||||
Full compatibility. The TRANSACTION keyword is a
|
||||
<productname>Postgres</productname> extension.
|
||||
<acronym>SQL92</acronym> only specifies the two forms <literal>ROLLBACK</literal>
|
||||
and <literal>ROLLBACK WORK</literal>. Otherwise full compatibility.
|
||||
</para>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/update.sgml,v 1.6 1999/07/22 15:09:15 thomas Exp $
|
||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/update.sgml,v 1.7 2000/01/29 16:58:27 petere Exp $
|
||||
Postgres documentation
|
||||
-->
|
||||
|
||||
@ -23,7 +23,7 @@ Postgres documentation
|
||||
<date>1999-07-20</date>
|
||||
</refsynopsisdivinfo>
|
||||
<synopsis>
|
||||
UPDATE <replaceable class="PARAMETER">table</replaceable> SET <replaceable class="PARAMETER">R">col</replaceable>le> = <replaceable class="PARAMETER">expression</replaceable> [, ...]
|
||||
UPDATE <replaceable class="PARAMETER">table</replaceable> SET <replaceable class="PARAMETER">col</replaceable> = <replaceable class="PARAMETER">expression</replaceable> [, ...]
|
||||
[ FROM <replaceable class="PARAMETER">fromlist</replaceable> ]
|
||||
[ WHERE <replaceable class="PARAMETER">condition</replaceable> ]
|
||||
</synopsis>
|
||||
|
Reference in New Issue
Block a user