Commit a134ee33 authored by Bruce Momjian's avatar Bruce Momjian

Update documentation on may/can/might:

Standard English uses "may", "can", and "might" in different ways:

        may - permission, "You may borrow my rake."

        can - ability, "I can lift that log."

        might - possibility, "It might rain today."

Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice.  Similarly, "It may crash" is better stated, "It might crash".

Also update two error messages mentioned in the documenation to match.
parent 67a1ae9f
<!-- $PostgreSQL: pgsql/doc/src/sgml/advanced.sgml,v 1.52 2006/10/21 23:12:57 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/advanced.sgml,v 1.53 2007/01/31 20:56:16 momjian Exp $ -->
<chapter id="tutorial-advanced"> <chapter id="tutorial-advanced">
<title>Advanced Features</title> <title>Advanced Features</title>
...@@ -57,7 +57,7 @@ SELECT * FROM myview; ...@@ -57,7 +57,7 @@ SELECT * FROM myview;
<para> <para>
Making liberal use of views is a key aspect of good SQL database Making liberal use of views is a key aspect of good SQL database
design. Views allow you to encapsulate the details of the design. Views allow you to encapsulate the details of the
structure of your tables, which may change as your application structure of your tables, which might change as your application
evolves, behind consistent interfaces. evolves, behind consistent interfaces.
</para> </para>
...@@ -250,7 +250,7 @@ COMMIT; ...@@ -250,7 +250,7 @@ COMMIT;
<note> <note>
<para> <para>
Some client libraries issue <command>BEGIN</> and <command>COMMIT</> Some client libraries issue <command>BEGIN</> and <command>COMMIT</>
commands automatically, so that you may get the effect of transaction commands automatically, so that you might get the effect of transaction
blocks without asking. Check the documentation for the interface blocks without asking. Check the documentation for the interface
you are using. you are using.
</para> </para>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/arch-dev.sgml,v 2.28 2006/09/16 00:30:11 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/arch-dev.sgml,v 2.29 2007/01/31 20:56:16 momjian Exp $ -->
<chapter id="overview"> <chapter id="overview">
<title>Overview of PostgreSQL Internals</title> <title>Overview of PostgreSQL Internals</title>
...@@ -272,7 +272,7 @@ ...@@ -272,7 +272,7 @@
similar to the raw parse tree in most places, but it has many differences similar to the raw parse tree in most places, but it has many differences
in detail. For example, a <structname>FuncCall</> node in the in detail. For example, a <structname>FuncCall</> node in the
parse tree represents something that looks syntactically like a function parse tree represents something that looks syntactically like a function
call. This may be transformed to either a <structname>FuncExpr</> call. This might be transformed to either a <structname>FuncExpr</>
or <structname>Aggref</> node depending on whether the referenced or <structname>Aggref</> node depending on whether the referenced
name turns out to be an ordinary function or an aggregate function. name turns out to be an ordinary function or an aggregate function.
Also, information about the actual data types of columns and expression Also, information about the actual data types of columns and expression
...@@ -342,7 +342,7 @@ ...@@ -342,7 +342,7 @@
<note> <note>
<para> <para>
In some situations, examining each possible way in which a query In some situations, examining each possible way in which a query
may be executed would take an excessive amount of time and memory can be executed would take an excessive amount of time and memory
space. In particular, this occurs when executing queries space. In particular, this occurs when executing queries
involving large numbers of join operations. In order to determine involving large numbers of join operations. In order to determine
a reasonable (not optimal) query plan in a reasonable amount of a reasonable (not optimal) query plan in a reasonable amount of
...@@ -414,7 +414,7 @@ ...@@ -414,7 +414,7 @@
scanned in parallel, and matching rows are combined to form scanned in parallel, and matching rows are combined to form
join rows. This kind of join is more join rows. This kind of join is more
attractive because each relation has to be scanned only once. attractive because each relation has to be scanned only once.
The required sorting may be achieved either by an explicit sort The required sorting might be achieved either by an explicit sort
step, or by scanning the relation in the proper order using an step, or by scanning the relation in the proper order using an
index on the join key. index on the join key.
</para> </para>
...@@ -502,7 +502,7 @@ ...@@ -502,7 +502,7 @@
</para> </para>
<para> <para>
Complex queries may involve many levels of plan nodes, but the general Complex queries can involve many levels of plan nodes, but the general
approach is the same: each node computes and returns its next output approach is the same: each node computes and returns its next output
row each time it is called. Each node is also responsible for applying row each time it is called. Each node is also responsible for applying
any selection or projection expressions that were assigned to it by any selection or projection expressions that were assigned to it by
...@@ -518,7 +518,7 @@ ...@@ -518,7 +518,7 @@
into the target table specified for the <command>INSERT</>. (A simple into the target table specified for the <command>INSERT</>. (A simple
<command>INSERT ... VALUES</> command creates a trivial plan tree <command>INSERT ... VALUES</> command creates a trivial plan tree
consisting of a single <literal>Result</> node, which computes just one consisting of a single <literal>Result</> node, which computes just one
result row. But <command>INSERT ... SELECT</> may demand the full power result row. But <command>INSERT ... SELECT</> can demand the full power
of the executor mechanism.) For <command>UPDATE</>, the planner arranges of the executor mechanism.) For <command>UPDATE</>, the planner arranges
that each computed row includes all the updated column values, plus that each computed row includes all the updated column values, plus
the <firstterm>TID</> (tuple ID, or row ID) of the original target row; the <firstterm>TID</> (tuple ID, or row ID) of the original target row;
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/array.sgml,v 1.54 2007/01/31 04:12:01 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/array.sgml,v 1.55 2007/01/31 20:56:16 momjian Exp $ -->
<sect1 id="arrays"> <sect1 id="arrays">
<title>Arrays</title> <title>Arrays</title>
...@@ -63,7 +63,7 @@ CREATE TABLE tictactoe ( ...@@ -63,7 +63,7 @@ CREATE TABLE tictactoe (
</para> </para>
<para> <para>
An alternative syntax, which conforms to the SQL standard, may An alternative syntax, which conforms to the SQL standard, can
be used for one-dimensional arrays. be used for one-dimensional arrays.
<structfield>pay_by_quarter</structfield> could have been defined <structfield>pay_by_quarter</structfield> could have been defined
as: as:
...@@ -88,7 +88,7 @@ CREATE TABLE tictactoe ( ...@@ -88,7 +88,7 @@ CREATE TABLE tictactoe (
To write an array value as a literal constant, enclose the element To write an array value as a literal constant, enclose the element
values within curly braces and separate them by commas. (If you values within curly braces and separate them by commas. (If you
know C, this is not unlike the C syntax for initializing know C, this is not unlike the C syntax for initializing
structures.) You may put double quotes around any element value, structures.) You can put double quotes around any element value,
and must do so if it contains commas or curly braces. (More and must do so if it contains commas or curly braces. (More
details appear below.) Thus, the general format of an array details appear below.) Thus, the general format of an array
constant is the following: constant is the following:
...@@ -155,7 +155,7 @@ SELECT * FROM sal_emp; ...@@ -155,7 +155,7 @@ SELECT * FROM sal_emp;
</para> </para>
<para> <para>
The <literal>ARRAY</> constructor syntax may also be used: The <literal>ARRAY</> constructor syntax can also be used:
<programlisting> <programlisting>
INSERT INTO sal_emp INSERT INTO sal_emp
VALUES ('Bill', VALUES ('Bill',
...@@ -333,7 +333,7 @@ UPDATE sal_emp SET pay_by_quarter = ARRAY[25000,25000,27000,27000] ...@@ -333,7 +333,7 @@ UPDATE sal_emp SET pay_by_quarter = ARRAY[25000,25000,27000,27000]
WHERE name = 'Carol'; WHERE name = 'Carol';
</programlisting> </programlisting>
An array may also be updated at a single element: An array can also be updated at a single element:
<programlisting> <programlisting>
UPDATE sal_emp SET pay_by_quarter[4] = 15000 UPDATE sal_emp SET pay_by_quarter[4] = 15000
...@@ -453,7 +453,7 @@ SELECT array_dims(ARRAY[1,2] || ARRAY[[3,4],[5,6]]); ...@@ -453,7 +453,7 @@ SELECT array_dims(ARRAY[1,2] || ARRAY[[3,4],[5,6]]);
Note that the concatenation operator discussed above is preferred over Note that the concatenation operator discussed above is preferred over
direct use of these functions. In fact, the functions exist primarily for use direct use of these functions. In fact, the functions exist primarily for use
in implementing the concatenation operator. However, they may be directly in implementing the concatenation operator. However, they might be directly
useful in the creation of user-defined aggregates. Some examples: useful in the creation of user-defined aggregates. Some examples:
<programlisting> <programlisting>
...@@ -525,7 +525,7 @@ SELECT * FROM sal_emp WHERE 10000 = ALL (pay_by_quarter); ...@@ -525,7 +525,7 @@ SELECT * FROM sal_emp WHERE 10000 = ALL (pay_by_quarter);
<tip> <tip>
<para> <para>
Arrays are not sets; searching for specific array elements Arrays are not sets; searching for specific array elements
may be a sign of database misdesign. Consider can be a sign of database misdesign. Consider
using a separate table with a row for each item that would be an using a separate table with a row for each item that would be an
array element. This will be easier to search, and is likely to array element. This will be easier to search, and is likely to
scale up better to large numbers of elements. scale up better to large numbers of elements.
...@@ -592,7 +592,7 @@ SELECT f1[1][-2][3] AS e1, f1[1][-1][5] AS e2 ...@@ -592,7 +592,7 @@ SELECT f1[1][-2][3] AS e1, f1[1][-1][5] AS e2
or backslashes disables this and allows the literal string value or backslashes disables this and allows the literal string value
<quote>NULL</> to be entered. Also, for backwards compatibility with <quote>NULL</> to be entered. Also, for backwards compatibility with
pre-8.2 versions of <productname>PostgreSQL</>, the <xref pre-8.2 versions of <productname>PostgreSQL</>, the <xref
linkend="guc-array-nulls"> configuration parameter may be turned linkend="guc-array-nulls"> configuration parameter might be turned
<literal>off</> to suppress recognition of <literal>NULL</> as a NULL. <literal>off</> to suppress recognition of <literal>NULL</> as a NULL.
</para> </para>
...@@ -611,8 +611,8 @@ SELECT f1[1][-2][3] AS e1, f1[1][-1][5] AS e2 ...@@ -611,8 +611,8 @@ SELECT f1[1][-2][3] AS e1, f1[1][-1][5] AS e2
</para> </para>
<para> <para>
You may write whitespace before a left brace or after a right You can write whitespace before a left brace or after a right
brace. You may also write whitespace before or after any individual item brace. You can also write whitespace before or after any individual item
string. In all of these cases the whitespace will be ignored. However, string. In all of these cases the whitespace will be ignored. However,
whitespace within double-quoted elements, or surrounded on both sides by whitespace within double-quoted elements, or surrounded on both sides by
non-whitespace characters of an element, is not ignored. non-whitespace characters of an element, is not ignored.
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/backup.sgml,v 2.95 2006/12/01 03:29:15 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/backup.sgml,v 2.96 2007/01/31 20:56:16 momjian Exp $ -->
<chapter id="backup"> <chapter id="backup">
<title>Backup and Restore</title> <title>Backup and Restore</title>
...@@ -124,7 +124,7 @@ psql <replaceable class="parameter">dbname</replaceable> &lt; <replaceable class ...@@ -124,7 +124,7 @@ psql <replaceable class="parameter">dbname</replaceable> &lt; <replaceable class
<para> <para>
By default, the <application>psql</> script will continue to By default, the <application>psql</> script will continue to
execute after an SQL error is encountered. You may wish to use the execute after an SQL error is encountered. You might wish to use the
following command at the top of the script to alter that following command at the top of the script to alter that
behaviour and have <application>psql</application> exit with an behaviour and have <application>psql</application> exit with an
exit status of 3 if an SQL error occurs: exit status of 3 if an SQL error occurs:
...@@ -138,7 +138,7 @@ psql <replaceable class="parameter">dbname</replaceable> &lt; <replaceable class ...@@ -138,7 +138,7 @@ psql <replaceable class="parameter">dbname</replaceable> &lt; <replaceable class
passing the <option>-1</> or <option>--single-transaction</> passing the <option>-1</> or <option>--single-transaction</>
command-line options to <application>psql</>. When using this command-line options to <application>psql</>. When using this
mode, be aware that even the smallest of errors can rollback a mode, be aware that even the smallest of errors can rollback a
restore that has already run for many hours. However, that may restore that has already run for many hours. However, that might
still be preferable to manually cleaning up a complex database still be preferable to manually cleaning up a complex database
after a partially restored dump. after a partially restored dump.
</para> </para>
...@@ -325,7 +325,7 @@ tar -cf backup.tar /usr/local/pgsql/data ...@@ -325,7 +325,7 @@ tar -cf backup.tar /usr/local/pgsql/data
<listitem> <listitem>
<para> <para>
If you have dug into the details of the file system layout of the If you have dug into the details of the file system layout of the
database, you may be tempted to try to back up or restore only certain database, you might be tempted to try to back up or restore only certain
individual tables or databases from their respective files or individual tables or databases from their respective files or
directories. This will <emphasis>not</> work because the directories. This will <emphasis>not</> work because the
information contained in these files contains only half the information contained in these files contains only half the
...@@ -360,7 +360,7 @@ tar -cf backup.tar /usr/local/pgsql/data ...@@ -360,7 +360,7 @@ tar -cf backup.tar /usr/local/pgsql/data
</para> </para>
<para> <para>
If your database is spread across multiple file systems, there may not If your database is spread across multiple file systems, there might not
be any way to obtain exactly-simultaneous frozen snapshots of all be any way to obtain exactly-simultaneous frozen snapshots of all
the volumes. For example, if your data files and WAL log are on different the volumes. For example, if your data files and WAL log are on different
disks, or if tablespaces are on different file systems, it might disks, or if tablespaces are on different file systems, it might
...@@ -437,7 +437,7 @@ tar -cf backup.tar /usr/local/pgsql/data ...@@ -437,7 +437,7 @@ tar -cf backup.tar /usr/local/pgsql/data
Since we can string together an indefinitely long sequence of WAL files Since we can string together an indefinitely long sequence of WAL files
for replay, continuous backup can be achieved simply by continuing to archive for replay, continuous backup can be achieved simply by continuing to archive
the WAL files. This is particularly valuable for large databases, where the WAL files. This is particularly valuable for large databases, where
it may not be convenient to take a full backup frequently. it might not be convenient to take a full backup frequently.
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
...@@ -465,7 +465,7 @@ tar -cf backup.tar /usr/local/pgsql/data ...@@ -465,7 +465,7 @@ tar -cf backup.tar /usr/local/pgsql/data
<para> <para>
As with the plain file-system-backup technique, this method can only As with the plain file-system-backup technique, this method can only
support restoration of an entire database cluster, not a subset. support restoration of an entire database cluster, not a subset.
Also, it requires a lot of archival storage: the base backup may be bulky, Also, it requires a lot of archival storage: the base backup might be bulky,
and a busy system will generate many megabytes of WAL traffic that and a busy system will generate many megabytes of WAL traffic that
have to be archived. Still, it is the preferred backup technique in have to be archived. Still, it is the preferred backup technique in
many situations where high reliability is needed. many situations where high reliability is needed.
...@@ -534,7 +534,7 @@ archive_command = 'cp -i %p /mnt/server/archivedir/%f &lt;/dev/null' ...@@ -534,7 +534,7 @@ archive_command = 'cp -i %p /mnt/server/archivedir/%f &lt;/dev/null'
</programlisting> </programlisting>
which will copy archivable WAL segments to the directory which will copy archivable WAL segments to the directory
<filename>/mnt/server/archivedir</>. (This is an example, not a <filename>/mnt/server/archivedir</>. (This is an example, not a
recommendation, and may not work on all platforms.) recommendation, and might not work on all platforms.)
</para> </para>
<para> <para>
...@@ -601,7 +601,7 @@ archive_command = 'test ! -f .../%f &amp;&amp; cp %p .../%f' ...@@ -601,7 +601,7 @@ archive_command = 'test ! -f .../%f &amp;&amp; cp %p .../%f'
<para> <para>
In writing your archive command, you should assume that the file names to In writing your archive command, you should assume that the file names to
be archived may be up to 64 characters long and may contain any be archived can be up to 64 characters long and can contain any
combination of ASCII letters, digits, and dots. It is not necessary to combination of ASCII letters, digits, and dots. It is not necessary to
remember the original relative path (<literal>%p</>) but it is necessary to remember the original relative path (<literal>%p</>) but it is necessary to
remember the file name (<literal>%f</>). remember the file name (<literal>%f</>).
...@@ -614,7 +614,7 @@ archive_command = 'test ! -f .../%f &amp;&amp; cp %p .../%f' ...@@ -614,7 +614,7 @@ archive_command = 'test ! -f .../%f &amp;&amp; cp %p .../%f'
<filename>postgresql.conf</>, <filename>pg_hba.conf</> and <filename>postgresql.conf</>, <filename>pg_hba.conf</> and
<filename>pg_ident.conf</>), since those are edited manually rather <filename>pg_ident.conf</>), since those are edited manually rather
than through SQL operations. than through SQL operations.
You may wish to keep the configuration files in a location that will You might wish to keep the configuration files in a location that will
be backed up by your regular file system backup procedures. See be backed up by your regular file system backup procedures. See
<xref linkend="runtime-config-file-locations"> for how to relocate the <xref linkend="runtime-config-file-locations"> for how to relocate the
configuration files. configuration files.
...@@ -732,7 +732,7 @@ SELECT pg_stop_backup(); ...@@ -732,7 +732,7 @@ SELECT pg_stop_backup();
between <function>pg_start_backup</> and the start of the actual backup, between <function>pg_start_backup</> and the start of the actual backup,
nor between the end of the backup and <function>pg_stop_backup</>; a nor between the end of the backup and <function>pg_stop_backup</>; a
few minutes' delay won't hurt anything. (However, if you normally run the few minutes' delay won't hurt anything. (However, if you normally run the
server with <varname>full_page_writes</> disabled, you may notice a drop server with <varname>full_page_writes</> disabled, you might notice a drop
in performance between <function>pg_start_backup</> and in performance between <function>pg_start_backup</> and
<function>pg_stop_backup</>, since <varname>full_page_writes</> is <function>pg_stop_backup</>, since <varname>full_page_writes</> is
effectively forced on during backup mode.) You must ensure that these effectively forced on during backup mode.) You must ensure that these
...@@ -750,7 +750,7 @@ SELECT pg_stop_backup(); ...@@ -750,7 +750,7 @@ SELECT pg_stop_backup();
</para> </para>
<para> <para>
You may, however, omit from the backup dump the files within the You can, however, omit from the backup dump the files within the
<filename>pg_xlog/</> subdirectory of the cluster directory. This <filename>pg_xlog/</> subdirectory of the cluster directory. This
slight complication is worthwhile because it reduces the risk slight complication is worthwhile because it reduces the risk
of mistakes when restoring. This is easy to arrange if of mistakes when restoring. This is easy to arrange if
...@@ -775,7 +775,7 @@ SELECT pg_stop_backup(); ...@@ -775,7 +775,7 @@ SELECT pg_stop_backup();
the file system backup and the WAL segment files used during the the file system backup and the WAL segment files used during the
backup (as specified in the backup history file), all archived WAL backup (as specified in the backup history file), all archived WAL
segments with names numerically less are no longer needed to recover segments with names numerically less are no longer needed to recover
the file system backup and may be deleted. However, you should the file system backup and can be deleted. However, you should
consider keeping several backup sets to be absolutely certain that consider keeping several backup sets to be absolutely certain that
you can recover your data. you can recover your data.
</para> </para>
...@@ -842,7 +842,7 @@ SELECT pg_stop_backup(); ...@@ -842,7 +842,7 @@ SELECT pg_stop_backup();
require that you have enough free space on your system to hold two require that you have enough free space on your system to hold two
copies of your existing database. If you do not have enough space, copies of your existing database. If you do not have enough space,
you need at the least to copy the contents of the <filename>pg_xlog</> you need at the least to copy the contents of the <filename>pg_xlog</>
subdirectory of the cluster data directory, as it may contain logs which subdirectory of the cluster data directory, as it might contain logs which
were not archived before the system went down. were not archived before the system went down.
</para> </para>
</listitem> </listitem>
...@@ -881,7 +881,7 @@ SELECT pg_stop_backup(); ...@@ -881,7 +881,7 @@ SELECT pg_stop_backup();
<listitem> <listitem>
<para> <para>
Create a recovery command file <filename>recovery.conf</> in the cluster Create a recovery command file <filename>recovery.conf</> in the cluster
data directory (see <xref linkend="recovery-config-settings">). You may data directory (see <xref linkend="recovery-config-settings">). You might
also want to temporarily modify <filename>pg_hba.conf</> to prevent also want to temporarily modify <filename>pg_hba.conf</> to prevent
ordinary users from connecting until you are sure the recovery has worked. ordinary users from connecting until you are sure the recovery has worked.
</para> </para>
...@@ -917,7 +917,7 @@ SELECT pg_stop_backup(); ...@@ -917,7 +917,7 @@ SELECT pg_stop_backup();
<filename>recovery.conf</> is the <varname>restore_command</>, <filename>recovery.conf</> is the <varname>restore_command</>,
which tells <productname>PostgreSQL</> how to get back archived which tells <productname>PostgreSQL</> how to get back archived
WAL file segments. Like the <varname>archive_command</>, this is WAL file segments. Like the <varname>archive_command</>, this is
a shell command string. It may contain <literal>%f</>, which is a shell command string. It can contain <literal>%f</>, which is
replaced by the name of the desired log file, and <literal>%p</>, replaced by the name of the desired log file, and <literal>%p</>,
which is replaced by the path name to copy the log file to. which is replaced by the path name to copy the log file to.
(The path name is relative to the working directory of the server, (The path name is relative to the working directory of the server,
...@@ -1228,8 +1228,8 @@ restore_command = 'copy /mnt/server/archivedir/%f "%p"' # Windows ...@@ -1228,8 +1228,8 @@ restore_command = 'copy /mnt/server/archivedir/%f "%p"' # Windows
It should also be noted that the default <acronym>WAL</acronym> It should also be noted that the default <acronym>WAL</acronym>
format is fairly bulky since it includes many disk page snapshots. format is fairly bulky since it includes many disk page snapshots.
These page snapshots are designed to support crash recovery, since These page snapshots are designed to support crash recovery, since
we may need to fix partially-written disk pages. Depending on we might need to fix partially-written disk pages. Depending on
your system hardware and software, the risk of partial writes may your system hardware and software, the risk of partial writes might
be small enough to ignore, in which case you can significantly be small enough to ignore, in which case you can significantly
reduce the total volume of archived logs by turning off page reduce the total volume of archived logs by turning off page
snapshots using the <xref linkend="guc-full-page-writes"> snapshots using the <xref linkend="guc-full-page-writes">
...@@ -1238,7 +1238,7 @@ restore_command = 'copy /mnt/server/archivedir/%f "%p"' # Windows ...@@ -1238,7 +1238,7 @@ restore_command = 'copy /mnt/server/archivedir/%f "%p"' # Windows
use of the logs for PITR operations. An area for future use of the logs for PITR operations. An area for future
development is to compress archived WAL data by removing development is to compress archived WAL data by removing
unnecessary page copies even when <varname>full_page_writes</> is unnecessary page copies even when <varname>full_page_writes</> is
on. In the meantime, administrators may wish to reduce the number on. In the meantime, administrators might wish to reduce the number
of page snapshots included in WAL by increasing the checkpoint of page snapshots included in WAL by increasing the checkpoint
interval parameters as much as feasible. interval parameters as much as feasible.
</para> </para>
...@@ -1522,7 +1522,7 @@ if (!triggered) ...@@ -1522,7 +1522,7 @@ if (!triggered)
connectivity between the two and the viability of the primary. It is connectivity between the two and the viability of the primary. It is
also possible to use a third system (called a witness server) to avoid also possible to use a third system (called a witness server) to avoid
some problems of inappropriate failover, but the additional complexity some problems of inappropriate failover, but the additional complexity
may not be worthwhile unless it is set-up with sufficient care and might not be worthwhile unless it is set-up with sufficient care and
rigorous testing. rigorous testing.
</para> </para>
...@@ -1530,7 +1530,7 @@ if (!triggered) ...@@ -1530,7 +1530,7 @@ if (!triggered)
Once failover to the standby occurs, we have only a Once failover to the standby occurs, we have only a
single server in operation. This is known as a degenerate state. single server in operation. This is known as a degenerate state.
The former standby is now the primary, but the former primary is down The former standby is now the primary, but the former primary is down
and may stay down. To return to normal operation we must and might stay down. To return to normal operation we must
fully recreate a standby server, fully recreate a standby server,
either on the former primary system when it comes up, or on a third, either on the former primary system when it comes up, or on a third,
possibly new, system. Once complete the primary and standby can be possibly new, system. Once complete the primary and standby can be
...@@ -1662,7 +1662,7 @@ if (!triggered) ...@@ -1662,7 +1662,7 @@ if (!triggered)
It is recommended that you use the <application>pg_dump</> and It is recommended that you use the <application>pg_dump</> and
<application>pg_dumpall</> programs from the newer version of <application>pg_dumpall</> programs from the newer version of
<productname>PostgreSQL</>, to take advantage of any enhancements <productname>PostgreSQL</>, to take advantage of any enhancements
that may have been made in these programs. Current releases of the that might have been made in these programs. Current releases of the
dump programs can read data from any server version back to 7.0. dump programs can read data from any server version back to 7.0.
</para> </para>
...@@ -1716,7 +1716,7 @@ psql -f backup postgres ...@@ -1716,7 +1716,7 @@ psql -f backup postgres
<note> <note>
<para> <para>
When you <quote>move the old installation out of the way</quote> When you <quote>move the old installation out of the way</quote>
it may no longer be perfectly usable. Some of the executable programs it might no longer be perfectly usable. Some of the executable programs
contain absolute paths to various installed programs and data files. contain absolute paths to various installed programs and data files.
This is usually not a big problem but if you plan on using two This is usually not a big problem but if you plan on using two
installations in parallel for a while you should assign them installations in parallel for a while you should assign them
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/bki.sgml,v 1.19 2006/09/16 00:30:11 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/bki.sgml,v 1.20 2007/01/31 20:56:16 momjian Exp $ -->
<chapter id="bki"> <chapter id="bki">
<title><acronym>BKI</acronym> Backend Interface</title> <title><acronym>BKI</acronym> Backend Interface</title>
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
</para> </para>
<para> <para>
Related information may be found in the documentation for Related information can be found in the documentation for
<application>initdb</application>. <application>initdb</application>.
</para> </para>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.143 2007/01/22 01:35:19 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.144 2007/01/31 20:56:16 momjian Exp $ -->
<!-- <!--
Documentation of the system catalogs, directed toward PostgreSQL developers Documentation of the system catalogs, directed toward PostgreSQL developers
--> -->
...@@ -523,7 +523,7 @@ ...@@ -523,7 +523,7 @@
The catalog <structname>pg_amop</structname> stores information about The catalog <structname>pg_amop</structname> stores information about
operators associated with access method operator families. There is one operators associated with access method operator families. There is one
row for each operator that is a member of an operator family. An operator row for each operator that is a member of an operator family. An operator
can appear in more than one family, but may not appear in more than one can appear in more than one family, but cannot appear in more than one
position within a family. position within a family.
</para> </para>
...@@ -870,7 +870,7 @@ ...@@ -870,7 +870,7 @@
<entry></entry> <entry></entry>
<entry> <entry>
Always -1 in storage, but when loaded into a row descriptor Always -1 in storage, but when loaded into a row descriptor
in memory this may be updated to cache the offset of the attribute in memory this might be updated to cache the offset of the attribute
within the row within the row
</entry> </entry>
</row> </row>
...@@ -954,7 +954,7 @@ ...@@ -954,7 +954,7 @@
<entry><type>bool</type></entry> <entry><type>bool</type></entry>
<entry></entry> <entry></entry>
<entry> <entry>
This column is defined locally in the relation. Note that a column may This column is defined locally in the relation. Note that a column can
be locally defined and inherited simultaneously be locally defined and inherited simultaneously
</entry> </entry>
</row> </row>
...@@ -998,7 +998,7 @@ ...@@ -998,7 +998,7 @@
database authorization identifiers (roles). A role subsumes the concepts database authorization identifiers (roles). A role subsumes the concepts
of <quote>users</> and <quote>groups</>. A user is essentially just a of <quote>users</> and <quote>groups</>. A user is essentially just a
role with the <structfield>rolcanlogin</> flag set. Any role (with or role with the <structfield>rolcanlogin</> flag set. Any role (with or
without <structfield>rolcanlogin</>) may have other roles as members; see without <structfield>rolcanlogin</>) can have other roles as members; see
<link linkend="catalog-pg-auth-members"><structname>pg_auth_members</structname></link>. <link linkend="catalog-pg-auth-members"><structname>pg_auth_members</structname></link>.
</para> </para>
...@@ -1057,20 +1057,20 @@ ...@@ -1057,20 +1057,20 @@
<row> <row>
<entry><structfield>rolcreaterole</structfield></entry> <entry><structfield>rolcreaterole</structfield></entry>
<entry><type>bool</type></entry> <entry><type>bool</type></entry>
<entry>Role may create more roles</entry> <entry>Role can create more roles</entry>
</row> </row>
<row> <row>
<entry><structfield>rolcreatedb</structfield></entry> <entry><structfield>rolcreatedb</structfield></entry>
<entry><type>bool</type></entry> <entry><type>bool</type></entry>
<entry>Role may create databases</entry> <entry>Role can create databases</entry>
</row> </row>
<row> <row>
<entry><structfield>rolcatupdate</structfield></entry> <entry><structfield>rolcatupdate</structfield></entry>
<entry><type>bool</type></entry> <entry><type>bool</type></entry>
<entry> <entry>
Role may update system catalogs directly. (Even a superuser may not do Role can update system catalogs directly. (Even a superuser cannot do
this unless this column is true) this unless this column is true)
</entry> </entry>
</row> </row>
...@@ -1079,7 +1079,7 @@ ...@@ -1079,7 +1079,7 @@
<entry><structfield>rolcanlogin</structfield></entry> <entry><structfield>rolcanlogin</structfield></entry>
<entry><type>bool</type></entry> <entry><type>bool</type></entry>
<entry> <entry>
Role may log in. That is, this role can be given as the initial Role can log in. That is, this role can be given as the initial
session authorization identifier session authorization identifier
</entry> </entry>
</row> </row>
...@@ -1177,7 +1177,7 @@ ...@@ -1177,7 +1177,7 @@
<entry><structfield>admin_option</structfield></entry> <entry><structfield>admin_option</structfield></entry>
<entry><type>bool</type></entry> <entry><type>bool</type></entry>
<entry></entry> <entry></entry>
<entry>True if <structfield>member</> may grant membership in <entry>True if <structfield>member</> can grant membership in
<structfield>roleid</> to others</entry> <structfield>roleid</> to others</entry>
</row> </row>
</tbody> </tbody>
...@@ -1395,7 +1395,7 @@ ...@@ -1395,7 +1395,7 @@
<entry><type>char</type></entry> <entry><type>char</type></entry>
<entry></entry> <entry></entry>
<entry> <entry>
Indicates what contexts the cast may be invoked in. Indicates what contexts the cast can be invoked in.
<literal>e</> means only as an explicit cast (using <literal>e</> means only as an explicit cast (using
<literal>CAST</> or <literal>::</> syntax). <literal>CAST</> or <literal>::</> syntax).
<literal>a</> means implicitly in assignment <literal>a</> means implicitly in assignment
...@@ -2245,7 +2245,7 @@ ...@@ -2245,7 +2245,7 @@
<para> <para>
In all cases, a <structname>pg_depend</structname> entry indicates that the In all cases, a <structname>pg_depend</structname> entry indicates that the
referenced object may not be dropped without also dropping the dependent referenced object cannot be dropped without also dropping the dependent
object. However, there are several subflavors identified by object. However, there are several subflavors identified by
<structfield>deptype</>: <structfield>deptype</>:
...@@ -2255,8 +2255,8 @@ ...@@ -2255,8 +2255,8 @@
<listitem> <listitem>
<para> <para>
A normal relationship between separately-created objects. The A normal relationship between separately-created objects. The
dependent object may be dropped without affecting the dependent object can be dropped without affecting the
referenced object. The referenced object may only be dropped referenced object. The referenced object can only be dropped
by specifying <literal>CASCADE</>, in which case the dependent by specifying <literal>CASCADE</>, in which case the dependent
object is dropped, too. Example: a table column has a normal object is dropped, too. Example: a table column has a normal
dependency on its data type. dependency on its data type.
...@@ -2311,7 +2311,7 @@ ...@@ -2311,7 +2311,7 @@
</varlistentry> </varlistentry>
</variablelist> </variablelist>
Other dependency flavors may be needed in future. Other dependency flavors might be needed in future.
</para> </para>
</sect1> </sect1>
...@@ -2642,7 +2642,7 @@ ...@@ -2642,7 +2642,7 @@
This is false for internal languages (such as This is false for internal languages (such as
<acronym>SQL</acronym>) and true for user-defined languages. <acronym>SQL</acronym>) and true for user-defined languages.
Currently, <application>pg_dump</application> still uses this Currently, <application>pg_dump</application> still uses this
to determine which languages need to be dumped, but this may be to determine which languages need to be dumped, but this might be
replaced by a different mechanism in the future replaced by a different mechanism in the future
</entry> </entry>
</row> </row>
...@@ -2654,7 +2654,7 @@ ...@@ -2654,7 +2654,7 @@
<entry> <entry>
True if this is a trusted language, which means that it is believed True if this is a trusted language, which means that it is believed
not to grant access to anything outside the normal SQL execution not to grant access to anything outside the normal SQL execution
environment. Only superusers may create functions in untrusted environment. Only superusers can create functions in untrusted
languages languages
</entry> </entry>
</row> </row>
...@@ -2748,7 +2748,7 @@ ...@@ -2748,7 +2748,7 @@
<entry><type>bytea</type></entry> <entry><type>bytea</type></entry>
<entry> <entry>
Actual data stored in the large object. Actual data stored in the large object.
This will never be more than <symbol>LOBLKSIZE</> bytes and may be less This will never be more than <symbol>LOBLKSIZE</> bytes and might be less
</entry> </entry>
</row> </row>
</tbody> </tbody>
...@@ -2759,7 +2759,7 @@ ...@@ -2759,7 +2759,7 @@
Each row of <structname>pg_largeobject</structname> holds data Each row of <structname>pg_largeobject</structname> holds data
for one page of a large object, beginning at for one page of a large object, beginning at
byte offset (<literal>pageno * LOBLKSIZE</>) within the object. The implementation byte offset (<literal>pageno * LOBLKSIZE</>) within the object. The implementation
allows sparse storage: pages may be missing, and may be shorter than allows sparse storage: pages might be missing, and might be shorter than
<literal>LOBLKSIZE</> bytes even if they are not the last page of the object. <literal>LOBLKSIZE</> bytes even if they are not the last page of the object.
Missing regions within a large object read as zeroes. Missing regions within a large object read as zeroes.
</para> </para>
...@@ -3439,7 +3439,7 @@ ...@@ -3439,7 +3439,7 @@
It is <literal>s</literal> for <quote>stable</> functions, It is <literal>s</literal> for <quote>stable</> functions,
whose results (for fixed inputs) do not change within a scan. whose results (for fixed inputs) do not change within a scan.
It is <literal>v</literal> for <quote>volatile</> functions, It is <literal>v</literal> for <quote>volatile</> functions,
whose results may change at any time. (Use <literal>v</literal> also whose results might change at any time. (Use <literal>v</literal> also
for functions with side-effects, so that calls to them cannot get for functions with side-effects, so that calls to them cannot get
optimized away.) optimized away.)
</entry> </entry>
...@@ -3754,7 +3754,7 @@ ...@@ -3754,7 +3754,7 @@
<para> <para>
In all cases, a <structname>pg_shdepend</structname> entry indicates that In all cases, a <structname>pg_shdepend</structname> entry indicates that
the referenced object may not be dropped without also dropping the dependent the referenced object cannot be dropped without also dropping the dependent
object. However, there are several subflavors identified by object. However, there are several subflavors identified by
<structfield>deptype</>: <structfield>deptype</>:
...@@ -3796,7 +3796,7 @@ ...@@ -3796,7 +3796,7 @@
</varlistentry> </varlistentry>
</variablelist> </variablelist>
Other dependency flavors may be needed in future. Note in particular Other dependency flavors might be needed in future. Note in particular
that the current definition only supports roles as referenced objects. that the current definition only supports roles as referenced objects.
</para> </para>
...@@ -3897,7 +3897,7 @@ ...@@ -3897,7 +3897,7 @@
</para> </para>
<para> <para>
Since different kinds of statistics may be appropriate for different Since different kinds of statistics might be appropriate for different
kinds of data, <structname>pg_statistic</structname> is designed not kinds of data, <structname>pg_statistic</structname> is designed not
to assume very much about what sort of statistics it stores. Only to assume very much about what sort of statistics it stores. Only
extremely general statistics (such as nullness) are given dedicated extremely general statistics (such as nullness) are given dedicated
...@@ -3911,7 +3911,7 @@ ...@@ -3911,7 +3911,7 @@
<para> <para>
<structname>pg_statistic</structname> should not be readable by the <structname>pg_statistic</structname> should not be readable by the
public, since even statistical information about a table's contents public, since even statistical information about a table's contents
may be considered sensitive. (Example: minimum and maximum values might be considered sensitive. (Example: minimum and maximum values
of a salary column might be quite interesting.) of a salary column might be quite interesting.)
<link linkend="view-pg-stats"><structname>pg_stats</structname></link> <link linkend="view-pg-stats"><structname>pg_stats</structname></link>
is a publicly readable view on is a publicly readable view on
...@@ -4581,7 +4581,7 @@ ...@@ -4581,7 +4581,7 @@
default expression represented by <structfield>typdefaultbin</>. If default expression represented by <structfield>typdefaultbin</>. If
<structfield>typdefaultbin</> is null and <structfield>typdefault</> is <structfield>typdefaultbin</> is null and <structfield>typdefault</> is
not, then <structfield>typdefault</> is the external representation of not, then <structfield>typdefault</> is the external representation of
the type's default value, which may be fed to the type's input the type's default value, which might be fed to the type's input
converter to produce a constant converter to produce a constant
</para></entry> </para></entry>
</row> </row>
...@@ -4762,7 +4762,7 @@ ...@@ -4762,7 +4762,7 @@
<para> <para>
Cursors are used internally to implement some of the components Cursors are used internally to implement some of the components
of <productname>PostgreSQL</>, such as procedural languages. of <productname>PostgreSQL</>, such as procedural languages.
Therefore, the <structname>pg_cursors</> view may include cursors Therefore, the <structname>pg_cursors</> view might include cursors
that have not been explicitly created by the user. that have not been explicitly created by the user.
</para> </para>
</note> </note>
...@@ -4973,7 +4973,7 @@ ...@@ -4973,7 +4973,7 @@
<para> <para>
<structname>pg_locks</structname> contains one row per active lockable <structname>pg_locks</structname> contains one row per active lockable
object, requested lock mode, and relevant transaction. Thus, the same object, requested lock mode, and relevant transaction. Thus, the same
lockable object may lockable object might
appear many times, if multiple transactions are holding or waiting appear many times, if multiple transactions are holding or waiting
for locks on it. However, an object that currently has no locks on it for locks on it. However, an object that currently has no locks on it
will not appear at all. will not appear at all.
...@@ -5441,14 +5441,14 @@ ...@@ -5441,14 +5441,14 @@
<entry><structfield>rolcreaterole</structfield></entry> <entry><structfield>rolcreaterole</structfield></entry>
<entry><type>bool</type></entry> <entry><type>bool</type></entry>
<entry></entry> <entry></entry>
<entry>Role may create more roles</entry> <entry>Role can create more roles</entry>
</row> </row>
<row> <row>
<entry><structfield>rolcreatedb</structfield></entry> <entry><structfield>rolcreatedb</structfield></entry>
<entry><type>bool</type></entry> <entry><type>bool</type></entry>
<entry></entry> <entry></entry>
<entry>Role may create databases</entry> <entry>Role can create databases</entry>
</row> </row>
<row> <row>
...@@ -5456,7 +5456,7 @@ ...@@ -5456,7 +5456,7 @@
<entry><type>bool</type></entry> <entry><type>bool</type></entry>
<entry></entry> <entry></entry>
<entry> <entry>
Role may update system catalogs directly. (Even a superuser may not do Role can update system catalogs directly. (Even a superuser cannot do
this unless this column is true.) this unless this column is true.)
</entry> </entry>
</row> </row>
...@@ -5466,7 +5466,7 @@ ...@@ -5466,7 +5466,7 @@
<entry><type>bool</type></entry> <entry><type>bool</type></entry>
<entry></entry> <entry></entry>
<entry> <entry>
Role may log in. That is, this role can be given as the initial Role can log in. That is, this role can be given as the initial
session authorization identifier session authorization identifier
</entry> </entry>
</row> </row>
...@@ -5737,7 +5737,7 @@ ...@@ -5737,7 +5737,7 @@
<entry><structfield>usecreatedb</structfield></entry> <entry><structfield>usecreatedb</structfield></entry>
<entry><type>bool</type></entry> <entry><type>bool</type></entry>
<entry></entry> <entry></entry>
<entry>User may create databases</entry> <entry>User can create databases</entry>
</row> </row>
<row> <row>
...@@ -5752,7 +5752,7 @@ ...@@ -5752,7 +5752,7 @@
<entry><type>bool</type></entry> <entry><type>bool</type></entry>
<entry></entry> <entry></entry>
<entry> <entry>
User may update system catalogs. (Even a superuser may not do User can update system catalogs. (Even a superuser cannot do
this unless this column is true.) this unless this column is true.)
</entry> </entry>
</row> </row>
...@@ -6153,7 +6153,7 @@ ...@@ -6153,7 +6153,7 @@
<row> <row>
<entry><structfield>usecreatedb</structfield></entry> <entry><structfield>usecreatedb</structfield></entry>
<entry><type>bool</type></entry> <entry><type>bool</type></entry>
<entry>User may create databases</entry> <entry>User can create databases</entry>
</row> </row>
<row> <row>
...@@ -6166,7 +6166,7 @@ ...@@ -6166,7 +6166,7 @@
<entry><structfield>usecatupd</structfield></entry> <entry><structfield>usecatupd</structfield></entry>
<entry><type>bool</type></entry> <entry><type>bool</type></entry>
<entry> <entry>
User may update system catalogs. (Even a superuser may not do User can update system catalogs. (Even a superuser cannot do
this unless this column is true.) this unless this column is true.)
</entry> </entry>
</row> </row>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/charset.sgml,v 2.80 2007/01/09 22:22:55 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/charset.sgml,v 2.81 2007/01/31 20:56:16 momjian Exp $ -->
<chapter id="charset"> <chapter id="charset">
<title>Localization</> <title>Localization</>
...@@ -155,7 +155,7 @@ initdb --locale=sv_SE ...@@ -155,7 +155,7 @@ initdb --locale=sv_SE
environment variables seen by the server, not by the environment environment variables seen by the server, not by the environment
of any client. Therefore, be careful to configure the correct locale settings of any client. Therefore, be careful to configure the correct locale settings
before starting the server. A consequence of this is that if before starting the server. A consequence of this is that if
client and server are set up in different locales, messages may client and server are set up in different locales, messages might
appear in different languages depending on where they originated. appear in different languages depending on where they originated.
</para> </para>
...@@ -252,7 +252,7 @@ initdb --locale=sv_SE ...@@ -252,7 +252,7 @@ initdb --locale=sv_SE
If locale support doesn't work in spite of the explanation above, If locale support doesn't work in spite of the explanation above,
check that the locale support in your operating system is check that the locale support in your operating system is
correctly configured. To check what locales are installed on your correctly configured. To check what locales are installed on your
system, you may use the command <literal>locale -a</literal> if system, you can use the command <literal>locale -a</literal> if
your operating system provides it. your operating system provides it.
</para> </para>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/client-auth.sgml,v 1.96 2006/11/23 05:39:17 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/client-auth.sgml,v 1.97 2007/01/31 20:56:16 momjian Exp $ -->
<chapter id="client-authentication"> <chapter id="client-authentication">
<title>Client Authentication</title> <title>Client Authentication</title>
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
runs. If all the users of a particular server also have accounts on runs. If all the users of a particular server also have accounts on
the server's machine, it makes sense to assign database user names the server's machine, it makes sense to assign database user names
that match their operating system user names. However, a server that that match their operating system user names. However, a server that
accepts remote connections may have many database users who have no local operating system accepts remote connections might have many database users who have no local operating system
account, and in such cases there need be no connection between account, and in such cases there need be no connection between
database user names and OS user names. database user names and OS user names.
</para> </para>
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
</para> </para>
<para> <para>
A record may have one of the seven formats A record can have one of the seven formats
<synopsis> <synopsis>
local <replaceable>database</replaceable> <replaceable>user</replaceable> <replaceable>auth-method</replaceable> <optional><replaceable>auth-option</replaceable></optional> local <replaceable>database</replaceable> <replaceable>user</replaceable> <replaceable>auth-method</replaceable> <optional><replaceable>auth-option</replaceable></optional>
host <replaceable>database</replaceable> <replaceable>user</replaceable> <replaceable>CIDR-address</replaceable> <replaceable>auth-method</replaceable> <optional><replaceable>auth-option</replaceable></optional> host <replaceable>database</replaceable> <replaceable>user</replaceable> <replaceable>CIDR-address</replaceable> <replaceable>auth-method</replaceable> <optional><replaceable>auth-option</replaceable></optional>
...@@ -256,7 +256,7 @@ hostnossl <replaceable>database</replaceable> <replaceable>user</replaceable> ...@@ -256,7 +256,7 @@ hostnossl <replaceable>database</replaceable> <replaceable>user</replaceable>
<term><replaceable>IP-mask</replaceable></term> <term><replaceable>IP-mask</replaceable></term>
<listitem> <listitem>
<para> <para>
These fields may be used as an alternative to the These fields can be used as an alternative to the
<replaceable>CIDR-address</replaceable> notation. Instead of <replaceable>CIDR-address</replaceable> notation. Instead of
specifying the mask length, the actual mask is specified in a specifying the mask length, the actual mask is specified in a
separate column. For example, <literal>255.0.0.0</> represents an IPv4 separate column. For example, <literal>255.0.0.0</> represents an IPv4
...@@ -517,7 +517,7 @@ host all all 192.168.0.0/16 ident omicron ...@@ -517,7 +517,7 @@ host all all 192.168.0.0/16 ident omicron
# If these are the only three lines for local connections, they will # If these are the only three lines for local connections, they will
# allow local users to connect only to their own databases (databases # allow local users to connect only to their own databases (databases
# with the same name as their database user name) except for administrators # with the same name as their database user name) except for administrators
# and members of role "support", who may connect to all databases. The file # and members of role "support", who can connect to all databases. The file
# $PGDATA/admins contains a list of names of administrators. Passwords # $PGDATA/admins contains a list of names of administrators. Passwords
# are required in all cases. # are required in all cases.
# #
...@@ -559,7 +559,7 @@ local db1,db2,@demodbs all md5 ...@@ -559,7 +559,7 @@ local db1,db2,@demodbs all md5
<literal>trust</> authentication is appropriate and very <literal>trust</> authentication is appropriate and very
convenient for local connections on a single-user workstation. It convenient for local connections on a single-user workstation. It
is usually <emphasis>not</> appropriate by itself on a multiuser is usually <emphasis>not</> appropriate by itself on a multiuser
machine. However, you may be able to use <literal>trust</> even machine. However, you might be able to use <literal>trust</> even
on a multiuser machine, if you restrict access to the server's on a multiuser machine, if you restrict access to the server's
Unix-domain socket file using file-system permissions. To do this, set the Unix-domain socket file using file-system permissions. To do this, set the
<varname>unix_socket_permissions</varname> (and possibly <varname>unix_socket_permissions</varname> (and possibly
...@@ -679,7 +679,7 @@ local db1,db2,@demodbs all md5 ...@@ -679,7 +679,7 @@ local db1,db2,@demodbs all md5
<literal>./configure --with-krb-srvnam=whatever</>. In most environments, <literal>./configure --with-krb-srvnam=whatever</>. In most environments,
this parameter never needs to be changed. However, to support multiple this parameter never needs to be changed. However, to support multiple
<productname>PostgreSQL</> installations on the same host it is necessary. <productname>PostgreSQL</> installations on the same host it is necessary.
Some Kerberos implementations may also require a different service name, Some Kerberos implementations might also require a different service name,
such as Microsoft Active Directory which requires the service name such as Microsoft Active Directory which requires the service name
to be in uppercase (<literal>POSTGRES</literal>). to be in uppercase (<literal>POSTGRES</literal>).
</para> </para>
...@@ -865,7 +865,7 @@ local db1,db2,@demodbs all md5 ...@@ -865,7 +865,7 @@ local db1,db2,@demodbs all md5
as which database user. The same <replaceable>map-name</> can be as which database user. The same <replaceable>map-name</> can be
used repeatedly to specify more user-mappings within a single map. used repeatedly to specify more user-mappings within a single map.
There is no restriction regarding how many database users a given There is no restriction regarding how many database users a given
operating system user may correspond to, nor vice versa. operating system user can correspond to, nor vice versa.
</para> </para>
<para> <para>
...@@ -941,7 +941,7 @@ ldap://ldap.example.net/dc=example,dc=net;EXAMPLE\ ...@@ -941,7 +941,7 @@ ldap://ldap.example.net/dc=example,dc=net;EXAMPLE\
will encrypt only the connection between the PostgreSQL server will encrypt only the connection between the PostgreSQL server
and the LDAP server. The connection between the client and the and the LDAP server. The connection between the client and the
PostgreSQL server is not affected by this setting. To make use of PostgreSQL server is not affected by this setting. To make use of
TLS encryption, you may need to configure the LDAP library prior TLS encryption, you might need to configure the LDAP library prior
to configuring PostgreSQL. Note that encrypted LDAP is available only to configuring PostgreSQL. Note that encrypted LDAP is available only
if the platform's LDAP library supports it. if the platform's LDAP library supports it.
</para> </para>
...@@ -1030,12 +1030,12 @@ FATAL: database "testdb" does not exist ...@@ -1030,12 +1030,12 @@ FATAL: database "testdb" does not exist
</programlisting> </programlisting>
The database you are trying to connect to does not exist. Note that The database you are trying to connect to does not exist. Note that
if you do not specify a database name, it defaults to the database if you do not specify a database name, it defaults to the database
user name, which may or may not be the right thing. user name, which might or might not be the right thing.
</para> </para>
<tip> <tip>
<para> <para>
The server log may contain more information about an The server log might contain more information about an
authentication failure than is reported to the client. If you are authentication failure than is reported to the client. If you are
confused about the reason for a failure, check the log. confused about the reason for a failure, check the log.
</para> </para>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.106 2007/01/25 11:53:50 petere Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.107 2007/01/31 20:56:16 momjian Exp $ -->
<chapter Id="runtime-config"> <chapter Id="runtime-config">
<title>Server Configuration</title> <title>Server Configuration</title>
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<para> <para>
All parameter names are case-insensitive. Every parameter takes a All parameter names are case-insensitive. Every parameter takes a
value of one of four types: Boolean, integer, floating point, value of one of four types: Boolean, integer, floating point,
or string. Boolean values may be written as <literal>ON</literal>, or string. Boolean values can be written as <literal>ON</literal>,
<literal>OFF</literal>, <literal>TRUE</literal>, <literal>OFF</literal>, <literal>TRUE</literal>,
<literal>FALSE</literal>, <literal>YES</literal>, <literal>FALSE</literal>, <literal>YES</literal>,
<literal>NO</literal>, <literal>1</literal>, <literal>0</literal> <literal>NO</literal>, <literal>1</literal>, <literal>0</literal>
...@@ -105,7 +105,7 @@ postgres -c log_connections=yes -c log_destination='syslog' ...@@ -105,7 +105,7 @@ postgres -c log_connections=yes -c log_destination='syslog'
<filename>postgresql.conf</filename>. Note that this means you won't <filename>postgresql.conf</filename>. Note that this means you won't
be able to change the value on-the-fly by editing be able to change the value on-the-fly by editing
<filename>postgresql.conf</filename>, so while the command-line <filename>postgresql.conf</filename>, so while the command-line
method may be convenient, it can cost you flexibility later. method might be convenient, it can cost you flexibility later.
</para> </para>
<para> <para>
...@@ -348,13 +348,13 @@ SET ENABLE_SEQSCAN TO OFF; ...@@ -348,13 +348,13 @@ SET ENABLE_SEQSCAN TO OFF;
<para> <para>
Determines the maximum number of concurrent connections to the Determines the maximum number of concurrent connections to the
database server. The default is typically 100 connections, but database server. The default is typically 100 connections, but
may be less if your kernel settings will not support it (as might be less if your kernel settings will not support it (as
determined during <application>initdb</>). This parameter can determined during <application>initdb</>). This parameter can
only be set at server start. only be set at server start.
</para> </para>
<para> <para>
Increasing this parameter may cause <productname>PostgreSQL</> Increasing this parameter might cause <productname>PostgreSQL</>
to request more <systemitem class="osname">System V</> shared to request more <systemitem class="osname">System V</> shared
memory or semaphores than your operating system's default configuration memory or semaphores than your operating system's default configuration
allows. See <xref linkend="sysvipc"> for information on how to allows. See <xref linkend="sysvipc"> for information on how to
...@@ -519,7 +519,7 @@ SET ENABLE_SEQSCAN TO OFF; ...@@ -519,7 +519,7 @@ SET ENABLE_SEQSCAN TO OFF;
<listitem> <listitem>
<para> <para>
On systems that support the <symbol>TCP_KEEPCNT</symbol> socket option, specifies how On systems that support the <symbol>TCP_KEEPCNT</symbol> socket option, specifies how
many keepalives may be lost before the connection is considered dead. many keepalives can be lost before the connection is considered dead.
A value of zero uses the system default. If <symbol>TCP_KEEPCNT</symbol> is not A value of zero uses the system default. If <symbol>TCP_KEEPCNT</symbol> is not
supported, this parameter must be zero. This parameter is ignored supported, this parameter must be zero. This parameter is ignored
for connections made via a Unix-domain socket. for connections made via a Unix-domain socket.
...@@ -704,7 +704,7 @@ SET ENABLE_SEQSCAN TO OFF; ...@@ -704,7 +704,7 @@ SET ENABLE_SEQSCAN TO OFF;
<para> <para>
Sets the amount of memory the database server uses for shared Sets the amount of memory the database server uses for shared
memory buffers. The default is typically 32 megabytes memory buffers. The default is typically 32 megabytes
(<literal>32MB</>), but may be less if your kernel settings will (<literal>32MB</>), but might be less if your kernel settings will
not support it (as determined during <application>initdb</>). not support it (as determined during <application>initdb</>).
This setting must be at least 128 kilobytes and at least 16 This setting must be at least 128 kilobytes and at least 16
kilobytes times <xref linkend="guc-max-connections">. (Non-default kilobytes times <xref linkend="guc-max-connections">. (Non-default
...@@ -716,7 +716,7 @@ SET ENABLE_SEQSCAN TO OFF; ...@@ -716,7 +716,7 @@ SET ENABLE_SEQSCAN TO OFF;
</para> </para>
<para> <para>
Increasing this parameter may cause <productname>PostgreSQL</> Increasing this parameter might cause <productname>PostgreSQL</>
to request more <systemitem class="osname">System V</> shared to request more <systemitem class="osname">System V</> shared
memory than your operating system's default configuration memory than your operating system's default configuration
allows. See <xref linkend="sysvipc"> for information on how to allows. See <xref linkend="sysvipc"> for information on how to
...@@ -779,7 +779,7 @@ SET ENABLE_SEQSCAN TO OFF; ...@@ -779,7 +779,7 @@ SET ENABLE_SEQSCAN TO OFF;
</para> </para>
<para> <para>
Increasing this parameter may cause <productname>PostgreSQL</> Increasing this parameter might cause <productname>PostgreSQL</>
to request more <systemitem class="osname">System V</> shared to request more <systemitem class="osname">System V</> shared
memory than your operating system's default configuration memory than your operating system's default configuration
allows. See <xref linkend="sysvipc"> for information on how to allows. See <xref linkend="sysvipc"> for information on how to
...@@ -827,7 +827,7 @@ SET ENABLE_SEQSCAN TO OFF; ...@@ -827,7 +827,7 @@ SET ENABLE_SEQSCAN TO OFF;
operations can be executed at a time by a database session, and operations can be executed at a time by a database session, and
an installation normally doesn't have many of them running an installation normally doesn't have many of them running
concurrently, it's safe to set this value significantly larger concurrently, it's safe to set this value significantly larger
than <varname>work_mem</varname>. Larger settings may improve than <varname>work_mem</varname>. Larger settings might improve
performance for vacuuming and for restoring database dumps. performance for vacuuming and for restoring database dumps.
</para> </para>
</listitem> </listitem>
...@@ -848,7 +848,7 @@ SET ENABLE_SEQSCAN TO OFF; ...@@ -848,7 +848,7 @@ SET ENABLE_SEQSCAN TO OFF;
routine in the server, but only in key potentially-recursive routines routine in the server, but only in key potentially-recursive routines
such as expression evaluation. The default setting is two such as expression evaluation. The default setting is two
megabytes (<literal>2MB</>), which is conservatively small and megabytes (<literal>2MB</>), which is conservatively small and
unlikely to risk crashes. However, it may be too small to allow unlikely to risk crashes. However, it might be too small to allow
execution of complex functions. Only superusers can change this execution of complex functions. Only superusers can change this
setting. setting.
</para> </para>
...@@ -877,7 +877,7 @@ SET ENABLE_SEQSCAN TO OFF; ...@@ -877,7 +877,7 @@ SET ENABLE_SEQSCAN TO OFF;
<para> <para>
These parameters control the size of the shared <firstterm>free space These parameters control the size of the shared <firstterm>free space
map</>, which tracks the locations of unused space in the database. map</>, which tracks the locations of unused space in the database.
An undersized free space map may cause the database to consume An undersized free space map can cause the database to consume
increasing amounts of disk space over time, because free space that increasing amounts of disk space over time, because free space that
is not in the map cannot be re-used; instead <productname>PostgreSQL</> is not in the map cannot be re-used; instead <productname>PostgreSQL</>
will request more disk space from the operating system when it needs will request more disk space from the operating system when it needs
...@@ -889,7 +889,7 @@ SET ENABLE_SEQSCAN TO OFF; ...@@ -889,7 +889,7 @@ SET ENABLE_SEQSCAN TO OFF;
</para> </para>
<para> <para>
Increasing these parameters may cause <productname>PostgreSQL</> Increasing these parameters might cause <productname>PostgreSQL</>
to request more <systemitem class="osname">System V</> shared to request more <systemitem class="osname">System V</> shared
memory than your operating system's default configuration memory than your operating system's default configuration
allows. See <xref linkend="sysvipc"> for information on how to allows. See <xref linkend="sysvipc"> for information on how to
...@@ -985,7 +985,7 @@ SET ENABLE_SEQSCAN TO OFF; ...@@ -985,7 +985,7 @@ SET ENABLE_SEQSCAN TO OFF;
<para> <para>
By preloading a shared library, the library startup time is avoided By preloading a shared library, the library startup time is avoided
when the library is first used. However, the time to start each new when the library is first used. However, the time to start each new
server process may increase slightly, even if that process never server process might increase slightly, even if that process never
uses the library. So this parameter is recommended only for uses the library. So this parameter is recommended only for
libraries that will be used in most sessions. libraries that will be used in most sessions.
</para> </para>
...@@ -1058,7 +1058,7 @@ SET ENABLE_SEQSCAN TO OFF; ...@@ -1058,7 +1058,7 @@ SET ENABLE_SEQSCAN TO OFF;
Note that on many systems, the effective resolution Note that on many systems, the effective resolution
of sleep delays is 10 milliseconds; setting of sleep delays is 10 milliseconds; setting
<varname>vacuum_cost_delay</varname> to a value that is <varname>vacuum_cost_delay</varname> to a value that is
not a multiple of 10 may have the same results as setting it not a multiple of 10 might have the same results as setting it
to the next higher multiple of 10. to the next higher multiple of 10.
</para> </para>
</listitem> </listitem>
...@@ -1176,7 +1176,7 @@ SET ENABLE_SEQSCAN TO OFF; ...@@ -1176,7 +1176,7 @@ SET ENABLE_SEQSCAN TO OFF;
(<literal>200ms</>). Note that on many systems, the effective (<literal>200ms</>). Note that on many systems, the effective
resolution of sleep delays is 10 milliseconds; setting resolution of sleep delays is 10 milliseconds; setting
<varname>bgwriter_delay</> to a value that is not a multiple of <varname>bgwriter_delay</> to a value that is not a multiple of
10 may have the same results as setting it to the next higher 10 might have the same results as setting it to the next higher
multiple of 10. This parameter can only be set in the multiple of 10. This parameter can only be set in the
<filename>postgresql.conf</> file or on the server command line. <filename>postgresql.conf</> file or on the server command line.
</para> </para>
...@@ -1313,8 +1313,8 @@ SET ENABLE_SEQSCAN TO OFF; ...@@ -1313,8 +1313,8 @@ SET ENABLE_SEQSCAN TO OFF;
allowed to do its best in buffering, ordering, and delaying allowed to do its best in buffering, ordering, and delaying
writes. This can result in significantly improved performance. writes. This can result in significantly improved performance.
However, if the system crashes, the results of the last few However, if the system crashes, the results of the last few
committed transactions may be lost in part or whole. In the committed transactions might be lost in part or whole. In the
worst case, unrecoverable data corruption may occur. worst case, unrecoverable data corruption might occur.
(Crashes of the database software itself are <emphasis>not</> (Crashes of the database software itself are <emphasis>not</>
a risk factor here. Only an operating-system-level crash a risk factor here. Only an operating-system-level crash
creates a risk of corruption.) creates a risk of corruption.)
...@@ -1419,7 +1419,7 @@ SET ENABLE_SEQSCAN TO OFF; ...@@ -1419,7 +1419,7 @@ SET ENABLE_SEQSCAN TO OFF;
Turning this parameter off speeds normal operation, but Turning this parameter off speeds normal operation, but
might lead to a corrupt database after an operating system crash might lead to a corrupt database after an operating system crash
or power failure. The risks are similar to turning off or power failure. The risks are similar to turning off
<varname>fsync</>, though smaller. It may be safe to turn off <varname>fsync</>, though smaller. It might be safe to turn off
this parameter if you have hardware (such as a battery-backed disk this parameter if you have hardware (such as a battery-backed disk
controller) or file-system software that reduces controller) or file-system software that reduces
the risk of partial page writes to an acceptably low level (e.g., ReiserFS 4). the risk of partial page writes to an acceptably low level (e.g., ReiserFS 4).
...@@ -1455,7 +1455,7 @@ SET ENABLE_SEQSCAN TO OFF; ...@@ -1455,7 +1455,7 @@ SET ENABLE_SEQSCAN TO OFF;
</para> </para>
<para> <para>
Increasing this parameter may cause <productname>PostgreSQL</> Increasing this parameter might cause <productname>PostgreSQL</>
to request more <systemitem class="osname">System V</> shared to request more <systemitem class="osname">System V</> shared
memory than your operating system's default configuration memory than your operating system's default configuration
allows. See <xref linkend="sysvipc"> for information on how to allows. See <xref linkend="sysvipc"> for information on how to
...@@ -1635,7 +1635,7 @@ archive_command = 'copy "%p" /mnt/server/archivedir/"%f"' # Windows ...@@ -1635,7 +1635,7 @@ archive_command = 'copy "%p" /mnt/server/archivedir/"%f"' # Windows
These configuration parameters provide a crude method of These configuration parameters provide a crude method of
influencing the query plans chosen by the query optimizer. If influencing the query plans chosen by the query optimizer. If
the default plan chosen by the optimizer for a particular query the default plan chosen by the optimizer for a particular query
is not optimal, a temporary solution may be found by using one is not optimal, a temporary solution can be found by using one
of these configuration parameters to force the optimizer to of these configuration parameters to force the optimizer to
choose a different plan. Turning one of these settings off choose a different plan. Turning one of these settings off
permanently is seldom a good idea, however. permanently is seldom a good idea, however.
...@@ -2070,7 +2070,7 @@ archive_command = 'copy "%p" /mnt/server/archivedir/"%f"' # Windows ...@@ -2070,7 +2070,7 @@ archive_command = 'copy "%p" /mnt/server/archivedir/"%f"' # Windows
Sets the default statistics target for table columns that have Sets the default statistics target for table columns that have
not had a column-specific target set via <command>ALTER TABLE not had a column-specific target set via <command>ALTER TABLE
SET STATISTICS</>. Larger values increase the time needed to SET STATISTICS</>. Larger values increase the time needed to
do <command>ANALYZE</>, but may improve the quality of the do <command>ANALYZE</>, but might improve the quality of the
planner's estimates. The default is 10. For more information planner's estimates. The default is 10. For more information
on the use of statistics by the <productname>PostgreSQL</> on the use of statistics by the <productname>PostgreSQL</>
query planner, refer to <xref linkend="planner-stats">. query planner, refer to <xref linkend="planner-stats">.
...@@ -2143,7 +2143,7 @@ SELECT * FROM parent WHERE key = 2400; ...@@ -2143,7 +2143,7 @@ SELECT * FROM parent WHERE key = 2400;
<para> <para>
The planner will merge sub-queries into upper queries if the The planner will merge sub-queries into upper queries if the
resulting <literal>FROM</literal> list would have no more than resulting <literal>FROM</literal> list would have no more than
this many items. Smaller values reduce planning time but may this many items. Smaller values reduce planning time but might
yield inferior query plans. The default is eight. It is usually yield inferior query plans. The default is eight. It is usually
wise to keep this less than <xref linkend="guc-geqo-threshold">. wise to keep this less than <xref linkend="guc-geqo-threshold">.
For more information see <xref linkend="explicit-joins">. For more information see <xref linkend="explicit-joins">.
...@@ -2161,7 +2161,7 @@ SELECT * FROM parent WHERE key = 2400; ...@@ -2161,7 +2161,7 @@ SELECT * FROM parent WHERE key = 2400;
The planner will rewrite explicit <literal>JOIN</> The planner will rewrite explicit <literal>JOIN</>
constructs (except <literal>FULL JOIN</>s) into lists of constructs (except <literal>FULL JOIN</>s) into lists of
<literal>FROM</> items whenever a list of no more than this many items <literal>FROM</> items whenever a list of no more than this many items
would result. Smaller values reduce planning time but may would result. Smaller values reduce planning time but might
yield inferior query plans. yield inferior query plans.
</para> </para>
...@@ -2172,7 +2172,7 @@ SELECT * FROM parent WHERE key = 2400; ...@@ -2172,7 +2172,7 @@ SELECT * FROM parent WHERE key = 2400;
explicit <literal>JOIN</>s. Thus, the explicit join order explicit <literal>JOIN</>s. Thus, the explicit join order
specified in the query will be the actual order in which the specified in the query will be the actual order in which the
relations are joined. The query planner does not always choose relations are joined. The query planner does not always choose
the optimal join order; advanced users may elect to the optimal join order; advanced users can elect to
temporarily set this variable to 1, and then specify the join temporarily set this variable to 1, and then specify the join
order they desire explicitly. order they desire explicitly.
For more information see <xref linkend="explicit-joins">. For more information see <xref linkend="explicit-joins">.
...@@ -2233,7 +2233,7 @@ SELECT * FROM parent WHERE key = 2400; ...@@ -2233,7 +2233,7 @@ SELECT * FROM parent WHERE key = 2400;
This method, in combination with logging to <application>stderr</>, This method, in combination with logging to <application>stderr</>,
is often more useful than is often more useful than
logging to <application>syslog</>, since some types of messages logging to <application>syslog</>, since some types of messages
may not appear in <application>syslog</> output (a common example might not appear in <application>syslog</> output (a common example
is dynamic-linker failure messages). is dynamic-linker failure messages).
This parameter can only be set at server start. This parameter can only be set at server start.
</para> </para>
...@@ -2249,7 +2249,7 @@ SELECT * FROM parent WHERE key = 2400; ...@@ -2249,7 +2249,7 @@ SELECT * FROM parent WHERE key = 2400;
<para> <para>
When <varname>redirect_stderr</> is enabled, this parameter When <varname>redirect_stderr</> is enabled, this parameter
determines the directory in which log files will be created. determines the directory in which log files will be created.
It may be specified as an absolute path, or relative to the It can be specified as an absolute path, or relative to the
cluster data directory. cluster data directory.
This parameter can only be set in the <filename>postgresql.conf</> This parameter can only be set in the <filename>postgresql.conf</>
file or on the server command line. file or on the server command line.
...@@ -2353,7 +2353,7 @@ SELECT * FROM parent WHERE key = 2400; ...@@ -2353,7 +2353,7 @@ SELECT * FROM parent WHERE key = 2400;
<varname>log_rotation_age</varname> to <literal>60</literal>, and <varname>log_rotation_age</varname> to <literal>60</literal>, and
<varname>log_rotation_size</varname> to <literal>1000000</literal>. <varname>log_rotation_size</varname> to <literal>1000000</literal>.
Including <literal>%M</> in <varname>log_filename</varname> allows Including <literal>%M</> in <varname>log_filename</varname> allows
any size-driven rotations that may occur to select a file name any size-driven rotations that might occur to select a file name
different from the hour's initial file name. different from the hour's initial file name.
</para> </para>
</listitem> </listitem>
...@@ -2368,7 +2368,7 @@ SELECT * FROM parent WHERE key = 2400; ...@@ -2368,7 +2368,7 @@ SELECT * FROM parent WHERE key = 2400;
<para> <para>
When logging to <application>syslog</> is enabled, this parameter When logging to <application>syslog</> is enabled, this parameter
determines the <application>syslog</application> determines the <application>syslog</application>
<quote>facility</quote> to be used. You may choose <quote>facility</quote> to be used. You can choose
from <literal>LOCAL0</>, <literal>LOCAL1</>, from <literal>LOCAL0</>, <literal>LOCAL1</>,
<literal>LOCAL2</>, <literal>LOCAL3</>, <literal>LOCAL4</>, <literal>LOCAL2</>, <literal>LOCAL3</>, <literal>LOCAL4</>,
<literal>LOCAL5</>, <literal>LOCAL6</>, <literal>LOCAL7</>; <literal>LOCAL5</>, <literal>LOCAL6</>, <literal>LOCAL7</>;
...@@ -2580,7 +2580,7 @@ SELECT * FROM parent WHERE key = 2400; ...@@ -2580,7 +2580,7 @@ SELECT * FROM parent WHERE key = 2400;
<term><literal>NOTICE</literal></term> <term><literal>NOTICE</literal></term>
<listitem> <listitem>
<para> <para>
Provides information that may be helpful to users, e.g., Provides information that might be helpful to users, e.g.,
truncation of long identifiers and the creation of indexes as part truncation of long identifiers and the creation of indexes as part
of primary keys. of primary keys.
</para> </para>
...@@ -3010,7 +3010,7 @@ SELECT * FROM parent WHERE key = 2400; ...@@ -3010,7 +3010,7 @@ SELECT * FROM parent WHERE key = 2400;
<para> <para>
Controls whether the server should start the Controls whether the server should start the
statistics-collection subprocess. This is on by default, but statistics-collection subprocess. This is on by default, but
may be turned off if you know you have no interest in can be turned off if you know you have no interest in
collecting statistics or running autovacuum. collecting statistics or running autovacuum.
This parameter can only be set at server start, because the collection This parameter can only be set at server start, because the collection
subprocess cannot be started or stopped on-the-fly. (However, the subprocess cannot be started or stopped on-the-fly. (However, the
...@@ -3773,7 +3773,7 @@ SET XML OPTION { DOCUMENT | CONTENT }; ...@@ -3773,7 +3773,7 @@ SET XML OPTION { DOCUMENT | CONTENT };
<listitem> <listitem>
<para> <para>
Sets the locale to use for formatting date and time values. Sets the locale to use for formatting date and time values.
(Currently, this setting does nothing, but it may in the (Currently, this setting does nothing, but it might in the
future.) Acceptable values are system-dependent; see <xref future.) Acceptable values are system-dependent; see <xref
linkend="locale"> for more information. If this variable is linkend="locale"> for more information. If this variable is
set to the empty string (which is the default) then the value set to the empty string (which is the default) then the value
...@@ -3992,7 +3992,7 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir' ...@@ -3992,7 +3992,7 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
</para> </para>
<para> <para>
Increasing this parameter may cause <productname>PostgreSQL</> Increasing this parameter might cause <productname>PostgreSQL</>
to request more <systemitem class="osname">System V</> shared to request more <systemitem class="osname">System V</> shared
memory than your operating system's default configuration memory than your operating system's default configuration
allows. See <xref linkend="sysvipc"> for information on how to allows. See <xref linkend="sysvipc"> for information on how to
...@@ -4167,7 +4167,7 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir' ...@@ -4167,7 +4167,7 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
The regular expression <quote>flavor</> can be set to The regular expression <quote>flavor</> can be set to
<literal>advanced</>, <literal>extended</>, or <literal>basic</>. <literal>advanced</>, <literal>extended</>, or <literal>basic</>.
The default is <literal>advanced</>. The <literal>extended</> The default is <literal>advanced</>. The <literal>extended</>
setting may be useful for exact backwards compatibility with setting might be useful for exact backwards compatibility with
pre-7.4 releases of <productname>PostgreSQL</>. See pre-7.4 releases of <productname>PostgreSQL</>. See
<xref linkend="posix-syntax-details"> for details. <xref linkend="posix-syntax-details"> for details.
</para> </para>
...@@ -4207,7 +4207,7 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir' ...@@ -4207,7 +4207,7 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
behavior of treating backslashes as escape characters. behavior of treating backslashes as escape characters.
The default will change to <literal>on</> in a future release The default will change to <literal>on</> in a future release
to improve compatibility with the standard. to improve compatibility with the standard.
Applications may check this Applications can check this
parameter to determine how string literals will be processed. parameter to determine how string literals will be processed.
The presence of this parameter can also be taken as an indication The presence of this parameter can also be taken as an indication
that the escape string syntax (<literal>E'...'</>) is supported. that the escape string syntax (<literal>E'...'</>) is supported.
...@@ -4284,7 +4284,7 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir' ...@@ -4284,7 +4284,7 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
installed. As such, they have been excluded from the sample installed. As such, they have been excluded from the sample
<filename>postgresql.conf</> file. These options report <filename>postgresql.conf</> file. These options report
various aspects of <productname>PostgreSQL</productname> behavior various aspects of <productname>PostgreSQL</productname> behavior
that may be of interest to certain applications, particularly that might be of interest to certain applications, particularly
administrative front-ends. administrative front-ends.
</para> </para>
...@@ -4677,7 +4677,7 @@ plruby.use_strict = true # generates error: unknown class name ...@@ -4677,7 +4677,7 @@ plruby.use_strict = true # generates error: unknown class name
the system to instead report a warning, zero out the damaged page, the system to instead report a warning, zero out the damaged page,
and continue processing. This behavior <emphasis>will destroy data</>, and continue processing. This behavior <emphasis>will destroy data</>,
namely all the rows on the damaged page. But it allows you to get namely all the rows on the damaged page. But it allows you to get
past the error and retrieve rows from any undamaged pages that may past the error and retrieve rows from any undamaged pages that might
be present in the table. So it is useful for recovering data if be present in the table. So it is useful for recovering data if
corruption has occurred due to hardware or software error. You should corruption has occurred due to hardware or software error. You should
generally not set this on until you have given up hope of recovering generally not set this on until you have given up hope of recovering
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/cvs.sgml,v 1.39 2006/11/17 05:29:46 neilc Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/cvs.sgml,v 1.40 2007/01/31 20:56:16 momjian Exp $ -->
<appendix id="cvs"> <appendix id="cvs">
<appendixinfo> <appendixinfo>
...@@ -88,7 +88,7 @@ cvs -z3 -d :pserver:anoncvs@anoncvs.postgresql.org:/projects/cvsroot co -P pgsql ...@@ -88,7 +88,7 @@ cvs -z3 -d :pserver:anoncvs@anoncvs.postgresql.org:/projects/cvsroot co -P pgsql
<note> <note>
<para> <para>
If you have a fast link to the Internet, you may not need If you have a fast link to the Internet, you might not need
<option>-z3</option>, which instructs <option>-z3</option>, which instructs
<productname>CVS</productname> to use <command>gzip</command> compression for transferred data. But <productname>CVS</productname> to use <command>gzip</command> compression for transferred data. But
on a modem-speed link, it's a very substantial win. on a modem-speed link, it's a very substantial win.
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.188 2007/01/30 22:29:22 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.189 2007/01/31 20:56:16 momjian Exp $ -->
<chapter id="datatype"> <chapter id="datatype">
<title id="datatype-title">Data Types</title> <title id="datatype-title">Data Types</title>
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<para> <para>
<productname>PostgreSQL</productname> has a rich set of native data <productname>PostgreSQL</productname> has a rich set of native data
types available to users. Users may add new types to types available to users. Users can add new types to
<productname>PostgreSQL</productname> using the <xref <productname>PostgreSQL</productname> using the <xref
linkend="sql-createtype" endterm="sql-createtype-title"> command. linkend="sql-createtype" endterm="sql-createtype-title"> command.
</para> </para>
...@@ -267,7 +267,7 @@ ...@@ -267,7 +267,7 @@
paths, or have several possibilities for formats, such as the date paths, or have several possibilities for formats, such as the date
and time types. and time types.
Some of the input and output functions are not invertible. That is, Some of the input and output functions are not invertible. That is,
the result of an output function may lose accuracy when compared to the result of an output function might lose accuracy when compared to
the original input. the original input.
</para> </para>
...@@ -416,7 +416,7 @@ ...@@ -416,7 +416,7 @@
</para> </para>
<para> <para>
The <type>bigint</type> type may not function correctly on all The <type>bigint</type> type might not function correctly on all
platforms, since it relies on compiler support for eight-byte platforms, since it relies on compiler support for eight-byte
integers. On a machine without such support, <type>bigint</type> integers. On a machine without such support, <type>bigint</type>
acts the same as <type>integer</type> (but still takes up eight acts the same as <type>integer</type> (but still takes up eight
...@@ -597,7 +597,7 @@ NUMERIC ...@@ -597,7 +597,7 @@ NUMERIC
<para> <para>
Inexact means that some values cannot be converted exactly to the Inexact means that some values cannot be converted exactly to the
internal format and are stored as approximations, so that storing internal format and are stored as approximations, so that storing
and printing back out a value may show slight discrepancies. and printing back out a value might show slight discrepancies.
Managing these errors and how they propagate through calculations Managing these errors and how they propagate through calculations
is the subject of an entire branch of mathematics and computer is the subject of an entire branch of mathematics and computer
science and will not be discussed further here, except for the science and will not be discussed further here, except for the
...@@ -621,7 +621,7 @@ NUMERIC ...@@ -621,7 +621,7 @@ NUMERIC
<listitem> <listitem>
<para> <para>
Comparing two floating-point values for equality may or may Comparing two floating-point values for equality might or might
not work as expected. not work as expected.
</para> </para>
</listitem> </listitem>
...@@ -633,7 +633,7 @@ NUMERIC ...@@ -633,7 +633,7 @@ NUMERIC
1E-37 to 1E+37 with a precision of at least 6 decimal digits. The 1E-37 to 1E+37 with a precision of at least 6 decimal digits. The
<type>double precision</type> type typically has a range of around <type>double precision</type> type typically has a range of around
1E-307 to 1E+308 with a precision of at least 15 digits. Values that 1E-307 to 1E+308 with a precision of at least 15 digits. Values that
are too large or too small will cause an error. Rounding may are too large or too small will cause an error. Rounding might
take place if the precision of an input number is too high. take place if the precision of an input number is too high.
Numbers too close to zero that are not representable as distinct Numbers too close to zero that are not representable as distinct
from zero will cause an underflow error. from zero will cause an underflow error.
...@@ -698,7 +698,7 @@ NUMERIC ...@@ -698,7 +698,7 @@ NUMERIC
digits. The assumption that <type>real</type> and digits. The assumption that <type>real</type> and
<type>double precision</type> have exactly 24 and 53 bits in the <type>double precision</type> have exactly 24 and 53 bits in the
mantissa respectively is correct for IEEE-standard floating point mantissa respectively is correct for IEEE-standard floating point
implementations. On non-IEEE platforms it may be off a little, but implementations. On non-IEEE platforms it might be off a little, but
for simplicity the same ranges of <replaceable>p</replaceable> are used for simplicity the same ranges of <replaceable>p</replaceable> are used
on all platforms. on all platforms.
</para> </para>
...@@ -978,7 +978,7 @@ ALTER SEQUENCE <replaceable class="parameter">tablename</replaceable>_<replaceab ...@@ -978,7 +978,7 @@ ALTER SEQUENCE <replaceable class="parameter">tablename</replaceable>_<replaceab
The storage requirement for data of these types is 4 bytes plus the The storage requirement for data of these types is 4 bytes plus the
actual string, and in case of <type>character</type> plus the actual string, and in case of <type>character</type> plus the
padding. Long strings are compressed by the system automatically, so padding. Long strings are compressed by the system automatically, so
the physical requirement on disk may be less. Long values are also the physical requirement on disk might be less. Long values are also
stored in background tables so they do not interfere with rapid stored in background tables so they do not interfere with rapid
access to the shorter column values. In any case, the longest access to the shorter column values. In any case, the longest
possible character string that can be stored is about 1 GB. (The possible character string that can be stored is about 1 GB. (The
...@@ -1060,7 +1060,7 @@ SELECT b, char_length(b) FROM test2; ...@@ -1060,7 +1060,7 @@ SELECT b, char_length(b) FROM test2;
terminator) but should be referenced using the constant terminator) but should be referenced using the constant
<symbol>NAMEDATALEN</symbol>. The length is set at compile time (and <symbol>NAMEDATALEN</symbol>. The length is set at compile time (and
is therefore adjustable for special uses); the default maximum is therefore adjustable for special uses); the default maximum
length may change in a future release. The type <type>"char"</type> length might change in a future release. The type <type>"char"</type>
(note the quotes) is different from <type>char(1)</type> in that it (note the quotes) is different from <type>char(1)</type> in that it
only uses one byte of storage. It is internally used in the system only uses one byte of storage. It is internally used in the system
catalogs as a poor-man's enumeration type. catalogs as a poor-man's enumeration type.
...@@ -1293,8 +1293,8 @@ SELECT b, char_length(b) FROM test2; ...@@ -1293,8 +1293,8 @@ SELECT b, char_length(b) FROM test2;
<para> <para>
Depending on the front end to <productname>PostgreSQL</> you use, Depending on the front end to <productname>PostgreSQL</> you use,
you may have additional work to do in terms of escaping and you might have additional work to do in terms of escaping and
unescaping <type>bytea</type> strings. For example, you may also unescaping <type>bytea</type> strings. For example, you might also
have to escape line feeds and carriage returns if your interface have to escape line feeds and carriage returns if your interface
automatically translates these. automatically translates these.
</para> </para>
...@@ -1436,7 +1436,7 @@ SELECT b, char_length(b) FROM test2; ...@@ -1436,7 +1436,7 @@ SELECT b, char_length(b) FROM test2;
<para> <para>
When <type>timestamp</> values are stored as double precision floating-point When <type>timestamp</> values are stored as double precision floating-point
numbers (currently the default), the effective limit of precision numbers (currently the default), the effective limit of precision
may be less than 6. <type>timestamp</type> values are stored as seconds might be less than 6. <type>timestamp</type> values are stored as seconds
before or after midnight 2000-01-01. Microsecond precision is achieved for before or after midnight 2000-01-01. Microsecond precision is achieved for
dates within a few years of 2000-01-01, but the precision degrades for dates within a few years of 2000-01-01, but the precision degrades for
dates further away. When <type>timestamp</type> values are stored as dates further away. When <type>timestamp</type> values are stored as
...@@ -2166,7 +2166,7 @@ January 8 04:05:06 1999 PST ...@@ -2166,7 +2166,7 @@ January 8 04:05:06 1999 PST
<type>time</type> type can. <type>time</type> type can.
Time zones in the real world have little meaning unless Time zones in the real world have little meaning unless
associated with a date as well as a time, associated with a date as well as a time,
since the offset may vary through the year with daylight-saving since the offset can vary through the year with daylight-saving
time boundaries. time boundaries.
</para> </para>
</listitem> </listitem>
...@@ -2220,7 +2220,7 @@ January 8 04:05:06 1999 PST ...@@ -2220,7 +2220,7 @@ January 8 04:05:06 1999 PST
<para> <para>
A time zone abbreviation, for example <literal>PST</>. Such a A time zone abbreviation, for example <literal>PST</>. Such a
specification merely defines a particular offset from UTC, in specification merely defines a particular offset from UTC, in
contrast to full time zone names which may imply a set of daylight contrast to full time zone names which might imply a set of daylight
savings transition-date rules as well. The recognized abbreviations savings transition-date rules as well. The recognized abbreviations
are listed in the <literal>pg_timezone_abbrevs</> view (see <xref are listed in the <literal>pg_timezone_abbrevs</> view (see <xref
linkend="view-pg-timezone-abbrevs">). You cannot set the linkend="view-pg-timezone-abbrevs">). You cannot set the
...@@ -3374,14 +3374,14 @@ SELECT * FROM pg_attribute ...@@ -3374,14 +3374,14 @@ SELECT * FROM pg_attribute
</table> </table>
<para> <para>
Functions coded in C (whether built-in or dynamically loaded) may be Functions coded in C (whether built-in or dynamically loaded) can be
declared to accept or return any of these pseudo data types. It is up to declared to accept or return any of these pseudo data types. It is up to
the function author to ensure that the function will behave safely the function author to ensure that the function will behave safely
when a pseudo-type is used as an argument type. when a pseudo-type is used as an argument type.
</para> </para>
<para> <para>
Functions coded in procedural languages may use pseudo-types only as Functions coded in procedural languages can use pseudo-types only as
allowed by their implementation languages. At present the procedural allowed by their implementation languages. At present the procedural
languages all forbid use of a pseudo-type as argument type, and allow languages all forbid use of a pseudo-type as argument type, and allow
only <type>void</> and <type>record</> as a result type (plus only <type>void</> and <type>record</> as a result type (plus
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/datetime.sgml,v 2.55 2006/10/17 21:03:20 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/datetime.sgml,v 2.56 2007/01/31 20:56:16 momjian Exp $ -->
<appendix id="datetime-appendix"> <appendix id="datetime-appendix">
<title>Date/Time Support</title> <title>Date/Time Support</title>
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<productname>PostgreSQL</productname> uses an internal heuristic <productname>PostgreSQL</productname> uses an internal heuristic
parser for all date/time input support. Dates and times are input as parser for all date/time input support. Dates and times are input as
strings, and are broken up into distinct fields with a preliminary strings, and are broken up into distinct fields with a preliminary
determination of what kind of information may be in the determination of what kind of information can be in the
field. Each field is interpreted and either assigned a numeric field. Each field is interpreted and either assigned a numeric
value, ignored, or rejected. value, ignored, or rejected.
The parser contains internal lookup tables for all textual fields, The parser contains internal lookup tables for all textual fields,
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
<para> <para>
If the numeric token contains a dash (<literal>-</>), slash If the numeric token contains a dash (<literal>-</>), slash
(<literal>/</>), or two or more dots (<literal>.</>), this is (<literal>/</>), or two or more dots (<literal>.</>), this is
a date string which may have a text month. If a date token has a date string which might have a text month. If a date token has
already been seen, it is instead interpreted as a time zone already been seen, it is instead interpreted as a time zone
name (e.g., <literal>America/New_York</>). name (e.g., <literal>America/New_York</>).
</para> </para>
...@@ -166,7 +166,7 @@ ...@@ -166,7 +166,7 @@
<tip> <tip>
<para> <para>
Gregorian years AD 1-99 may be entered by using 4 digits with leading Gregorian years AD 1-99 can be entered by using 4 digits with leading
zeros (e.g., <literal>0099</> is AD 99). zeros (e.g., <literal>0099</> is AD 99).
</para> </para>
</tip> </tip>
...@@ -382,7 +382,7 @@ ...@@ -382,7 +382,7 @@
</para> </para>
<para> <para>
A timezone abbreviation file may contain blank lines and comments A timezone abbreviation file can contain blank lines and comments
beginning with <literal>#</>. Non-comment lines must have one of beginning with <literal>#</>. Non-comment lines must have one of
these formats: these formats:
...@@ -413,7 +413,7 @@ ...@@ -413,7 +413,7 @@
<para> <para>
The <literal>@OVERRIDE</> syntax indicates that subsequent entries in the The <literal>@OVERRIDE</> syntax indicates that subsequent entries in the
file may override previous entries (i.e., entries obtained from included file can override previous entries (i.e., entries obtained from included
files). Without this, conflicting definitions of the same timezone files). Without this, conflicting definitions of the same timezone
abbreviation are considered an error. abbreviation are considered an error.
</para> </para>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/ddl.sgml,v 1.71 2006/12/30 20:31:11 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/ddl.sgml,v 1.72 2007/01/31 20:56:16 momjian Exp $ -->
<chapter id="ddl"> <chapter id="ddl">
<title>Data Definition</title> <title>Data Definition</title>
...@@ -203,10 +203,10 @@ CREATE TABLE products ( ...@@ -203,10 +203,10 @@ CREATE TABLE products (
</para> </para>
<para> <para>
The default value may be an expression, which will be The default value can be an expression, which will be
evaluated whenever the default value is inserted evaluated whenever the default value is inserted
(<emphasis>not</emphasis> when the table is created). A common example (<emphasis>not</emphasis> when the table is created). A common example
is that a <type>timestamp</type> column may have a default of <literal>now()</>, is that a <type>timestamp</type> column can have a default of <literal>now()</>,
so that it gets set to the time of row insertion. Another common so that it gets set to the time of row insertion. Another common
example is generating a <quote>serial number</> for each row. example is generating a <quote>serial number</> for each row.
In <productname>PostgreSQL</productname> this is typically done by In <productname>PostgreSQL</productname> this is typically done by
...@@ -457,7 +457,7 @@ CREATE TABLE products ( ...@@ -457,7 +457,7 @@ CREATE TABLE products (
The <literal>NOT NULL</literal> constraint has an inverse: the The <literal>NOT NULL</literal> constraint has an inverse: the
<literal>NULL</literal> constraint. This does not mean that the <literal>NULL</literal> constraint. This does not mean that the
column must be null, which would surely be useless. Instead, this column must be null, which would surely be useless. Instead, this
simply selects the default behavior that the column may be null. simply selects the default behavior that the column might be null.
The <literal>NULL</literal> constraint is not present in the SQL The <literal>NULL</literal> constraint is not present in the SQL
standard and should not be used in portable applications. (It was standard and should not be used in portable applications. (It was
only added to <productname>PostgreSQL</productname> to be only added to <productname>PostgreSQL</productname> to be
...@@ -558,7 +558,7 @@ CREATE TABLE products ( ...@@ -558,7 +558,7 @@ CREATE TABLE products (
unique constraint it is possible to store duplicate unique constraint it is possible to store duplicate
rows that contain a null value in at least one of the constrained rows that contain a null value in at least one of the constrained
columns. This behavior conforms to the SQL standard, but we have columns. This behavior conforms to the SQL standard, but we have
heard that other SQL databases may not follow this rule. So be heard that other SQL databases might not follow this rule. So be
careful when developing applications that are intended to be careful when developing applications that are intended to be
portable. portable.
</para> </para>
...@@ -1004,7 +1004,7 @@ CREATE TABLE order_items ( ...@@ -1004,7 +1004,7 @@ CREATE TABLE order_items (
(Of course, this is only possible if the table contains fewer (Of course, this is only possible if the table contains fewer
than 2<superscript>32</> (4 billion) rows, and in practice the than 2<superscript>32</> (4 billion) rows, and in practice the
table size had better be much less than that, or performance table size had better be much less than that, or performance
may suffer.) might suffer.)
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
...@@ -1289,7 +1289,7 @@ ALTER TABLE products ALTER COLUMN price TYPE numeric(10,2); ...@@ -1289,7 +1289,7 @@ ALTER TABLE products ALTER COLUMN price TYPE numeric(10,2);
<para> <para>
<productname>PostgreSQL</> will attempt to convert the column's <productname>PostgreSQL</> will attempt to convert the column's
default value (if any) to the new type, as well as any constraints default value (if any) to the new type, as well as any constraints
that involve the column. But these conversions may fail, or may that involve the column. But these conversions might fail, or might
produce surprising results. It's often best to drop any constraints produce surprising results. It's often best to drop any constraints
on the column before altering its type, and then add back suitably on the column before altering its type, and then add back suitably
modified constraints afterwards. modified constraints afterwards.
...@@ -1457,9 +1457,9 @@ REVOKE ALL ON accounts FROM PUBLIC; ...@@ -1457,9 +1457,9 @@ REVOKE ALL ON accounts FROM PUBLIC;
in turn contain tables. Schemas also contain other kinds of named in turn contain tables. Schemas also contain other kinds of named
objects, including data types, functions, and operators. The same objects, including data types, functions, and operators. The same
object name can be used in different schemas without conflict; for object name can be used in different schemas without conflict; for
example, both <literal>schema1</> and <literal>myschema</> may example, both <literal>schema1</> and <literal>myschema</> can
contain tables named <literal>mytable</>. Unlike databases, contain tables named <literal>mytable</>. Unlike databases,
schemas are not rigidly separated: a user may access objects in any schemas are not rigidly separated: a user can access objects in any
of the schemas in the database he is connected to, if he has of the schemas in the database he is connected to, if he has
privileges to do so. privileges to do so.
</para> </para>
...@@ -1586,7 +1586,7 @@ CREATE SCHEMA <replaceable>schemaname</replaceable> AUTHORIZATION <replaceable>u ...@@ -1586,7 +1586,7 @@ CREATE SCHEMA <replaceable>schemaname</replaceable> AUTHORIZATION <replaceable>u
<para> <para>
Schema names beginning with <literal>pg_</> are reserved for Schema names beginning with <literal>pg_</> are reserved for
system purposes and may not be created by users. system purposes and cannot be created by users.
</para> </para>
</sect2> </sect2>
...@@ -1746,7 +1746,7 @@ SELECT 3 OPERATOR(pg_catalog.+) 4; ...@@ -1746,7 +1746,7 @@ SELECT 3 OPERATOR(pg_catalog.+) 4;
own. To allow that, the owner of the schema needs to grant the own. To allow that, the owner of the schema needs to grant the
<literal>USAGE</literal> privilege on the schema. To allow users <literal>USAGE</literal> privilege on the schema. To allow users
to make use of the objects in the schema, additional privileges to make use of the objects in the schema, additional privileges
may need to be granted, as appropriate for the object. might need to be granted, as appropriate for the object.
</para> </para>
<para> <para>
...@@ -1786,7 +1786,7 @@ REVOKE CREATE ON SCHEMA public FROM PUBLIC; ...@@ -1786,7 +1786,7 @@ REVOKE CREATE ON SCHEMA public FROM PUBLIC;
the search path. If it is not named explicitly in the path then the search path. If it is not named explicitly in the path then
it is implicitly searched <emphasis>before</> searching the path's it is implicitly searched <emphasis>before</> searching the path's
schemas. This ensures that built-in names will always be schemas. This ensures that built-in names will always be
findable. However, you may explicitly place findable. However, you can explicitly place
<literal>pg_catalog</> at the end of your search path if you <literal>pg_catalog</> at the end of your search path if you
prefer to have user-defined names override built-in names. prefer to have user-defined names override built-in names.
</para> </para>
...@@ -1794,7 +1794,7 @@ REVOKE CREATE ON SCHEMA public FROM PUBLIC; ...@@ -1794,7 +1794,7 @@ REVOKE CREATE ON SCHEMA public FROM PUBLIC;
<para> <para>
In <productname>PostgreSQL</productname> versions before 7.3, In <productname>PostgreSQL</productname> versions before 7.3,
table names beginning with <literal>pg_</> were reserved. This is table names beginning with <literal>pg_</> were reserved. This is
no longer true: you may create such a table name if you wish, in no longer true: you can create such a table name if you wish, in
any non-system schema. However, it's best to continue to avoid any non-system schema. However, it's best to continue to avoid
such names, to ensure that you won't suffer a conflict if some such names, to ensure that you won't suffer a conflict if some
future version defines a system table named the same as your future version defines a system table named the same as your
...@@ -1993,7 +1993,7 @@ SELECT name, altitude ...@@ -1993,7 +1993,7 @@ SELECT name, altitude
</para> </para>
<para> <para>
In some cases you may wish to know which table a particular row In some cases you might wish to know which table a particular row
originated from. There is a system column called originated from. There is a system column called
<structfield>tableoid</structfield> in each table which can tell you the <structfield>tableoid</structfield> in each table which can tell you the
originating table: originating table:
...@@ -2242,7 +2242,7 @@ VALUES ('New York', NULL, NULL, 'NY'); ...@@ -2242,7 +2242,7 @@ VALUES ('New York', NULL, NULL, 'NY');
<listitem> <listitem>
<para> <para>
Bulk loads and deletes may be accomplished by adding or removing Bulk loads and deletes can be accomplished by adding or removing
partitions, if that requirement is planned into the partitioning design. partitions, if that requirement is planned into the partitioning design.
<command>ALTER TABLE</> is far faster than a bulk operation. <command>ALTER TABLE</> is far faster than a bulk operation.
It also entirely avoids the <command>VACUUM</command> It also entirely avoids the <command>VACUUM</command>
...@@ -2566,7 +2566,7 @@ DO INSTEAD ...@@ -2566,7 +2566,7 @@ DO INSTEAD
<para> <para>
As we can see, a complex partitioning scheme could require a As we can see, a complex partitioning scheme could require a
substantial amount of DDL. In the above example we would be substantial amount of DDL. In the above example we would be
creating a new partition each month, so it may be wise to write a creating a new partition each month, so it might be wise to write a
script that generates the required DDL automatically. script that generates the required DDL automatically.
</para> </para>
...@@ -2624,7 +2624,7 @@ ALTER TABLE measurement_y2003m02 NO INHERIT measurement; ...@@ -2624,7 +2624,7 @@ ALTER TABLE measurement_y2003m02 NO INHERIT measurement;
This allows further operations to be performed on the data before This allows further operations to be performed on the data before
it is dropped. For example, this is often a useful time to back up it is dropped. For example, this is often a useful time to back up
the data using <command>COPY</>, <application>pg_dump</>, or the data using <command>COPY</>, <application>pg_dump</>, or
similar tools. It can also be a useful time to aggregate data similar tools. It might also be a useful time to aggregate data
into smaller formats, perform other data manipulations, or run into smaller formats, perform other data manipulations, or run
reports. reports.
</para> </para>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/diskusage.sgml,v 1.17 2006/09/16 00:30:12 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/diskusage.sgml,v 1.18 2007/01/31 20:56:16 momjian Exp $ -->
<chapter id="diskusage"> <chapter id="diskusage">
<title>Monitoring Disk Usage</title> <title>Monitoring Disk Usage</title>
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
there is also a <acronym>TOAST</> file associated with the table, there is also a <acronym>TOAST</> file associated with the table,
which is used to store values too wide to fit comfortably in the main which is used to store values too wide to fit comfortably in the main
table (see <xref linkend="storage-toast">). There will be one index on the table (see <xref linkend="storage-toast">). There will be one index on the
<acronym>TOAST</> table, if present. There may also be indexes associated <acronym>TOAST</> table, if present. There might also be indexes associated
with the base table. Each table and index is stored in a separate disk with the base table. Each table and index is stored in a separate disk
file &mdash; possibly more than one file, if the file would exceed one file &mdash; possibly more than one file, if the file would exceed one
gigabyte. Naming conventions for these files are described in <xref gigabyte. Naming conventions for these files are described in <xref
...@@ -117,9 +117,9 @@ SELECT relname, relpages FROM pg_class ORDER BY relpages DESC; ...@@ -117,9 +117,9 @@ SELECT relname, relpages FROM pg_class ORDER BY relpages DESC;
<para> <para>
The most important disk monitoring task of a database administrator The most important disk monitoring task of a database administrator
is to make sure the disk doesn't grow full. A filled data disk will is to make sure the disk doesn't grow full. A filled data disk will
not result in data corruption, but it may well prevent useful activity not result in data corruption, but it might prevent useful activity
from occurring. If the disk holding the WAL files grows full, database from occurring. If the disk holding the WAL files grows full, database
server panic and consequent shutdown may occur. server panic and consequent shutdown might occur.
</para> </para>
<para> <para>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/dml.sgml,v 1.14 2006/09/18 19:54:01 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/dml.sgml,v 1.15 2007/01/31 20:56:16 momjian Exp $ -->
<chapter id="dml"> <chapter id="dml">
<title>Data Manipulation</title> <title>Data Manipulation</title>
...@@ -168,14 +168,14 @@ INSERT INTO products (product_no, name, price) VALUES ...@@ -168,14 +168,14 @@ INSERT INTO products (product_no, name, price) VALUES
<programlisting> <programlisting>
UPDATE products SET price = 10 WHERE price = 5; UPDATE products SET price = 10 WHERE price = 5;
</programlisting> </programlisting>
This may cause zero, one, or many rows to be updated. It is not This might cause zero, one, or many rows to be updated. It is not
an error to attempt an update that does not match any rows. an error to attempt an update that does not match any rows.
</para> </para>
<para> <para>
Let's look at that command in detail. First is the key word Let's look at that command in detail. First is the key word
<literal>UPDATE</literal> followed by the table name. As usual, <literal>UPDATE</literal> followed by the table name. As usual,
the table name may be schema-qualified, otherwise it is looked up the table name can be schema-qualified, otherwise it is looked up
in the path. Next is the key word <literal>SET</literal> followed in the path. Next is the key word <literal>SET</literal> followed
by the column name, an equals sign and the new column value. The by the column name, an equals sign and the new column value. The
new column value can be any scalar expression, not just a constant. new column value can be any scalar expression, not just a constant.
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/docguide.sgml,v 1.68 2007/01/31 15:23:28 teodor Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/docguide.sgml,v 1.69 2007/01/31 20:56:17 momjian Exp $ -->
<appendix id="docguide"> <appendix id="docguide">
<title>Documentation</title> <title>Documentation</title>
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
<para> <para>
The following tools are used to process the documentation. Some The following tools are used to process the documentation. Some
may be optional, as noted. might be optional, as noted.
<variablelist> <variablelist>
<varlistentry> <varlistentry>
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
<para> <para>
We have documented experience with several installation methods for We have documented experience with several installation methods for
the various tools that are needed to process the documentation. the various tools that are needed to process the documentation.
These will be described below. There may be some other packaged These will be described below. There might be some other packaged
distributions for these tools. Please report package status to the distributions for these tools. Please report package status to the
documentation mailing list, and we will include that information documentation mailing list, and we will include that information
here. here.
...@@ -673,7 +673,7 @@ save_size.pdfjadetex = 10000 ...@@ -673,7 +673,7 @@ save_size.pdfjadetex = 10000
It appears that current versions of the <productname>PostgreSQL</productname> documentation It appears that current versions of the <productname>PostgreSQL</productname> documentation
trigger some bug in or exceed the size limit of OpenJade. If the trigger some bug in or exceed the size limit of OpenJade. If the
build process of the <acronym>RTF</acronym> version hangs for a build process of the <acronym>RTF</acronym> version hangs for a
long time and the output file still has size 0, then you may have long time and the output file still has size 0, then you might have
hit that problem. (But keep in mind that a normal build takes 5 hit that problem. (But keep in mind that a normal build takes 5
to 10 minutes, so don't abort too soon.) to 10 minutes, so don't abort too soon.)
</para> </para>
...@@ -1010,7 +1010,7 @@ save_size.pdfjadetex = 10000 ...@@ -1010,7 +1010,7 @@ save_size.pdfjadetex = 10000
<para> <para>
The <productname>PostgreSQL</productname> distribution includes a The <productname>PostgreSQL</productname> distribution includes a
parsed DTD definitions file <filename>reference.ced</filename>. parsed DTD definitions file <filename>reference.ced</filename>.
You may find that when using <productname>PSGML</productname>, a You might find that when using <productname>PSGML</productname>, a
comfortable way of working with these separate files of book comfortable way of working with these separate files of book
parts is to insert a proper <literal>DOCTYPE</literal> parts is to insert a proper <literal>DOCTYPE</literal>
declaration while you're editing them. If you are working on declaration while you're editing them. If you are working on
...@@ -1073,7 +1073,7 @@ save_size.pdfjadetex = 10000 ...@@ -1073,7 +1073,7 @@ save_size.pdfjadetex = 10000
<para> <para>
Reference pages that describe executable commands should contain Reference pages that describe executable commands should contain
the following sections, in this order. Sections that do not apply the following sections, in this order. Sections that do not apply
may be omitted. Additional top-level sections should only be used can be omitted. Additional top-level sections should only be used
in special circumstances; often that information belongs in the in special circumstances; often that information belongs in the
<quote>Usage</quote> section. <quote>Usage</quote> section.
...@@ -1114,7 +1114,7 @@ save_size.pdfjadetex = 10000 ...@@ -1114,7 +1114,7 @@ save_size.pdfjadetex = 10000
<listitem> <listitem>
<para> <para>
A list describing each command-line option. If there are a A list describing each command-line option. If there are a
lot of options, subsections may be used. lot of options, subsections can be used.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/ecpg.sgml,v 1.77 2006/10/23 18:10:31 petere Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/ecpg.sgml,v 1.78 2007/01/31 20:56:17 momjian Exp $ -->
<chapter id="ecpg"> <chapter id="ecpg">
<title><application>ECPG</application> - Embedded <acronym>SQL</acronym> in C</title> <title><application>ECPG</application> - Embedded <acronym>SQL</acronym> in C</title>
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
EXEC SQL ...; EXEC SQL ...;
</programlisting> </programlisting>
These statements syntactically take the place of a C statement. These statements syntactically take the place of a C statement.
Depending on the particular statement, they may appear at the Depending on the particular statement, they can appear at the
global level or within a function. Embedded global level or within a function. Embedded
<acronym>SQL</acronym> statements follow the case-sensitivity rules <acronym>SQL</acronym> statements follow the case-sensitivity rules
of normal <acronym>SQL</acronym> code, and not those of C. of normal <acronym>SQL</acronym> code, and not those of C.
...@@ -127,7 +127,7 @@ EXEC SQL CONNECT TO <replaceable>target</replaceable> <optional>AS <replaceable> ...@@ -127,7 +127,7 @@ EXEC SQL CONNECT TO <replaceable>target</replaceable> <optional>AS <replaceable>
(single-quoted) string literal or a variable reference. The (single-quoted) string literal or a variable reference. The
connection target <literal>DEFAULT</literal> initiates a connection connection target <literal>DEFAULT</literal> initiates a connection
to the default database under the default user name. No separate to the default database under the default user name. No separate
user name or connection name may be specified in that case. user name or connection name can be specified in that case.
</para> </para>
<para> <para>
...@@ -160,7 +160,7 @@ EXEC SQL CONNECT TO <replaceable>target</replaceable> <optional>AS <replaceable> ...@@ -160,7 +160,7 @@ EXEC SQL CONNECT TO <replaceable>target</replaceable> <optional>AS <replaceable>
</itemizedlist> </itemizedlist>
As above, the parameters <replaceable>username</replaceable> and As above, the parameters <replaceable>username</replaceable> and
<replaceable>password</replaceable> may be an SQL identifier, an <replaceable>password</replaceable> can be an SQL identifier, an
SQL string literal, or a reference to a character variable. SQL string literal, or a reference to a character variable.
</para> </para>
...@@ -694,7 +694,7 @@ EXEC SQL END DECLARE SECTION; ...@@ -694,7 +694,7 @@ EXEC SQL END DECLARE SECTION;
EXEC SQL EXECUTE IMMEDIATE :stmt; EXEC SQL EXECUTE IMMEDIATE :stmt;
</programlisting> </programlisting>
You may not execute statements that retrieve data (e.g., You cannot execute statements that retrieve data (e.g.,
<command>SELECT</command>) this way. <command>SELECT</command>) this way.
</para> </para>
...@@ -728,7 +728,7 @@ EXEC SQL PREPARE mystmt FROM :stmt; ...@@ -728,7 +728,7 @@ EXEC SQL PREPARE mystmt FROM :stmt;
... ...
EXEC SQL EXECUTE mystmt INTO v1, v2, v3 USING 37; EXEC SQL EXECUTE mystmt INTO v1, v2, v3 USING 37;
</programlisting> </programlisting>
An <command>EXECUTE</command> command may have an An <command>EXECUTE</command> command can have an
<literal>INTO</literal> clause, a <literal>USING</literal> clause, <literal>INTO</literal> clause, a <literal>USING</literal> clause,
both, or neither. both, or neither.
</para> </para>
...@@ -3665,7 +3665,7 @@ risnull(CINTTYPE, (char *) &amp;i); ...@@ -3665,7 +3665,7 @@ risnull(CINTTYPE, (char *) &amp;i);
<command>FETCH</command> statement. An SQL descriptor area groups <command>FETCH</command> statement. An SQL descriptor area groups
the data of one row of data together with metadata items into one the data of one row of data together with metadata items into one
data structure. The metadata is particularly useful when executing data structure. The metadata is particularly useful when executing
dynamic SQL statements, where the nature of the result columns may dynamic SQL statements, where the nature of the result columns might
not be known ahead of time. not be known ahead of time.
</para> </para>
...@@ -4310,7 +4310,7 @@ struct ...@@ -4310,7 +4310,7 @@ struct
<para> <para>
The statement sent to the <productname>PostgreSQL</productname> The statement sent to the <productname>PostgreSQL</productname>
server was empty. (This cannot normally happen in an embedded server was empty. (This cannot normally happen in an embedded
SQL program, so it may point to an internal error.) (SQLSTATE SQL program, so it might point to an internal error.) (SQLSTATE
YE002) YE002)
</para> </para>
</listitem> </listitem>
...@@ -4689,7 +4689,7 @@ cc -o myprog prog1.o prog2.o ... -lecpg ...@@ -4689,7 +4689,7 @@ cc -o myprog prog1.o prog2.o ... -lecpg
<para> <para>
If you manage the build process of a larger project using If you manage the build process of a larger project using
<application>make</application>, it may be convenient to include <application>make</application>, it might be convenient to include
the following implicit rule to your makefiles: the following implicit rule to your makefiles:
<programlisting> <programlisting>
ECPG = ecpg ECPG = ecpg
...@@ -4949,7 +4949,7 @@ EXEC SQL OPEN <replaceable>cursor</replaceable>; ...@@ -4949,7 +4949,7 @@ EXEC SQL OPEN <replaceable>cursor</replaceable>;
<para> <para>
Here is a complete example describing the output of the Here is a complete example describing the output of the
preprocessor of a file <filename>foo.pgc</filename> (details may preprocessor of a file <filename>foo.pgc</filename> (details might
change with each particular version of the preprocessor): change with each particular version of the preprocessor):
<programlisting> <programlisting>
EXEC SQL BEGIN DECLARE SECTION; EXEC SQL BEGIN DECLARE SECTION;
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/errcodes.sgml,v 1.21 2006/12/24 00:29:17 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/errcodes.sgml,v 1.22 2007/01/31 20:56:17 momjian Exp $ -->
<appendix id="errcodes-appendix"> <appendix id="errcodes-appendix">
<title><productname>PostgreSQL</productname> Error Codes</title> <title><productname>PostgreSQL</productname> Error Codes</title>
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
According to the standard, the first two characters of an error code According to the standard, the first two characters of an error code
denote a class of errors, while the last three characters indicate denote a class of errors, while the last three characters indicate
a specific condition within that class. Thus, an application that a specific condition within that class. Thus, an application that
does not recognize the specific error code may still be able to infer does not recognize the specific error code can still be able to infer
what to do from the error class. what to do from the error class.
</para> </para>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/extend.sgml,v 1.32 2006/09/16 00:30:13 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/extend.sgml,v 1.33 2007/01/31 20:56:17 momjian Exp $ -->
<chapter id="extend"> <chapter id="extend">
<title>Extending <acronym>SQL</acronym></title> <title>Extending <acronym>SQL</acronym></title>
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
<para> <para>
A domain is based on a particular base type and for many purposes A domain is based on a particular base type and for many purposes
is interchangeable with its base type. However, a domain may is interchangeable with its base type. However, a domain can
have constraints that restrict its valid values to a subset of have constraints that restrict its valid values to a subset of
what the underlying base type would allow. what the underlying base type would allow.
</para> </para>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/external-projects.sgml,v 1.14 2006/11/20 17:42:16 neilc Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/external-projects.sgml,v 1.15 2007/01/31 20:56:17 momjian Exp $ -->
<appendix id="external-projects"> <appendix id="external-projects">
<title>External Projects</title> <title>External Projects</title>
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
All other language interfaces are external projects and are distributed All other language interfaces are external projects and are distributed
separately. <xref linkend="language-interface-table"> includes a list of separately. <xref linkend="language-interface-table"> includes a list of
some of these projects. Note that some of these packages may not be some of these projects. Note that some of these packages might not be
released under the same license as <productname>PostgreSQL</>. For more released under the same license as <productname>PostgreSQL</>. For more
information on each language interface, including licensing terms, refer to information on each language interface, including licensing terms, refer to
its website and documentation. its website and documentation.
...@@ -175,7 +175,7 @@ ...@@ -175,7 +175,7 @@
In addition, there are a number of procedural languages that are developed In addition, there are a number of procedural languages that are developed
and maintained outside the core <productname>PostgreSQL</productname> and maintained outside the core <productname>PostgreSQL</productname>
distribution. <xref linkend="pl-language-table"> lists some of these distribution. <xref linkend="pl-language-table"> lists some of these
packages. Note that some of these projects may not be released under the same packages. Note that some of these projects might not be released under the same
license as <productname>PostgreSQL</>. For more information on each license as <productname>PostgreSQL</>. For more information on each
procedural language, including licensing information, refer to its website procedural language, including licensing information, refer to its website
and documentation. and documentation.
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/features.sgml,v 2.25 2006/09/16 00:30:13 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/features.sgml,v 2.26 2007/01/31 20:56:17 momjian Exp $ -->
<appendix id="features"> <appendix id="features">
<title>SQL Conformance</title> <title>SQL Conformance</title>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
9075 Working Group during the preparation of SQL:2003. Even so, 9075 Working Group during the preparation of SQL:2003. Even so,
many of the features required by SQL:2003 are already supported, many of the features required by SQL:2003 are already supported,
though sometimes with slightly differing syntax or function. though sometimes with slightly differing syntax or function.
Further moves towards conformance may be expected in later releases. Further moves towards conformance should be expected in later releases.
</para> </para>
<para> <para>
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
PostgreSQL supports most of the major features of SQL:2003. Out of PostgreSQL supports most of the major features of SQL:2003. Out of
164 mandatory features required for full Core conformance, 164 mandatory features required for full Core conformance,
PostgreSQL conforms to at least 150. In addition, there is a long PostgreSQL conforms to at least 150. In addition, there is a long
list of supported optional features. It may be worth noting that at list of supported optional features. It might be worth noting that at
the time of writing, no current version of any database management the time of writing, no current version of any database management
system claims full conformance to Core SQL:2003. system claims full conformance to Core SQL:2003.
</para> </para>
...@@ -90,9 +90,9 @@ ...@@ -90,9 +90,9 @@
that <productname>PostgreSQL</productname> supports, followed by a that <productname>PostgreSQL</productname> supports, followed by a
list of the features defined in <acronym>SQL:2003</acronym> which list of the features defined in <acronym>SQL:2003</acronym> which
are not yet supported in <productname>PostgreSQL</productname>. are not yet supported in <productname>PostgreSQL</productname>.
Both of these lists are approximate: There may be minor details that Both of these lists are approximate: There might be minor details that
are nonconforming for a feature that is listed as supported, and are nonconforming for a feature that is listed as supported, and
large parts of an unsupported feature may in fact be implemented. large parts of an unsupported feature might in fact be implemented.
The main body of the documentation always contains the most accurate The main body of the documentation always contains the most accurate
information about what does and does not work. information about what does and does not work.
</para> </para>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.355 2007/01/30 22:29:22 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.356 2007/01/31 20:56:17 momjian Exp $ -->
<chapter id="functions"> <chapter id="functions">
<title>Functions and Operators</title> <title>Functions and Operators</title>
...@@ -324,7 +324,7 @@ ...@@ -324,7 +324,7 @@
<tip> <tip>
<para> <para>
Some applications may expect that Some applications might expect that
<literal><replaceable>expression</replaceable> = NULL</literal> <literal><replaceable>expression</replaceable> = NULL</literal>
returns true if <replaceable>expression</replaceable> evaluates to returns true if <replaceable>expression</replaceable> evaluates to
the null value. It is highly recommended that these applications the null value. It is highly recommended that these applications
...@@ -582,7 +582,7 @@ ...@@ -582,7 +582,7 @@
data type as its argument. data type as its argument.
The functions working with <type>double precision</type> data are mostly The functions working with <type>double precision</type> data are mostly
implemented on top of the host system's C library; accuracy and behavior in implemented on top of the host system's C library; accuracy and behavior in
boundary cases may therefore vary depending on the host system. boundary cases can therefore vary depending on the host system.
</para> </para>
<indexterm> <indexterm>
...@@ -2804,7 +2804,7 @@ cast(-44 as bit(12)) <lineannotation>111111010100</lineannotation> ...@@ -2804,7 +2804,7 @@ cast(-44 as bit(12)) <lineannotation>111111010100</lineannotation>
other characters, the respective character in other characters, the respective character in
<replaceable>pattern</replaceable> must be <replaceable>pattern</replaceable> must be
preceded by the escape character. The default escape preceded by the escape character. The default escape
character is the backslash but a different one may be selected by character is the backslash but a different one can be selected by
using the <literal>ESCAPE</literal> clause. To match the escape using the <literal>ESCAPE</literal> clause. To match the escape
character itself, write two escape characters. character itself, write two escape characters.
</para> </para>
...@@ -2884,7 +2884,7 @@ cast(-44 as bit(12)) <lineannotation>111111010100</lineannotation> ...@@ -2884,7 +2884,7 @@ cast(-44 as bit(12)) <lineannotation>111111010100</lineannotation>
Like <function>LIKE</function>, the <function>SIMILAR TO</function> Like <function>LIKE</function>, the <function>SIMILAR TO</function>
operator succeeds only if its pattern matches the entire string; operator succeeds only if its pattern matches the entire string;
this is unlike common regular expression practice, wherein the pattern this is unlike common regular expression practice, wherein the pattern
may match any part of the string. can match any part of the string.
Also like Also like
<function>LIKE</function>, <function>SIMILAR TO</function> uses <function>LIKE</function>, <function>SIMILAR TO</function> uses
<literal>_</> and <literal>%</> as wildcard characters denoting <literal>_</> and <literal>%</> as wildcard characters denoting
...@@ -2918,7 +2918,7 @@ cast(-44 as bit(12)) <lineannotation>111111010100</lineannotation> ...@@ -2918,7 +2918,7 @@ cast(-44 as bit(12)) <lineannotation>111111010100</lineannotation>
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
Parentheses <literal>()</literal> may be used to group items into Parentheses <literal>()</literal> can be used to group items into
a single logical item. a single logical item.
</para> </para>
</listitem> </listitem>
...@@ -3198,7 +3198,7 @@ regexp_replace('foobarbaz', 'b(..)', E'X\\1Y', 'g') ...@@ -3198,7 +3198,7 @@ regexp_replace('foobarbaz', 'b(..)', E'X\\1Y', 'g')
<para> <para>
A <firstterm>constraint</> matches an empty string, but matches only when A <firstterm>constraint</> matches an empty string, but matches only when
specific conditions are met. A constraint can be used where an atom specific conditions are met. A constraint can be used where an atom
could be used, except it may not be followed by a quantifier. could be used, except it cannot be followed by a quantifier.
The simple constraints are shown in The simple constraints are shown in
<xref linkend="posix-constraints-table">; <xref linkend="posix-constraints-table">;
some more constraints are described later. some more constraints are described later.
...@@ -3276,7 +3276,7 @@ regexp_replace('foobarbaz', 'b(..)', E'X\\1Y', 'g') ...@@ -3276,7 +3276,7 @@ regexp_replace('foobarbaz', 'b(..)', E'X\\1Y', 'g')
</table> </table>
<para> <para>
An RE may not end with <literal>\</>. An RE cannot end with <literal>\</>.
</para> </para>
<note> <note>
...@@ -3330,7 +3330,7 @@ regexp_replace('foobarbaz', 'b(..)', E'X\\1Y', 'g') ...@@ -3330,7 +3330,7 @@ regexp_replace('foobarbaz', 'b(..)', E'X\\1Y', 'g')
<entry> <entry>
<literal>{</><replaceable>m</><literal>,</><replaceable>n</><literal>}</> </entry> <literal>{</><replaceable>m</><literal>,</><replaceable>n</><literal>}</> </entry>
<entry> a sequence of <replaceable>m</> through <replaceable>n</> <entry> a sequence of <replaceable>m</> through <replaceable>n</>
(inclusive) matches of the atom; <replaceable>m</> may not exceed (inclusive) matches of the atom; <replaceable>m</> cannot exceed
<replaceable>n</> </entry> <replaceable>n</> </entry>
</row> </row>
...@@ -3432,7 +3432,7 @@ regexp_replace('foobarbaz', 'b(..)', E'X\\1Y', 'g') ...@@ -3432,7 +3432,7 @@ regexp_replace('foobarbaz', 'b(..)', E'X\\1Y', 'g')
</table> </table>
<para> <para>
Lookahead constraints may not contain <firstterm>back references</> Lookahead constraints cannot contain <firstterm>back references</>
(see <xref linkend="posix-escape-sequences">), (see <xref linkend="posix-escape-sequences">),
and all parentheses within them are considered non-capturing. and all parentheses within them are considered non-capturing.
</para> </para>
...@@ -3506,7 +3506,7 @@ regexp_replace('foobarbaz', 'b(..)', E'X\\1Y', 'g') ...@@ -3506,7 +3506,7 @@ regexp_replace('foobarbaz', 'b(..)', E'X\\1Y', 'g')
<literal>^</literal> are the members of an equivalence class, then <literal>^</literal> are the members of an equivalence class, then
<literal>[[=o=]]</literal>, <literal>[[=^=]]</literal>, and <literal>[[=o=]]</literal>, <literal>[[=^=]]</literal>, and
<literal>[o^]</literal> are all synonymous. An equivalence class <literal>[o^]</literal> are all synonymous. An equivalence class
may not be an endpoint of a range. cannot be an endpoint of a range.
</para> </para>
<para> <para>
...@@ -3522,7 +3522,7 @@ regexp_replace('foobarbaz', 'b(..)', E'X\\1Y', 'g') ...@@ -3522,7 +3522,7 @@ regexp_replace('foobarbaz', 'b(..)', E'X\\1Y', 'g')
<literal>xdigit</literal>. These stand for the character classes <literal>xdigit</literal>. These stand for the character classes
defined in defined in
<citerefentry><refentrytitle>ctype</refentrytitle><manvolnum>3</manvolnum></citerefentry>. <citerefentry><refentrytitle>ctype</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
A locale may provide others. A character class may not be used as A locale can provide others. A character class cannot be used as
an endpoint of a range. an endpoint of a range.
</para> </para>
...@@ -3909,7 +3909,7 @@ regexp_replace('foobarbaz', 'b(..)', E'X\\1Y', 'g') ...@@ -3909,7 +3909,7 @@ regexp_replace('foobarbaz', 'b(..)', E'X\\1Y', 'g')
</para> </para>
<para> <para>
An ARE may begin with <firstterm>embedded options</>: An ARE can begin with <firstterm>embedded options</>:
a sequence <literal>(?</><replaceable>xyz</><literal>)</> a sequence <literal>(?</><replaceable>xyz</><literal>)</>
(where <replaceable>xyz</> is one or more alphabetic characters) (where <replaceable>xyz</> is one or more alphabetic characters)
specifies options affecting the rest of the RE. specifies options affecting the rest of the RE.
...@@ -4001,7 +4001,7 @@ regexp_replace('foobarbaz', 'b(..)', E'X\\1Y', 'g') ...@@ -4001,7 +4001,7 @@ regexp_replace('foobarbaz', 'b(..)', E'X\\1Y', 'g')
<para> <para>
Embedded options take effect at the <literal>)</> terminating the sequence. Embedded options take effect at the <literal>)</> terminating the sequence.
They may appear only at the start of an ARE (after the They can appear only at the start of an ARE (after the
<literal>***:</> director if any). <literal>***:</> director if any).
</para> </para>
...@@ -4660,7 +4660,7 @@ SELECT SUBSTRING('XY1234Z', 'Y*?([0-9]{1,3})'); ...@@ -4660,7 +4660,7 @@ SELECT SUBSTRING('XY1234Z', 'Y*?([0-9]{1,3})');
</table> </table>
<para> <para>
Certain modifiers may be applied to any template pattern to alter its Certain modifiers can be applied to any template pattern to alter its
behavior. For example, <literal>FMMonth</literal> behavior. For example, <literal>FMMonth</literal>
is the <literal>Month</literal> pattern with the is the <literal>Month</literal> pattern with the
<literal>FM</literal> modifier. <literal>FM</literal> modifier.
...@@ -6121,7 +6121,7 @@ SELECT date_trunc('year', TIMESTAMP '2001-02-16 20:38:40'); ...@@ -6121,7 +6121,7 @@ SELECT date_trunc('year', TIMESTAMP '2001-02-16 20:38:40');
In these expressions, the desired time zone <replaceable>zone</> can be In these expressions, the desired time zone <replaceable>zone</> can be
specified either as a text string (e.g., <literal>'PST'</literal>) specified either as a text string (e.g., <literal>'PST'</literal>)
or as an interval (e.g., <literal>INTERVAL '-08:00'</literal>). or as an interval (e.g., <literal>INTERVAL '-08:00'</literal>).
In the text case, a time zone name may be specified in any of the ways In the text case, a time zone name can be specified in any of the ways
described in <xref linkend="datatype-timezones">. described in <xref linkend="datatype-timezones">.
</para> </para>
...@@ -6228,7 +6228,7 @@ SELECT LOCALTIMESTAMP; ...@@ -6228,7 +6228,7 @@ SELECT LOCALTIMESTAMP;
<note> <note>
<para> <para>
Other database systems may advance these values more Other database systems might advance these values more
frequently. frequently.
</para> </para>
</note> </note>
...@@ -6257,7 +6257,7 @@ timeofday() ...@@ -6257,7 +6257,7 @@ timeofday()
statement (more specifically, the time of receipt of the latest command statement (more specifically, the time of receipt of the latest command
message from the client). message from the client).
<function>statement_timestamp()</> and <function>transaction_timestamp()</> <function>statement_timestamp()</> and <function>transaction_timestamp()</>
return the same value during the first command of a transaction, but may return the same value during the first command of a transaction, but might
differ during subsequent commands. differ during subsequent commands.
<function>clock_timestamp()</> returns the actual current time, and <function>clock_timestamp()</> returns the actual current time, and
therefore its value changes even within a single SQL command. therefore its value changes even within a single SQL command.
...@@ -6329,7 +6329,7 @@ SELECT pg_sleep(1.5); ...@@ -6329,7 +6329,7 @@ SELECT pg_sleep(1.5);
<para> <para>
The effective resolution of the sleep interval is platform-specific; The effective resolution of the sleep interval is platform-specific;
0.01 seconds is a common value. The sleep delay will be at least as long 0.01 seconds is a common value. The sleep delay will be at least as long
as specified. It may be longer depending on factors such as server load. as specified. It might be longer depending on factors such as server load.
</para> </para>
</note> </note>
...@@ -6821,7 +6821,7 @@ SELECT pg_sleep(1.5); ...@@ -6821,7 +6821,7 @@ SELECT pg_sleep(1.5);
<literal>t.p</> is a <type>point</> column then <literal>t.p</> is a <type>point</> column then
<literal>SELECT p[0] FROM t</> retrieves the X coordinate and <literal>SELECT p[0] FROM t</> retrieves the X coordinate and
<literal>UPDATE t SET p[1] = ...</> changes the Y coordinate. <literal>UPDATE t SET p[1] = ...</> changes the Y coordinate.
In the same way, a value of type <type>box</> or <type>lseg</> may be treated In the same way, a value of type <type>box</> or <type>lseg</> can be treated
as an array of two <type>point</> values. as an array of two <type>point</> values.
</para> </para>
...@@ -7236,7 +7236,7 @@ nextval('foo'::text) <lineannotation><literal>foo</literal> is looked up at ...@@ -7236,7 +7236,7 @@ nextval('foo'::text) <lineannotation><literal>foo</literal> is looked up at
</programlisting> </programlisting>
Note that late binding was the only behavior supported in Note that late binding was the only behavior supported in
<productname>PostgreSQL</productname> releases before 8.1, so you <productname>PostgreSQL</productname> releases before 8.1, so you
may need to do this to preserve the semantics of old applications. might need to do this to preserve the semantics of old applications.
</para> </para>
<para> <para>
...@@ -7302,7 +7302,7 @@ nextval('foo'::text) <lineannotation><literal>foo</literal> is looked up at ...@@ -7302,7 +7302,7 @@ nextval('foo'::text) <lineannotation><literal>foo</literal> is looked up at
value and sets its <literal>is_called</literal> field to <literal>true</literal>, value and sets its <literal>is_called</literal> field to <literal>true</literal>,
meaning that the next <function>nextval</function> will advance the sequence meaning that the next <function>nextval</function> will advance the sequence
before returning a value. In the three-parameter form, before returning a value. In the three-parameter form,
<literal>is_called</literal> may be set either <literal>true</literal> or <literal>is_called</literal> can be set either <literal>true</literal> or
<literal>false</literal>. If it's set to <literal>false</literal>, <literal>false</literal>. If it's set to <literal>false</literal>,
the next <function>nextval</function> will return exactly the specified the next <function>nextval</function> will return exactly the specified
value, and sequence advancement commences with the following value, and sequence advancement commences with the following
...@@ -7336,7 +7336,7 @@ SELECT setval('foo', 42, false); <lineannotation>Next <function>nextval</> wi ...@@ -7336,7 +7336,7 @@ SELECT setval('foo', 42, false); <lineannotation>Next <function>nextval</> wi
same sequence, a <function>nextval</function> operation is never rolled back; same sequence, a <function>nextval</function> operation is never rolled back;
that is, once a value has been fetched it is considered used, even if the that is, once a value has been fetched it is considered used, even if the
transaction that did the <function>nextval</function> later aborts. This means transaction that did the <function>nextval</function> later aborts. This means
that aborted transactions may leave unused <quote>holes</quote> in the that aborted transactions might leave unused <quote>holes</quote> in the
sequence of assigned values. <function>setval</function> operations are never sequence of assigned values. <function>setval</function> operations are never
rolled back, either. rolled back, either.
</para> </para>
...@@ -8026,7 +8026,7 @@ SELECT NULLIF(value, '(none)') ... ...@@ -8026,7 +8026,7 @@ SELECT NULLIF(value, '(none)') ...
It should be noted that except for <function>count</function>, It should be noted that except for <function>count</function>,
these functions return a null value when no rows are selected. In these functions return a null value when no rows are selected. In
particular, <function>sum</function> of no rows returns null, not particular, <function>sum</function> of no rows returns null, not
zero as one might expect. The <function>coalesce</function> function may be zero as one might expect. The <function>coalesce</function> function can be
used to substitute zero for null when necessary. used to substitute zero for null when necessary.
</para> </para>
...@@ -8056,7 +8056,7 @@ SELECT b1 = ANY((SELECT b2 FROM t2 ...)) FROM t1 ...; ...@@ -8056,7 +8056,7 @@ SELECT b1 = ANY((SELECT b2 FROM t2 ...)) FROM t1 ...;
<note> <note>
<para> <para>
Users accustomed to working with other SQL database management Users accustomed to working with other SQL database management
systems may be surprised by the performance of the systems might be surprised by the performance of the
<function>count</function> aggregate when it is applied to the <function>count</function> aggregate when it is applied to the
entire table. A query like: entire table. A query like:
<programlisting> <programlisting>
...@@ -8484,7 +8484,7 @@ EXISTS (<replaceable>subquery</replaceable>) ...@@ -8484,7 +8484,7 @@ EXISTS (<replaceable>subquery</replaceable>)
whether at least one row is returned, not all the way to completion. whether at least one row is returned, not all the way to completion.
It is unwise to write a subquery that has any side effects (such as It is unwise to write a subquery that has any side effects (such as
calling sequence functions); whether the side effects occur or not calling sequence functions); whether the side effects occur or not
may be difficult to predict. might be difficult to predict.
</para> </para>
<para> <para>
...@@ -9296,7 +9296,7 @@ select current_date + s.a as dates from generate_series(0,14,7) as s(a); ...@@ -9296,7 +9296,7 @@ select current_date + s.a as dates from generate_series(0,14,7) as s(a);
<note> <note>
<para> <para>
The search path may be altered at run time. The command is: The search path can be altered at run time. The command is:
<programlisting> <programlisting>
SET search_path TO <replaceable>schema</> <optional>, <replaceable>schema</>, ...</optional> SET search_path TO <replaceable>schema</> <optional>, <replaceable>schema</>, ...</optional>
</programlisting> </programlisting>
...@@ -9881,7 +9881,7 @@ SELECT pg_type_is_visible('myschema.widget'::regtype); ...@@ -9881,7 +9881,7 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
creating command for a constraint, index, rule, or trigger. (Note that this creating command for a constraint, index, rule, or trigger. (Note that this
is a decompiled reconstruction, not the original text of the command.) is a decompiled reconstruction, not the original text of the command.)
<function>pg_get_expr</function> decompiles the internal form of an <function>pg_get_expr</function> decompiles the internal form of an
individual expression, such as the default value for a column. It may be individual expression, such as the default value for a column. It can be
useful when examining the contents of system catalogs. useful when examining the contents of system catalogs.
<function>pg_get_viewdef</function> reconstructs the <command>SELECT</> <function>pg_get_viewdef</function> reconstructs the <command>SELECT</>
query that defines a view. Most of these functions come in two variants, query that defines a view. Most of these functions come in two variants,
...@@ -10294,7 +10294,7 @@ postgres=# select pg_start_backup('label_goes_here'); ...@@ -10294,7 +10294,7 @@ postgres=# select pg_start_backup('label_goes_here');
the transaction log archive area. The history file includes the label given to the transaction log archive area. The history file includes the label given to
<function>pg_start_backup</>, the starting and ending transaction log locations for <function>pg_start_backup</>, the starting and ending transaction log locations for
the backup, and the starting and ending times of the backup. The return the backup, and the starting and ending times of the backup. The return
value is the backup's ending transaction log location (which again may be of little value is the backup's ending transaction log location (which again might be of little
interest). After noting the ending location, the current transaction log insertion interest). After noting the ending location, the current transaction log insertion
point is automatically advanced to the next transaction log file, so that the point is automatically advanced to the next transaction log file, so that the
ending transaction log file can be archived immediately to complete the backup. ending transaction log file can be archived immediately to complete the backup.
...@@ -10413,7 +10413,7 @@ postgres=# select * from pg_xlogfile_name_offset(pg_stop_backup()); ...@@ -10413,7 +10413,7 @@ postgres=# select * from pg_xlogfile_name_offset(pg_stop_backup());
<entry><type>bigint</type></entry> <entry><type>bigint</type></entry>
<entry> <entry>
Disk space used by the table or index with the specified name. Disk space used by the table or index with the specified name.
The table name may be qualified with a schema name The table name can be qualified with a schema name
</entry> </entry>
</row> </row>
<row> <row>
...@@ -10454,7 +10454,7 @@ postgres=# select * from pg_xlogfile_name_offset(pg_stop_backup()); ...@@ -10454,7 +10454,7 @@ postgres=# select * from pg_xlogfile_name_offset(pg_stop_backup());
<entry><type>bigint</type></entry> <entry><type>bigint</type></entry>
<entry> <entry>
Total disk space used by the table with the specified name, Total disk space used by the table with the specified name,
including indexes and toasted data. The table name may be including indexes and toasted data. The table name can be
qualified with a schema name qualified with a schema name
</entry> </entry>
</row> </row>
...@@ -10494,7 +10494,7 @@ postgres=# select * from pg_xlogfile_name_offset(pg_stop_backup()); ...@@ -10494,7 +10494,7 @@ postgres=# select * from pg_xlogfile_name_offset(pg_stop_backup());
The functions shown in <xref The functions shown in <xref
linkend="functions-admin-genfile"> provide native file access to linkend="functions-admin-genfile"> provide native file access to
files on the machine hosting the server. Only files within the files on the machine hosting the server. Only files within the
database cluster directory and the <varname>log_directory</> may be database cluster directory and the <varname>log_directory</> can be
accessed. Use a relative path for files within the cluster directory, accessed. Use a relative path for files within the cluster directory,
and a path matching the <varname>log_directory</> configuration setting and a path matching the <varname>log_directory</> configuration setting
for log files. Use of these functions is restricted to superusers. for log files. Use of these functions is restricted to superusers.
...@@ -10690,7 +10690,7 @@ SELECT (pg_stat_file('filename')).modification; ...@@ -10690,7 +10690,7 @@ SELECT (pg_stat_file('filename')).modification;
</indexterm> </indexterm>
<para> <para>
<function>pg_advisory_lock</> locks an application-defined resource, <function>pg_advisory_lock</> locks an application-defined resource,
which may be identified either by a single 64-bit key value or two which can be identified either by a single 64-bit key value or two
32-bit key values (note that these two key spaces do not overlap). If 32-bit key values (note that these two key spaces do not overlap). If
another session already holds a lock on the same resource, the another session already holds a lock on the same resource, the
function will wait until the resource becomes available. The lock function will wait until the resource becomes available. The lock
...@@ -10796,7 +10796,7 @@ SELECT (pg_stat_file('filename')).modification; ...@@ -10796,7 +10796,7 @@ SELECT (pg_stat_file('filename')).modification;
<para> <para>
The function <function>xmlcomment</function> creates an XML value The function <function>xmlcomment</function> creates an XML value
containing an XML comment with the specified text as content. containing an XML comment with the specified text as content.
The text may not contain <literal>--</literal> or end with a The text cannot contain <literal>--</literal> or end with a
<literal>-</literal> so that the resulting construct is a valid <literal>-</literal> so that the resulting construct is a valid
XML comment. If the argument is null, the result is null. XML comment. If the argument is null, the result is null.
</para> </para>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/gin.sgml,v 2.8 2007/01/31 15:09:45 teodor Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/gin.sgml,v 2.9 2007/01/31 20:56:17 momjian Exp $ -->
<chapter id="GIN"> <chapter id="GIN">
<title>GIN Indexes</title> <title>GIN Indexes</title>
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<acronym>GIN</acronym> stands for Generalized Inverted Index. It is <acronym>GIN</acronym> stands for Generalized Inverted Index. It is
an index structure storing a set of (key, posting list) pairs, where an index structure storing a set of (key, posting list) pairs, where
a <quote>posting list</> is a set of rows in which the key occurs. Each a <quote>posting list</> is a set of rows in which the key occurs. Each
indexed value may contain many keys, so the same row ID may appear in indexed value can contain many keys, so the same row ID can appear in
multiple posting lists. multiple posting lists.
</para> </para>
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
<listitem> <listitem>
<para> <para>
Returns TRUE if the indexed value satisfies the query operator with Returns TRUE if the indexed value satisfies the query operator with
strategy number <literal>n</> (or may satisfy, if the operator is strategy number <literal>n</> (or would satisfy, if the operator is
marked RECHECK in the operator class). The <literal>check</> array has marked RECHECK in the operator class). The <literal>check</> array has
the same length as the number of keys previously returned by the same length as the number of keys previously returned by
<function>extractQuery</> for this query. Each element of the <function>extractQuery</> for this query. Each element of the
...@@ -222,7 +222,7 @@ ...@@ -222,7 +222,7 @@
</para> </para>
<para> <para>
<acronym>GIN</acronym> searches keys only by equality matching. This may <acronym>GIN</acronym> searches keys only by equality matching. This might
be improved in future. be improved in future.
</para> </para>
</sect1> </sect1>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/gist.sgml,v 1.27 2006/10/23 18:10:31 petere Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/gist.sgml,v 1.28 2007/01/31 20:56:17 momjian Exp $ -->
<chapter id="GiST"> <chapter id="GiST">
<title>GiST Indexes</title> <title>GiST Indexes</title>
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
Usually, replay of the WAL log is sufficient to restore the integrity Usually, replay of the WAL log is sufficient to restore the integrity
of a GiST index following a database crash. However, there are some of a GiST index following a database crash. However, there are some
corner cases in which the index state is not fully rebuilt. The index corner cases in which the index state is not fully rebuilt. The index
will still be functionally correct, but there may be some performance will still be functionally correct, but there might be some performance
degradation. When this occurs, the index can be repaired by degradation. When this occurs, the index can be repaired by
<command>VACUUM</>ing its table, or by rebuilding the index using <command>VACUUM</>ing its table, or by rebuilding the index using
<command>REINDEX</>. In some cases a plain <command>VACUUM</> is <command>REINDEX</>. In some cases a plain <command>VACUUM</> is
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/indexam.sgml,v 2.20 2007/01/20 23:13:01 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/indexam.sgml,v 2.21 2007/01/31 20:56:17 momjian Exp $ -->
<chapter id="indexam"> <chapter id="indexam">
<title>Index Access Method Interface Definition</title> <title>Index Access Method Interface Definition</title>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
block number and an item number within that block (see <xref block number and an item number within that block (see <xref
linkend="storage-page-layout">). This is sufficient linkend="storage-page-layout">). This is sufficient
information to fetch a particular row version from the table. information to fetch a particular row version from the table.
Indexes are not directly aware that under MVCC, there may be multiple Indexes are not directly aware that under MVCC, there might be multiple
extant versions of the same logical row; to an index, each tuple is extant versions of the same logical row; to an index, each tuple is
an independent object that needs its own index entry. Thus, an an independent object that needs its own index entry. Thus, an
update of a row always creates all-new index entries for the row, even if update of a row always creates all-new index entries for the row, even if
...@@ -174,7 +174,7 @@ aminsert (Relation indexRelation, ...@@ -174,7 +174,7 @@ aminsert (Relation indexRelation,
<literal>heap_tid</> is the TID to be indexed. <literal>heap_tid</> is the TID to be indexed.
If the access method supports unique indexes (its If the access method supports unique indexes (its
<structname>pg_am</>.<structfield>amcanunique</> flag is true) then <structname>pg_am</>.<structfield>amcanunique</> flag is true) then
<literal>check_uniqueness</> may be true, in which case the access method <literal>check_uniqueness</> might be true, in which case the access method
must verify that there is no conflicting row; this is the only situation in must verify that there is no conflicting row; this is the only situation in
which the access method normally needs the <literal>heapRelation</> which the access method normally needs the <literal>heapRelation</>
parameter. See <xref linkend="index-unique-checks"> for details. parameter. See <xref linkend="index-unique-checks"> for details.
...@@ -205,7 +205,7 @@ ambulkdelete (IndexVacuumInfo *info, ...@@ -205,7 +205,7 @@ ambulkdelete (IndexVacuumInfo *info,
<para> <para>
Because of limited <varname>maintenance_work_mem</>, Because of limited <varname>maintenance_work_mem</>,
<function>ambulkdelete</> may need to be called more than once when many <function>ambulkdelete</> might need to be called more than once when many
tuples are to be deleted. The <literal>stats</> argument is the result tuples are to be deleted. The <literal>stats</> argument is the result
of the previous call for this index (it is NULL for the first call within a of the previous call for this index (it is NULL for the first call within a
<command>VACUUM</> operation). This allows the AM to accumulate statistics <command>VACUUM</> operation). This allows the AM to accumulate statistics
...@@ -222,7 +222,7 @@ amvacuumcleanup (IndexVacuumInfo *info, ...@@ -222,7 +222,7 @@ amvacuumcleanup (IndexVacuumInfo *info,
</programlisting> </programlisting>
Clean up after a <command>VACUUM</command> operation (zero or more Clean up after a <command>VACUUM</command> operation (zero or more
<function>ambulkdelete</> calls). This does not have to do anything <function>ambulkdelete</> calls). This does not have to do anything
beyond returning index statistics, but it may perform bulk cleanup beyond returning index statistics, but it might perform bulk cleanup
such as reclaiming empty index pages. <literal>stats</> is whatever the such as reclaiming empty index pages. <literal>stats</> is whatever the
last <function>ambulkdelete</> call returned, or NULL if last <function>ambulkdelete</> call returned, or NULL if
<function>ambulkdelete</> was not called because no tuples needed to be <function>ambulkdelete</> was not called because no tuples needed to be
...@@ -418,7 +418,7 @@ amrestrpos (IndexScanDesc scan); ...@@ -418,7 +418,7 @@ amrestrpos (IndexScanDesc scan);
</para> </para>
<para> <para>
The operator family may indicate that the index is <firstterm>lossy</> for a The operator family can indicate that the index is <firstterm>lossy</> for a
particular operator; this implies that the index scan will return all the particular operator; this implies that the index scan will return all the
entries that pass the scan key, plus possibly additional entries that do entries that pass the scan key, plus possibly additional entries that do
not. The core system's index-scan machinery will then apply that operator not. The core system's index-scan machinery will then apply that operator
...@@ -467,7 +467,7 @@ amrestrpos (IndexScanDesc scan); ...@@ -467,7 +467,7 @@ amrestrpos (IndexScanDesc scan);
<para> <para>
The access method must support <quote>marking</> a position in a scan The access method must support <quote>marking</> a position in a scan
and later returning to the marked position. The same position may be and later returning to the marked position. The same position might be
restored multiple times. However, only one position need be remembered restored multiple times. However, only one position need be remembered
per scan; a new <function>ammarkpos</> call overrides the previously per scan; a new <function>ammarkpos</> call overrides the previously
marked position. marked position.
...@@ -480,7 +480,7 @@ amrestrpos (IndexScanDesc scan); ...@@ -480,7 +480,7 @@ amrestrpos (IndexScanDesc scan);
would have found the entry if it had existed when the scan started, or for would have found the entry if it had existed when the scan started, or for
the scan to return such an entry upon rescanning or backing the scan to return such an entry upon rescanning or backing
up even though it had not been returned the first time through. Similarly, up even though it had not been returned the first time through. Similarly,
a concurrent delete may or may not be reflected in the results of a scan. a concurrent delete might or might not be reflected in the results of a scan.
What is important is that insertions or deletions not cause the scan to What is important is that insertions or deletions not cause the scan to
miss or multiply return entries that were not themselves being inserted or miss or multiply return entries that were not themselves being inserted or
deleted. deleted.
...@@ -518,7 +518,7 @@ amrestrpos (IndexScanDesc scan); ...@@ -518,7 +518,7 @@ amrestrpos (IndexScanDesc scan);
<literal>RowExclusiveLock</> when updating the index (including plain <literal>RowExclusiveLock</> when updating the index (including plain
<command>VACUUM</>). Since these lock <command>VACUUM</>). Since these lock
types do not conflict, the access method is responsible for handling any types do not conflict, the access method is responsible for handling any
fine-grained locking it may need. An exclusive lock on the index as a whole fine-grained locking it might need. An exclusive lock on the index as a whole
will be taken only during index creation, destruction, will be taken only during index creation, destruction,
<command>REINDEX</>, or <command>VACUUM FULL</>. <command>REINDEX</>, or <command>VACUUM FULL</>.
</para> </para>
...@@ -537,7 +537,7 @@ amrestrpos (IndexScanDesc scan); ...@@ -537,7 +537,7 @@ amrestrpos (IndexScanDesc scan);
<firstterm>heap</>) and the index. Because <firstterm>heap</>) and the index. Because
<productname>PostgreSQL</productname> separates accesses <productname>PostgreSQL</productname> separates accesses
and updates of the heap from those of the index, there are windows in and updates of the heap from those of the index, there are windows in
which the index may be inconsistent with the heap. We handle this problem which the index might be inconsistent with the heap. We handle this problem
with the following rules: with the following rules:
<itemizedlist> <itemizedlist>
...@@ -582,7 +582,7 @@ amrestrpos (IndexScanDesc scan); ...@@ -582,7 +582,7 @@ amrestrpos (IndexScanDesc scan);
against this scenario by requiring the scan keys to be rechecked against this scenario by requiring the scan keys to be rechecked
against the heap row in all cases, but that is too expensive. Instead, against the heap row in all cases, but that is too expensive. Instead,
we use a pin on an index page as a proxy to indicate that the reader we use a pin on an index page as a proxy to indicate that the reader
may still be <quote>in flight</> from the index entry to the matching might still be <quote>in flight</> from the index entry to the matching
heap entry. Making <function>ambulkdelete</> block on such a pin ensures heap entry. Making <function>ambulkdelete</> block on such a pin ensures
that <command>VACUUM</> cannot delete the heap entry before the reader that <command>VACUUM</> cannot delete the heap entry before the reader
is done with it. This solution costs little in run time, and adds blocking is done with it. This solution costs little in run time, and adds blocking
...@@ -595,7 +595,7 @@ amrestrpos (IndexScanDesc scan); ...@@ -595,7 +595,7 @@ amrestrpos (IndexScanDesc scan);
entry. This is expensive for a number of reasons. An entry. This is expensive for a number of reasons. An
<quote>asynchronous</> scan in which we collect many TIDs from the index, <quote>asynchronous</> scan in which we collect many TIDs from the index,
and only visit the heap tuples sometime later, requires much less index and only visit the heap tuples sometime later, requires much less index
locking overhead and may allow a more efficient heap access pattern. locking overhead and can allow a more efficient heap access pattern.
Per the above analysis, we must use the synchronous approach for Per the above analysis, we must use the synchronous approach for
non-MVCC-compliant snapshots, but an asynchronous scan is workable non-MVCC-compliant snapshots, but an asynchronous scan is workable
for a query using an MVCC snapshot. for a query using an MVCC snapshot.
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/indices.sgml,v 1.67 2006/12/23 00:43:08 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/indices.sgml,v 1.68 2007/01/31 20:56:17 momjian Exp $ -->
<chapter id="indexes"> <chapter id="indexes">
<title id="indexes-title">Indexes</title> <title id="indexes-title">Indexes</title>
...@@ -74,12 +74,12 @@ CREATE INDEX test1_id_index ON test1 (id); ...@@ -74,12 +74,12 @@ CREATE INDEX test1_id_index ON test1 (id);
Once an index is created, no further intervention is required: the Once an index is created, no further intervention is required: the
system will update the index when the table is modified, and it will system will update the index when the table is modified, and it will
use the index in queries when it thinks this would be more efficient use the index in queries when it thinks this would be more efficient
than a sequential table scan. But you may have to run the than a sequential table scan. But you might have to run the
<command>ANALYZE</command> command regularly to update <command>ANALYZE</command> command regularly to update
statistics to allow the query planner to make educated decisions. statistics to allow the query planner to make educated decisions.
See <xref linkend="performance-tips"> for information about See <xref linkend="performance-tips"> for information about
how to find out whether an index is used and when and why the how to find out whether an index is used and when and why the
planner may choose <emphasis>not</emphasis> to use an index. planner might choose <emphasis>not</emphasis> to use an index.
</para> </para>
<para> <para>
...@@ -193,7 +193,7 @@ CREATE INDEX <replaceable>name</replaceable> ON <replaceable>table</replaceable> ...@@ -193,7 +193,7 @@ CREATE INDEX <replaceable>name</replaceable> ON <replaceable>table</replaceable>
indexes to perform no better than B-tree indexes, and the indexes to perform no better than B-tree indexes, and the
index size and build time for hash indexes is much worse. index size and build time for hash indexes is much worse.
Furthermore, hash index operations are not presently WAL-logged, Furthermore, hash index operations are not presently WAL-logged,
so hash indexes may need to be rebuilt with <command>REINDEX</> so hash indexes might need to be rebuilt with <command>REINDEX</>
after a database crash. after a database crash.
For these reasons, hash index use is presently discouraged. For these reasons, hash index use is presently discouraged.
</para> </para>
...@@ -296,7 +296,7 @@ CREATE TABLE test2 ( ...@@ -296,7 +296,7 @@ CREATE TABLE test2 (
<programlisting> <programlisting>
SELECT name FROM test2 WHERE major = <replaceable>constant</replaceable> AND minor = <replaceable>constant</replaceable>; SELECT name FROM test2 WHERE major = <replaceable>constant</replaceable> AND minor = <replaceable>constant</replaceable>;
</programlisting> </programlisting>
then it may be appropriate to define an index on the columns then it might be appropriate to define an index on the columns
<structfield>major</structfield> and <structfield>major</structfield> and
<structfield>minor</structfield> together, e.g., <structfield>minor</structfield> together, e.g.,
<programlisting> <programlisting>
...@@ -306,7 +306,7 @@ CREATE INDEX test2_mm_idx ON test2 (major, minor); ...@@ -306,7 +306,7 @@ CREATE INDEX test2_mm_idx ON test2 (major, minor);
<para> <para>
Currently, only the B-tree and GiST index types support multicolumn Currently, only the B-tree and GiST index types support multicolumn
indexes. Up to 32 columns may be specified. (This limit can be indexes. Up to 32 columns can be specified. (This limit can be
altered when building <productname>PostgreSQL</productname>; see the altered when building <productname>PostgreSQL</productname>; see the
file <filename>pg_config_manual.h</filename>.) file <filename>pg_config_manual.h</filename>.)
</para> </para>
...@@ -413,7 +413,7 @@ CREATE INDEX test2_mm_idx ON test2 (major, minor); ...@@ -413,7 +413,7 @@ CREATE INDEX test2_mm_idx ON test2 (major, minor);
<para> <para>
In all but the simplest applications, there are various combinations of In all but the simplest applications, there are various combinations of
indexes that may be useful, and the database developer must make indexes that might be useful, and the database developer must make
trade-offs to decide which indexes to provide. Sometimes multicolumn trade-offs to decide which indexes to provide. Sometimes multicolumn
indexes are best, but sometimes it's better to create separate indexes indexes are best, but sometimes it's better to create separate indexes
and rely on the index-combination feature. For example, if your and rely on the index-combination feature. For example, if your
...@@ -450,7 +450,7 @@ CREATE INDEX test2_mm_idx ON test2 (major, minor); ...@@ -450,7 +450,7 @@ CREATE INDEX test2_mm_idx ON test2 (major, minor);
</indexterm> </indexterm>
<para> <para>
Indexes may also be used to enforce uniqueness of a column's value, Indexes can also be used to enforce uniqueness of a column's value,
or the uniqueness of the combined values of more than one column. or the uniqueness of the combined values of more than one column.
<synopsis> <synopsis>
CREATE UNIQUE INDEX <replaceable>name</replaceable> ON <replaceable>table</replaceable> (<replaceable>column</replaceable> <optional>, ...</optional>); CREATE UNIQUE INDEX <replaceable>name</replaceable> ON <replaceable>table</replaceable> (<replaceable>column</replaceable> <optional>, ...</optional>);
...@@ -538,7 +538,7 @@ CREATE INDEX people_names ON people ((first_name || ' ' || last_name)); ...@@ -538,7 +538,7 @@ CREATE INDEX people_names ON people ((first_name || ' ' || last_name));
<para> <para>
The syntax of the <command>CREATE INDEX</> command normally requires The syntax of the <command>CREATE INDEX</> command normally requires
writing parentheses around index expressions, as shown in the second writing parentheses around index expressions, as shown in the second
example. The parentheses may be omitted when the expression is just example. The parentheses can be omitted when the expression is just
a function call, as in the first example. a function call, as in the first example.
</para> </para>
...@@ -687,7 +687,7 @@ SELECT * FROM orders WHERE billed is not true AND amount &gt; 5000.00; ...@@ -687,7 +687,7 @@ SELECT * FROM orders WHERE billed is not true AND amount &gt; 5000.00;
<programlisting> <programlisting>
SELECT * FROM orders WHERE order_nr = 3501; SELECT * FROM orders WHERE order_nr = 3501;
</programlisting> </programlisting>
The order 3501 may be among the billed or among the unbilled The order 3501 might be among the billed or among the unbilled
orders. orders.
</para> </para>
</example> </example>
...@@ -755,8 +755,8 @@ CREATE UNIQUE INDEX tests_success_constraint ON tests (subject, target) ...@@ -755,8 +755,8 @@ CREATE UNIQUE INDEX tests_success_constraint ON tests (subject, target)
<para> <para>
Finally, a partial index can also be used to override the system's Finally, a partial index can also be used to override the system's
query plan choices. It may occur that data sets with peculiar query plan choices. Also, data sets with peculiar
distributions will cause the system to use an index when it really distributions might cause the system to use an index when it really
should not. In that case the index can be set up so that it is not should not. In that case the index can be set up so that it is not
available for the offending query. Normally, available for the offending query. Normally,
<productname>PostgreSQL</> makes reasonable choices about index <productname>PostgreSQL</> makes reasonable choices about index
...@@ -795,7 +795,7 @@ CREATE UNIQUE INDEX tests_success_constraint ON tests (subject, target) ...@@ -795,7 +795,7 @@ CREATE UNIQUE INDEX tests_success_constraint ON tests (subject, target)
</indexterm> </indexterm>
<para> <para>
An index definition may specify an <firstterm>operator An index definition can specify an <firstterm>operator
class</firstterm> for each column of an index. class</firstterm> for each column of an index.
<synopsis> <synopsis>
CREATE INDEX <replaceable>name</replaceable> ON <replaceable>table</replaceable> (<replaceable>column</replaceable> <replaceable>opclass</replaceable> <optional>, ...</optional>); CREATE INDEX <replaceable>name</replaceable> ON <replaceable>table</replaceable> (<replaceable>column</replaceable> <replaceable>opclass</replaceable> <optional>, ...</optional>);
...@@ -994,15 +994,15 @@ SELECT am.amname AS index_method, ...@@ -994,15 +994,15 @@ SELECT am.amname AS index_method,
via run-time parameters (described in <xref via run-time parameters (described in <xref
linkend="runtime-config-query-constants">). linkend="runtime-config-query-constants">).
An inaccurate selectivity estimate is due to An inaccurate selectivity estimate is due to
insufficient statistics. It may be possible to improve this by insufficient statistics. It might be possible to improve this by
tuning the statistics-gathering parameters (see tuning the statistics-gathering parameters (see
<xref linkend="sql-altertable" endterm="sql-altertable-title">). <xref linkend="sql-altertable" endterm="sql-altertable-title">).
</para> </para>
<para> <para>
If you do not succeed in adjusting the costs to be more If you do not succeed in adjusting the costs to be more
appropriate, then you may have to resort to forcing index usage appropriate, then you might have to resort to forcing index usage
explicitly. You may also want to contact the explicitly. You might also want to contact the
<productname>PostgreSQL</> developers to examine the issue. <productname>PostgreSQL</> developers to examine the issue.
</para> </para>
</listitem> </listitem>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/information_schema.sgml,v 1.29 2006/10/23 18:10:31 petere Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/information_schema.sgml,v 1.30 2007/01/31 20:56:17 momjian Exp $ -->
<chapter id="information-schema"> <chapter id="information-schema">
<title>The Information Schema</title> <title>The Information Schema</title>
...@@ -170,7 +170,7 @@ ...@@ -170,7 +170,7 @@
<entry><literal>grantee</literal></entry> <entry><literal>grantee</literal></entry>
<entry><type>sql_identifier</type></entry> <entry><type>sql_identifier</type></entry>
<entry> <entry>
Name of the role to which this role membership was granted (may Name of the role to which this role membership was granted (can
be the current user, or a different role in case of nested role be the current user, or a different role in case of nested role
memberships) memberships)
</entry> </entry>
...@@ -222,7 +222,7 @@ ...@@ -222,7 +222,7 @@
<entry><literal>grantee</literal></entry> <entry><literal>grantee</literal></entry>
<entry><type>sql_identifier</type></entry> <entry><type>sql_identifier</type></entry>
<entry> <entry>
Name of the role to which this role membership was granted (may Name of the role to which this role membership was granted (can
be the current user, or a different role in case of nested role be the current user, or a different role in case of nested role
memberships) memberships)
</entry> </entry>
...@@ -357,7 +357,7 @@ ...@@ -357,7 +357,7 @@
If <literal>data_type</literal> identifies a numeric type, this If <literal>data_type</literal> identifies a numeric type, this
column contains the (declared or implicit) precision of the column contains the (declared or implicit) precision of the
type for this attribute. The precision indicates the number of type for this attribute. The precision indicates the number of
significant digits. It may be expressed in decimal (base 10) significant digits. It can be expressed in decimal (base 10)
or binary (base 2) terms, as specified in the column or binary (base 2) terms, as specified in the column
<literal>numeric_precision_radix</literal>. For all other data <literal>numeric_precision_radix</literal>. For all other data
types, this column is null. types, this column is null.
...@@ -383,7 +383,7 @@ ...@@ -383,7 +383,7 @@
If <literal>data_type</literal> identifies an exact numeric If <literal>data_type</literal> identifies an exact numeric
type, this column contains the (declared or implicit) scale of type, this column contains the (declared or implicit) scale of
the type for this attribute. The scale indicates the number of the type for this attribute. The scale indicates the number of
significant digits to the right of the decimal point. It may significant digits to the right of the decimal point. It can
be expressed in decimal (base 10) or binary (base 2) terms, as be expressed in decimal (base 10) or binary (base 2) terms, as
specified in the column specified in the column
<literal>numeric_precision_radix</literal>. For all other data <literal>numeric_precision_radix</literal>. For all other data
...@@ -916,7 +916,7 @@ ...@@ -916,7 +916,7 @@
<literal>YES</literal> if the column is possibly nullable, <literal>YES</literal> if the column is possibly nullable,
<literal>NO</literal> if it is known not nullable. A not-null <literal>NO</literal> if it is known not nullable. A not-null
constraint is one way a column can be known not nullable, but constraint is one way a column can be known not nullable, but
there may be others. there can be others.
</entry> </entry>
</row> </row>
...@@ -964,7 +964,7 @@ ...@@ -964,7 +964,7 @@
If <literal>data_type</literal> identifies a numeric type, this If <literal>data_type</literal> identifies a numeric type, this
column contains the (declared or implicit) precision of the column contains the (declared or implicit) precision of the
type for this column. The precision indicates the number of type for this column. The precision indicates the number of
significant digits. It may be expressed in decimal (base 10) significant digits. It can be expressed in decimal (base 10)
or binary (base 2) terms, as specified in the column or binary (base 2) terms, as specified in the column
<literal>numeric_precision_radix</literal>. For all other data <literal>numeric_precision_radix</literal>. For all other data
types, this column is null. types, this column is null.
...@@ -990,7 +990,7 @@ ...@@ -990,7 +990,7 @@
If <literal>data_type</literal> identifies an exact numeric If <literal>data_type</literal> identifies an exact numeric
type, this column contains the (declared or implicit) scale of type, this column contains the (declared or implicit) scale of
the type for this column. The scale indicates the number of the type for this column. The scale indicates the number of
significant digits to the right of the decimal point. It may significant digits to the right of the decimal point. It can
be expressed in decimal (base 10) or binary (base 2) terms, as be expressed in decimal (base 10) or binary (base 2) terms, as
specified in the column specified in the column
<literal>numeric_precision_radix</literal>. For all other data <literal>numeric_precision_radix</literal>. For all other data
...@@ -1227,7 +1227,7 @@ ...@@ -1227,7 +1227,7 @@
is supposed to identify the underlying built-in type of the column. is supposed to identify the underlying built-in type of the column.
In <productname>PostgreSQL</productname>, this means that the type In <productname>PostgreSQL</productname>, this means that the type
is defined in the system catalog schema is defined in the system catalog schema
<literal>pg_catalog</literal>. This column may be useful if the <literal>pg_catalog</literal>. This column might be useful if the
application can handle the well-known built-in types specially (for application can handle the well-known built-in types specially (for
example, format the numeric types differently or use the data in example, format the numeric types differently or use the data in
the precision columns). The columns <literal>udt_name</literal>, the precision columns). The columns <literal>udt_name</literal>,
...@@ -1738,7 +1738,7 @@ ...@@ -1738,7 +1738,7 @@
If the domain has a numeric type, this column contains the If the domain has a numeric type, this column contains the
(declared or implicit) precision of the type for this column. (declared or implicit) precision of the type for this column.
The precision indicates the number of significant digits. It The precision indicates the number of significant digits. It
may be expressed in decimal (base 10) or binary (base 2) terms, can be expressed in decimal (base 10) or binary (base 2) terms,
as specified in the column as specified in the column
<literal>numeric_precision_radix</literal>. For all other data <literal>numeric_precision_radix</literal>. For all other data
types, this column is null. types, this column is null.
...@@ -1764,7 +1764,7 @@ ...@@ -1764,7 +1764,7 @@
If the domain has an exact numeric type, this column contains If the domain has an exact numeric type, this column contains
the (declared or implicit) scale of the type for this column. the (declared or implicit) scale of the type for this column.
The scale indicates the number of significant digits to the The scale indicates the number of significant digits to the
right of the decimal point. It may be expressed in decimal right of the decimal point. It can be expressed in decimal
(base 10) or binary (base 2) terms, as specified in the column (base 10) or binary (base 2) terms, as specified in the column
<literal>numeric_precision_radix</literal>. For all other data <literal>numeric_precision_radix</literal>. For all other data
types, this column is null. types, this column is null.
...@@ -2126,7 +2126,7 @@ ORDER BY c.ordinal_position; ...@@ -2126,7 +2126,7 @@ ORDER BY c.ordinal_position;
<para> <para>
For permission checking, the set of <quote>applicable roles</quote> For permission checking, the set of <quote>applicable roles</quote>
is applied, which may be broader than the set of enabled roles. So is applied, which can be broader than the set of enabled roles. So
generally, it is better to use the view generally, it is better to use the view
<literal>applicable_roles</literal> instead of this one; see also <literal>applicable_roles</literal> instead of this one; see also
there. there.
...@@ -2753,7 +2753,7 @@ ORDER BY c.ordinal_position; ...@@ -2753,7 +2753,7 @@ ORDER BY c.ordinal_position;
<row> <row>
<entry><literal>routine_name</literal></entry> <entry><literal>routine_name</literal></entry>
<entry><type>sql_identifier</type></entry> <entry><type>sql_identifier</type></entry>
<entry>Name of the function (may be duplicated in case of overloading)</entry> <entry>Name of the function (might be duplicated in case of overloading)</entry>
</row> </row>
<row> <row>
...@@ -2863,7 +2863,7 @@ ORDER BY c.ordinal_position; ...@@ -2863,7 +2863,7 @@ ORDER BY c.ordinal_position;
applies to domains, and since domains do not have real privileges applies to domains, and since domains do not have real privileges
in <productname>PostgreSQL</productname>, this view is empty. in <productname>PostgreSQL</productname>, this view is empty.
Further information can be found under Further information can be found under
<literal>usage_privileges</literal>. In the future, this view may <literal>usage_privileges</literal>. In the future, this view might
contain more useful information. contain more useful information.
</para> </para>
...@@ -3003,7 +3003,7 @@ ORDER BY c.ordinal_position; ...@@ -3003,7 +3003,7 @@ ORDER BY c.ordinal_position;
<row> <row>
<entry><literal>routine_name</literal></entry> <entry><literal>routine_name</literal></entry>
<entry><type>sql_identifier</type></entry> <entry><type>sql_identifier</type></entry>
<entry>Name of the function (may be duplicated in case of overloading)</entry> <entry>Name of the function (might be duplicated in case of overloading)</entry>
</row> </row>
<row> <row>
...@@ -3084,7 +3084,7 @@ ORDER BY c.ordinal_position; ...@@ -3084,7 +3084,7 @@ ORDER BY c.ordinal_position;
<row> <row>
<entry><literal>routine_name</literal></entry> <entry><literal>routine_name</literal></entry>
<entry><type>sql_identifier</type></entry> <entry><type>sql_identifier</type></entry>
<entry>Name of the function (may be duplicated in case of overloading)</entry> <entry>Name of the function (might be duplicated in case of overloading)</entry>
</row> </row>
<row> <row>
...@@ -3737,7 +3737,7 @@ ORDER BY c.ordinal_position; ...@@ -3737,7 +3737,7 @@ ORDER BY c.ordinal_position;
<entry> <entry>
This column contains the (declared or implicit) precision of This column contains the (declared or implicit) precision of
the sequence data type (see above). The precision indicates the sequence data type (see above). The precision indicates
the number of significant digits. It may be expressed in the number of significant digits. It can be expressed in
decimal (base 10) or binary (base 2) terms, as specified in the decimal (base 10) or binary (base 2) terms, as specified in the
column <literal>numeric_precision_radix</literal>. column <literal>numeric_precision_radix</literal>.
</entry> </entry>
...@@ -3761,7 +3761,7 @@ ORDER BY c.ordinal_position; ...@@ -3761,7 +3761,7 @@ ORDER BY c.ordinal_position;
This column contains the (declared or implicit) scale of the This column contains the (declared or implicit) scale of the
sequence data type (see above). The scale indicates the number sequence data type (see above). The scale indicates the number
of significant digits to the right of the decimal point. It of significant digits to the right of the decimal point. It
may be expressed in decimal (base 10) or binary (base 2) terms, can be expressed in decimal (base 10) or binary (base 2) terms,
as specified in the column as specified in the column
<literal>numeric_precision_radix</literal>. <literal>numeric_precision_radix</literal>.
</entry> </entry>
...@@ -4700,7 +4700,7 @@ ORDER BY c.ordinal_position; ...@@ -4700,7 +4700,7 @@ ORDER BY c.ordinal_position;
incompatibilities with the SQL standard that affect the incompatibilities with the SQL standard that affect the
representation in the information schema. First, trigger names are representation in the information schema. First, trigger names are
local to the table in <productname>PostgreSQL</productname>, rather local to the table in <productname>PostgreSQL</productname>, rather
than being independent schema objects. Therefore there may be duplicate than being independent schema objects. Therefore there can be duplicate
trigger names defined in one schema, as long as they belong to trigger names defined in one schema, as long as they belong to
different tables. (<literal>trigger_catalog</literal> and different tables. (<literal>trigger_catalog</literal> and
<literal>trigger_schema</literal> are really the values pertaining <literal>trigger_schema</literal> are really the values pertaining
...@@ -4734,7 +4734,7 @@ ORDER BY c.ordinal_position; ...@@ -4734,7 +4734,7 @@ ORDER BY c.ordinal_position;
in <productname>PostgreSQL</productname>, this view shows implicit in <productname>PostgreSQL</productname>, this view shows implicit
<literal>USAGE</literal> privileges granted to <literal>USAGE</literal> privileges granted to
<literal>PUBLIC</literal> for all domains. In the future, this <literal>PUBLIC</literal> for all domains. In the future, this
view may contain more useful information. view might contain more useful information.
</para> </para>
<table> <table>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.278 2007/01/29 21:49:17 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.279 2007/01/31 20:56:17 momjian Exp $ -->
<chapter id="installation"> <chapter id="installation">
<title><![%standalone-include[<productname>PostgreSQL</>]]> <title><![%standalone-include[<productname>PostgreSQL</>]]>
...@@ -1027,7 +1027,7 @@ su - postgres ...@@ -1027,7 +1027,7 @@ su - postgres
executables considerably, and on non-GCC compilers it usually executables considerably, and on non-GCC compilers it usually
also disables compiler optimization, causing slowdowns. However, also disables compiler optimization, causing slowdowns. However,
having the symbols available is extremely helpful for dealing having the symbols available is extremely helpful for dealing
with any problems that may arise. Currently, this option is with any problems that might arise. Currently, this option is
recommended for production installations only if you use GCC. recommended for production installations only if you use GCC.
But you should always have it on if you are doing development work But you should always have it on if you are doing development work
or running a beta version. or running a beta version.
...@@ -1414,7 +1414,7 @@ All of PostgreSQL is successfully made. Ready to install. ...@@ -1414,7 +1414,7 @@ All of PostgreSQL is successfully made. Ready to install.
investigates (for example, software upgrades), then it's a good investigates (for example, software upgrades), then it's a good
idea to do <command>gmake distclean</> before reconfiguring and idea to do <command>gmake distclean</> before reconfiguring and
rebuilding. Without this, your changes in configuration choices rebuilding. Without this, your changes in configuration choices
may not propagate everywhere they need to. might not propagate everywhere they need to.
</para> </para>
</sect1> </sect1>
...@@ -1636,7 +1636,7 @@ nohup /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data \ ...@@ -1636,7 +1636,7 @@ nohup /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data \
</para> </para>
<para> <para>
To stop a server running in the background you can type To stop a server running in the background you can type:
<programlisting> <programlisting>
kill `cat /usr/local/pgsql/data/postmaster.pid` kill `cat /usr/local/pgsql/data/postmaster.pid`
</programlisting> </programlisting>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/intro.sgml,v 1.31 2006/03/10 19:10:48 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/intro.sgml,v 1.32 2007/01/31 20:56:17 momjian Exp $ -->
<preface id="preface"> <preface id="preface">
<title>Preface</title> <title>Preface</title>
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
<listitem> <listitem>
<para> <para>
<xref linkend="internals"> contains assorted information that may be of <xref linkend="internals"> contains assorted information that might be of
use to <productname>PostgreSQL</> developers. use to <productname>PostgreSQL</> developers.
</para> </para>
</listitem> </listitem>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.222 2007/01/30 22:29:22 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.223 2007/01/31 20:56:17 momjian Exp $ -->
<chapter id="libpq"> <chapter id="libpq">
<title><application>libpq</application> - C Library</title> <title><application>libpq</application> - C Library</title>
...@@ -130,7 +130,7 @@ PGconn *PQconnectdb(const char *conninfo); ...@@ -130,7 +130,7 @@ PGconn *PQconnectdb(const char *conninfo);
</para> </para>
<para> <para>
Using <literal>hostaddr</> instead of <literal>host</> allows the Using <literal>hostaddr</> instead of <literal>host</> allows the
application to avoid a host name look-up, which may be important in application to avoid a host name look-up, which might be important in
applications with time constraints. However, Kerberos authentication applications with time constraints. However, Kerberos authentication
requires the host name. The following therefore applies: If requires the host name. The following therefore applies: If
<literal>host</> is specified without <literal>hostaddr</>, a host name <literal>host</> is specified without <literal>hostaddr</>, a host name
...@@ -429,7 +429,7 @@ PostgresPollingStatusType PQconnectPoll(PGconn *conn); ...@@ -429,7 +429,7 @@ PostgresPollingStatusType PQconnectPoll(PGconn *conn);
</para> </para>
<para> <para>
If <function>PQconnectStart</> succeeds, the next stage is to poll If <function>PQconnectStart</> succeeds, the next stage is to poll
<application>libpq</> so that it may proceed with the connection sequence. <application>libpq</> so that it can proceed with the connection sequence.
Use <function>PQsocket(conn)</function> to obtain the descriptor of the Use <function>PQsocket(conn)</function> to obtain the descriptor of the
socket underlying the database connection. socket underlying the database connection.
Loop thus: If <function>PQconnectPoll(conn)</function> last returned Loop thus: If <function>PQconnectPoll(conn)</function> last returned
...@@ -451,13 +451,13 @@ PostgresPollingStatusType PQconnectPoll(PGconn *conn); ...@@ -451,13 +451,13 @@ PostgresPollingStatusType PQconnectPoll(PGconn *conn);
</para> </para>
<para> <para>
At any time during connection, the status of the connection may be At any time during connection, the status of the connection can be
checked by calling <function>PQstatus</>. If this gives <symbol>CONNECTION_BAD</>, then the checked by calling <function>PQstatus</>. If this gives <symbol>CONNECTION_BAD</>, then the
connection procedure has failed; if it gives <function>CONNECTION_OK</>, then the connection procedure has failed; if it gives <function>CONNECTION_OK</>, then the
connection is ready. Both of these states are equally detectable connection is ready. Both of these states are equally detectable
from the return value of <function>PQconnectPoll</>, described above. Other states may also occur from the return value of <function>PQconnectPoll</>, described above. Other states might also occur
during (and only during) an asynchronous connection procedure. These during (and only during) an asynchronous connection procedure. These
indicate the current stage of the connection procedure and may be useful indicate the current stage of the connection procedure and might be useful
to provide feedback to the user for example. These statuses are: to provide feedback to the user for example. These statuses are:
<variablelist> <variablelist>
...@@ -583,7 +583,7 @@ typedef struct ...@@ -583,7 +583,7 @@ typedef struct
</para> </para>
<para> <para>
Returns a connection options array. This may be used to determine Returns a connection options array. This can be used to determine
all possible <function>PQconnectdb</function> options and their all possible <function>PQconnectdb</function> options and their
current default values. The return value points to an array of current default values. The return value points to an array of
<structname>PQconninfoOption</structname> structures, which ends <structname>PQconninfoOption</structname> structures, which ends
...@@ -638,7 +638,7 @@ void PQreset(PGconn *conn); ...@@ -638,7 +638,7 @@ void PQreset(PGconn *conn);
This function will close the connection This function will close the connection
to the server and attempt to reestablish a new to the server and attempt to reestablish a new
connection to the same server, using all the same connection to the same server, using all the same
parameters previously used. This may be useful for parameters previously used. This might be useful for
error recovery if a working connection is lost. error recovery if a working connection is lost.
</para> </para>
</listitem> </listitem>
...@@ -661,7 +661,7 @@ PostgresPollingStatusType PQresetPoll(PGconn *conn); ...@@ -661,7 +661,7 @@ PostgresPollingStatusType PQresetPoll(PGconn *conn);
<para> <para>
These functions will close the connection to the server and attempt to These functions will close the connection to the server and attempt to
reestablish a new connection to the same server, using all the same reestablish a new connection to the same server, using all the same
parameters previously used. This may be useful for error recovery if a parameters previously used. This can be useful for error recovery if a
working connection is lost. They differ from <function>PQreset</function> (above) in that they working connection is lost. They differ from <function>PQreset</function> (above) in that they
act in a nonblocking manner. These functions suffer from the same act in a nonblocking manner. These functions suffer from the same
restrictions as <function>PQconnectStart</> and <function>PQconnectPoll</>. restrictions as <function>PQconnectStart</> and <function>PQconnectPoll</>.
...@@ -682,7 +682,7 @@ PostgresPollingStatusType PQresetPoll(PGconn *conn); ...@@ -682,7 +682,7 @@ PostgresPollingStatusType PQresetPoll(PGconn *conn);
<title>Connection Status Functions</title> <title>Connection Status Functions</title>
<para> <para>
These functions may be used to interrogate the status These functions can be used to interrogate the status
of an existing database connection object. of an existing database connection object.
</para> </para>
...@@ -916,9 +916,9 @@ in a numeric form that is much easier to compare against. ...@@ -916,9 +916,9 @@ in a numeric form that is much easier to compare against.
<para> <para>
If no value for <literal>standard_conforming_strings</> is reported, If no value for <literal>standard_conforming_strings</> is reported,
applications may assume it is <literal>off</>, that is, backslashes applications can assume it is <literal>off</>, that is, backslashes
are treated as escapes in string literals. Also, the presence of this are treated as escapes in string literals. Also, the presence of this
parameter may be taken as an indication that the escape string syntax parameter can be taken as an indication that the escape string syntax
(<literal>E'...'</>) is accepted. (<literal>E'...'</>) is accepted.
</para> </para>
...@@ -938,7 +938,7 @@ It is unwise to assume the pointer will remain valid across queries. ...@@ -938,7 +938,7 @@ It is unwise to assume the pointer will remain valid across queries.
<synopsis> <synopsis>
int PQprotocolVersion(const PGconn *conn); int PQprotocolVersion(const PGconn *conn);
</synopsis> </synopsis>
Applications may wish to use this to determine whether certain features Applications might wish to use this to determine whether certain features
are supported. are supported.
Currently, the possible values are 2 (2.0 protocol), 3 (3.0 protocol), Currently, the possible values are 2 (2.0 protocol), 3 (3.0 protocol),
or zero (connection bad). This will not change after connection or zero (connection bad). This will not change after connection
...@@ -958,7 +958,7 @@ only protocol 2.0. (Protocol 1.0 is obsolete and not supported by <application> ...@@ -958,7 +958,7 @@ only protocol 2.0. (Protocol 1.0 is obsolete and not supported by <application>
<synopsis> <synopsis>
int PQserverVersion(const PGconn *conn); int PQserverVersion(const PGconn *conn);
</synopsis> </synopsis>
Applications may use this to determine the version of the database server they Applications might use this to determine the version of the database server they
are connected to. The number is formed by converting the major, minor, and are connected to. The number is formed by converting the major, minor, and
revision numbers into two-decimal-digit numbers and appending them revision numbers into two-decimal-digit numbers and appending them
together. For example, version 8.1.5 will be returned as 80105, and version together. For example, version 8.1.5 will be returned as 80105, and version
...@@ -1174,7 +1174,7 @@ The function arguments are: ...@@ -1174,7 +1174,7 @@ The function arguments are:
The number of parameters supplied; it is the length of the arrays The number of parameters supplied; it is the length of the arrays
<parameter>paramTypes[]</>, <parameter>paramValues[]</>, <parameter>paramTypes[]</>, <parameter>paramValues[]</>,
<parameter>paramLengths[]</>, and <parameter>paramFormats[]</>. (The <parameter>paramLengths[]</>, and <parameter>paramFormats[]</>. (The
array pointers may be <symbol>NULL</symbol> when <parameter>nParams</> array pointers can be <symbol>NULL</symbol> when <parameter>nParams</>
is zero.) is zero.)
</para> </para>
</listitem> </listitem>
...@@ -1212,7 +1212,7 @@ The function arguments are: ...@@ -1212,7 +1212,7 @@ The function arguments are:
<para> <para>
Specifies the actual data lengths of binary-format parameters. Specifies the actual data lengths of binary-format parameters.
It is ignored for null parameters and text-format parameters. It is ignored for null parameters and text-format parameters.
The array pointer may be null when there are no binary parameters. The array pointer can be null when there are no binary parameters.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -1249,7 +1249,7 @@ The function arguments are: ...@@ -1249,7 +1249,7 @@ The function arguments are:
<para> <para>
The primary advantage of <function>PQexecParams</> over <function>PQexec</> The primary advantage of <function>PQexecParams</> over <function>PQexec</>
is that parameter values may be separated from the command string, thus is that parameter values can be separated from the command string, thus
avoiding the need for tedious and error-prone quoting and escaping. avoiding the need for tedious and error-prone quoting and escaping.
</para> </para>
...@@ -1310,7 +1310,7 @@ connections; it will fail when using protocol 2.0. ...@@ -1310,7 +1310,7 @@ connections; it will fail when using protocol 2.0.
<para> <para>
The function creates a prepared statement named <parameter>stmtName</> The function creates a prepared statement named <parameter>stmtName</>
from the <parameter>query</> string, which must contain a single SQL command. from the <parameter>query</> string, which must contain a single SQL command.
<parameter>stmtName</> may be <literal>""</> to create an unnamed statement, <parameter>stmtName</> can be <literal>""</> to create an unnamed statement,
in which case any pre-existing unnamed statement is automatically replaced; in which case any pre-existing unnamed statement is automatically replaced;
otherwise it is an error if the statement name is already defined in the otherwise it is an error if the statement name is already defined in the
current session. current session.
...@@ -1318,12 +1318,12 @@ If any parameters are used, they are referred ...@@ -1318,12 +1318,12 @@ If any parameters are used, they are referred
to in the query as <literal>$1</>, <literal>$2</>, etc. to in the query as <literal>$1</>, <literal>$2</>, etc.
<parameter>nParams</> is the number of parameters for which types are <parameter>nParams</> is the number of parameters for which types are
pre-specified in the array <parameter>paramTypes[]</>. (The array pointer pre-specified in the array <parameter>paramTypes[]</>. (The array pointer
may be <symbol>NULL</symbol> when <parameter>nParams</> is zero.) can be <symbol>NULL</symbol> when <parameter>nParams</> is zero.)
<parameter>paramTypes[]</> specifies, by OID, the data types to be assigned to <parameter>paramTypes[]</> specifies, by OID, the data types to be assigned to
the parameter symbols. If <parameter>paramTypes</> is <symbol>NULL</symbol>, the parameter symbols. If <parameter>paramTypes</> is <symbol>NULL</symbol>,
or any particular element in the array is zero, the server assigns a data type or any particular element in the array is zero, the server assigns a data type
to the parameter symbol in the same way it would do for an untyped literal to the parameter symbol in the same way it would do for an untyped literal
string. Also, the query may use parameter symbols with numbers higher than string. Also, the query can use parameter symbols with numbers higher than
<parameter>nParams</>; data types will be inferred for these symbols as <parameter>nParams</>; data types will be inferred for these symbols as
well. (See <function>PQdescribePrepared</function> for a means to find out well. (See <function>PQdescribePrepared</function> for a means to find out
what data types were inferred.) what data types were inferred.)
...@@ -1410,12 +1410,12 @@ connections; it will fail when using protocol 2.0. ...@@ -1410,12 +1410,12 @@ connections; it will fail when using protocol 2.0.
</para> </para>
<para> <para>
<parameter>stmtName</> may be <literal>""</> or NULL to reference the unnamed <parameter>stmtName</> can be <literal>""</> or NULL to reference the unnamed
statement, otherwise it must be the name of an existing prepared statement. statement, otherwise it must be the name of an existing prepared statement.
On success, a <structname>PGresult</> with status On success, a <structname>PGresult</> with status
<literal>PGRES_COMMAND_OK</literal> is returned. The functions <literal>PGRES_COMMAND_OK</literal> is returned. The functions
<function>PQnparams</function> and <function>PQparamtype</function> <function>PQnparams</function> and <function>PQparamtype</function>
may be applied to this <structname>PGresult</> to obtain information can be applied to this <structname>PGresult</> to obtain information
about the parameters of the prepared statement, and the functions about the parameters of the prepared statement, and the functions
<function>PQnfields</function>, <function>PQfname</function>, <function>PQnfields</function>, <function>PQfname</function>,
<function>PQftype</function>, etc provide information about the result <function>PQftype</function>, etc provide information about the result
...@@ -1445,12 +1445,12 @@ connections; it will fail when using protocol 2.0. ...@@ -1445,12 +1445,12 @@ connections; it will fail when using protocol 2.0.
</para> </para>
<para> <para>
<parameter>portalName</> may be <literal>""</> or NULL to reference the unnamed <parameter>portalName</> can be <literal>""</> or NULL to reference the unnamed
portal, otherwise it must be the name of an existing portal. portal, otherwise it must be the name of an existing portal.
On success, a <structname>PGresult</> with status On success, a <structname>PGresult</> with status
<literal>PGRES_COMMAND_OK</literal> is returned. The functions <literal>PGRES_COMMAND_OK</literal> is returned. The functions
<function>PQnfields</function>, <function>PQfname</function>, <function>PQnfields</function>, <function>PQfname</function>,
<function>PQftype</function>, etc may be applied to the <function>PQftype</function>, etc can be applied to the
<structname>PGresult</> to obtain information about the result <structname>PGresult</> to obtain information about the result
columns (if any) of the portal. columns (if any) of the portal.
</para> </para>
...@@ -1549,7 +1549,7 @@ the query. Note that a <command>SELECT</command> command that happens ...@@ -1549,7 +1549,7 @@ the query. Note that a <command>SELECT</command> command that happens
to retrieve zero rows still shows <literal>PGRES_TUPLES_OK</literal>. to retrieve zero rows still shows <literal>PGRES_TUPLES_OK</literal>.
<literal>PGRES_COMMAND_OK</literal> is for commands that can never <literal>PGRES_COMMAND_OK</literal> is for commands that can never
return rows (<command>INSERT</command>, <command>UPDATE</command>, return rows (<command>INSERT</command>, <command>UPDATE</command>,
etc.). A response of <literal>PGRES_EMPTY_QUERY</literal> may indicate etc.). A response of <literal>PGRES_EMPTY_QUERY</literal> might indicate
a bug in the client software. a bug in the client software.
</para> </para>
...@@ -1673,7 +1673,7 @@ present. ...@@ -1673,7 +1673,7 @@ present.
<listitem> <listitem>
<para> <para>
Detail: an optional secondary error message carrying more detail about Detail: an optional secondary error message carrying more detail about
the problem. May run to multiple lines. the problem. Might run to multiple lines.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -1684,7 +1684,7 @@ the problem. May run to multiple lines. ...@@ -1684,7 +1684,7 @@ the problem. May run to multiple lines.
<para> <para>
Hint: an optional suggestion what to do about the problem. This is Hint: an optional suggestion what to do about the problem. This is
intended to differ from detail in that it offers advice (potentially intended to differ from detail in that it offers advice (potentially
inappropriate) rather than hard facts. May run to multiple lines. inappropriate) rather than hard facts. Might run to multiple lines.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -2278,7 +2278,7 @@ char *PQcmdStatus(PGresult *res); ...@@ -2278,7 +2278,7 @@ char *PQcmdStatus(PGresult *res);
</synopsis> </synopsis>
</para> </para>
<para> <para>
Commonly this is just the name of the command, but it may include additional Commonly this is just the name of the command, but it might include additional
data such as the number of rows processed. The caller should data such as the number of rows processed. The caller should
not free the result directly. It will be freed when the not free the result directly. It will be freed when the
associated <structname>PGresult</> handle is passed to associated <structname>PGresult</> handle is passed to
...@@ -2451,7 +2451,7 @@ size_t PQescapeString (char *to, const char *from, size_t length); ...@@ -2451,7 +2451,7 @@ size_t PQescapeString (char *to, const char *from, size_t length);
<function>PQescapeStringConn</>; the difference is that it does not <function>PQescapeStringConn</>; the difference is that it does not
take <parameter>conn</> or <parameter>error</> parameters. Because of this, take <parameter>conn</> or <parameter>error</> parameters. Because of this,
it cannot adjust its behavior depending on the connection properties (such as it cannot adjust its behavior depending on the connection properties (such as
character encoding) and therefore <emphasis>it may give the wrong results</>. character encoding) and therefore <emphasis>it might give the wrong results</>.
Also, it has no way to report error conditions. Also, it has no way to report error conditions.
</para> </para>
<para> <para>
...@@ -2552,7 +2552,7 @@ unsigned char *PQescapeBytea(const unsigned char *from, ...@@ -2552,7 +2552,7 @@ unsigned char *PQescapeBytea(const unsigned char *from,
take a <structname>PGconn</> parameter. Because of this, it cannot adjust take a <structname>PGconn</> parameter. Because of this, it cannot adjust
its behavior depending on the connection properties (in particular, its behavior depending on the connection properties (in particular,
whether standard-conforming strings are enabled) whether standard-conforming strings are enabled)
and therefore <emphasis>it may give the wrong results</>. Also, it and therefore <emphasis>it might give the wrong results</>. Also, it
has no way to return an error message on failure. has no way to return an error message on failure.
</para> </para>
...@@ -2641,7 +2641,7 @@ applications. It has a couple of deficiencies, however, that can be of importan ...@@ -2641,7 +2641,7 @@ applications. It has a couple of deficiencies, however, that can be of importan
<itemizedlist> <itemizedlist>
<listitem> <listitem>
<para> <para>
<function>PQexec</function> waits for the command to be completed. The application may have other <function>PQexec</function> waits for the command to be completed. The application might have other
work to do (such as maintaining a user interface), in which case it won't work to do (such as maintaining a user interface), in which case it won't
want to block waiting for the response. want to block waiting for the response.
</para> </para>
...@@ -2698,7 +2698,7 @@ int PQsendQuery(PGconn *conn, const char *command); ...@@ -2698,7 +2698,7 @@ int PQsendQuery(PGconn *conn, const char *command);
After successfully calling <function>PQsendQuery</function>, call After successfully calling <function>PQsendQuery</function>, call
<function>PQgetResult</function> one or more <function>PQgetResult</function> one or more
times to obtain the results. <function>PQsendQuery</function> may not be called times to obtain the results. <function>PQsendQuery</function> cannot be called
again (on the same connection) until <function>PQgetResult</function> has returned a null pointer, again (on the same connection) until <function>PQgetResult</function> has returned a null pointer,
indicating that the command is done. indicating that the command is done.
</para> </para>
...@@ -2890,12 +2890,12 @@ but returns 0 if there was some kind of trouble (in which case ...@@ -2890,12 +2890,12 @@ but returns 0 if there was some kind of trouble (in which case
<function>PQerrorMessage</function> can be consulted). Note that the result <function>PQerrorMessage</function> can be consulted). Note that the result
does not say does not say
whether any input data was actually collected. After calling whether any input data was actually collected. After calling
<function>PQconsumeInput</function>, the application may check <function>PQconsumeInput</function>, the application can check
<function>PQisBusy</function> and/or <function>PQnotifies</function> to see if <function>PQisBusy</function> and/or <function>PQnotifies</function> to see if
their state has changed. their state has changed.
</para> </para>
<para> <para>
<function>PQconsumeInput</function> may be called even if the application is not <function>PQconsumeInput</function> can be called even if the application is not
prepared to deal with a result or notification just yet. The prepared to deal with a result or notification just yet. The
function will read available data and save it in a buffer, thereby function will read available data and save it in a buffer, thereby
causing a <function>select()</function> read-ready indication to go away. The causing a <function>select()</function> read-ready indication to go away. The
...@@ -2960,7 +2960,7 @@ server. This is relatively uncommon but can happen if very long SQL commands ...@@ -2960,7 +2960,7 @@ server. This is relatively uncommon but can happen if very long SQL commands
or data values are sent. (It is much more probable if the application or data values are sent. (It is much more probable if the application
sends data via <command>COPY IN</command>, however.) To prevent this possibility and achieve sends data via <command>COPY IN</command>, however.) To prevent this possibility and achieve
completely nonblocking database operation, the following additional completely nonblocking database operation, the following additional
functions may be used. functions can be used.
<variablelist> <variablelist>
<varlistentry> <varlistentry>
...@@ -3168,7 +3168,7 @@ simple function calls to the server. ...@@ -3168,7 +3168,7 @@ simple function calls to the server.
<tip> <tip>
<para> <para>
This interface is somewhat obsolete, as one may achieve similar performance This interface is somewhat obsolete, as one can achieve similar performance
and greater functionality by setting up a prepared statement to define the and greater functionality by setting up a prepared statement to define the
function call. Then, executing the statement with binary transmission of function call. Then, executing the statement with binary transmission of
parameters and results substitutes for a fast-path function call. parameters and results substitutes for a fast-path function call.
...@@ -3357,7 +3357,7 @@ if any notifications came in during the processing of the command. ...@@ -3357,7 +3357,7 @@ if any notifications came in during the processing of the command.
is returned to indicate success or failure of the transfer. Its status is returned to indicate success or failure of the transfer. Its status
will be <literal>PGRES_COMMAND_OK</literal> for success or will be <literal>PGRES_COMMAND_OK</literal> for success or
<literal>PGRES_FATAL_ERROR</literal> if some problem was encountered. <literal>PGRES_FATAL_ERROR</literal> if some problem was encountered.
At this point further SQL commands may be issued via At this point further SQL commands can be issued via
<function>PQexec</function>. (It is not possible to execute other SQL <function>PQexec</function>. (It is not possible to execute other SQL
commands using the same connection while the <command>COPY</command> commands using the same connection while the <command>COPY</command>
operation is in progress.) operation is in progress.)
...@@ -3466,7 +3466,7 @@ value is -1. If the value is zero, wait for write-ready and try again.) ...@@ -3466,7 +3466,7 @@ value is -1. If the value is zero, wait for write-ready and try again.)
</para> </para>
<para> <para>
The application may divide the <command>COPY</command> data stream into buffer loads of any The application can divide the <command>COPY</command> data stream into buffer loads of any
convenient size. Buffer-load boundaries have no semantic significance when convenient size. Buffer-load boundaries have no semantic significance when
sending. The contents of the data stream must match the data format expected sending. The contents of the data stream must match the data format expected
by the <command>COPY</> command; see by the <command>COPY</> command; see
...@@ -3507,7 +3507,7 @@ value is -1. If the value is zero, wait for write-ready and try again.) ...@@ -3507,7 +3507,7 @@ value is -1. If the value is zero, wait for write-ready and try again.)
<para> <para>
After successfully calling <function>PQputCopyEnd</>, call After successfully calling <function>PQputCopyEnd</>, call
<function>PQgetResult</> to obtain the final result status of the <function>PQgetResult</> to obtain the final result status of the
<command>COPY</> command. One may wait for <command>COPY</> command. One can wait for
this result to be available in the usual way. Then return to normal this result to be available in the usual way. Then return to normal
operation. operation.
</para> </para>
...@@ -3575,7 +3575,7 @@ or the operation completes. ...@@ -3575,7 +3575,7 @@ or the operation completes.
<para> <para>
After <function>PQgetCopyData</> returns -1, call After <function>PQgetCopyData</> returns -1, call
<function>PQgetResult</> to obtain the final result status of the <function>PQgetResult</> to obtain the final result status of the
<command>COPY</> command. One may wait for <command>COPY</> command. One can wait for
this result to be available in the usual way. Then return to normal this result to be available in the usual way. Then return to normal
operation. operation.
</para> </para>
...@@ -3818,7 +3818,7 @@ the connection's previous setting. In <firstterm>TERSE</> mode, ...@@ -3818,7 +3818,7 @@ the connection's previous setting. In <firstterm>TERSE</> mode,
returned messages include severity, primary text, and position only; returned messages include severity, primary text, and position only;
this will normally fit on a single line. The default mode produces this will normally fit on a single line. The default mode produces
messages that include the above plus any detail, hint, or context messages that include the above plus any detail, hint, or context
fields (these may span multiple lines). The <firstterm>VERBOSE</> fields (these might span multiple lines). The <firstterm>VERBOSE</>
mode includes all available fields. Changing the verbosity does not mode includes all available fields. Changing the verbosity does not
affect the messages available from already-existing affect the messages available from already-existing
<structname>PGresult</> objects, only subsequently-created ones. <structname>PGresult</> objects, only subsequently-created ones.
...@@ -3888,7 +3888,7 @@ and so on. Instead, use this function to convert the password to encrypted ...@@ -3888,7 +3888,7 @@ and so on. Instead, use this function to convert the password to encrypted
form before it is sent. The arguments are the cleartext password, and the SQL form before it is sent. The arguments are the cleartext password, and the SQL
name of the user it is for. The return value is a string allocated by name of the user it is for. The return value is a string allocated by
<function>malloc</function>, or <symbol>NULL</symbol> if out of memory. <function>malloc</function>, or <symbol>NULL</symbol> if out of memory.
The caller may assume the string doesn't contain any special The caller can assume the string doesn't contain any special
characters that would require escaping. Use <function>PQfreemem</> to free characters that would require escaping. Use <function>PQfreemem</> to free
the result when done with it. the result when done with it.
</para> </para>
...@@ -4308,7 +4308,7 @@ This file should contain lines of the following format: ...@@ -4308,7 +4308,7 @@ This file should contain lines of the following format:
<synopsis> <synopsis>
<replaceable>hostname</replaceable>:<replaceable>port</replaceable>:<replaceable>database</replaceable>:<replaceable>username</replaceable>:<replaceable>password</replaceable> <replaceable>hostname</replaceable>:<replaceable>port</replaceable>:<replaceable>database</replaceable>:<replaceable>username</replaceable>:<replaceable>password</replaceable>
</synopsis> </synopsis>
Each of the first four fields may be a literal value, or <literal>*</literal>, Each of the first four fields can be a literal value, or <literal>*</literal>,
which matches anything. The password field from the first line that matches the which matches anything. The password field from the first line that matches the
current connection parameters will be used. (Therefore, put more-specific current connection parameters will be used. (Therefore, put more-specific
entries first when you are using wildcards.) entries first when you are using wildcards.)
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/lobj.sgml,v 1.42 2006/10/23 18:10:31 petere Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/lobj.sgml,v 1.43 2007/01/31 20:56:17 momjian Exp $ -->
<chapter id="largeObjects"> <chapter id="largeObjects">
<title id="largeObjects-title">Large Objects</title> <title id="largeObjects-title">Large Objects</title>
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
large object data. We use the <application>libpq</application> C large object data. We use the <application>libpq</application> C
library for the examples in this chapter, but most programming library for the examples in this chapter, but most programming
interfaces native to <productname>PostgreSQL</productname> support interfaces native to <productname>PostgreSQL</productname> support
equivalent functionality. Other interfaces may use the large equivalent functionality. Other interfaces might use the large
object interface internally to provide generic support for large object interface internally to provide generic support for large
values. This is not described here. values. This is not described here.
</para> </para>
...@@ -305,7 +305,7 @@ int lo_tell(PGconn *conn, int fd); ...@@ -305,7 +305,7 @@ int lo_tell(PGconn *conn, int fd);
<title>Closing a Large Object Descriptor</title> <title>Closing a Large Object Descriptor</title>
<para> <para>
A large object descriptor may be closed by calling A large object descriptor can be closed by calling
<synopsis> <synopsis>
int lo_close(PGconn *conn, int fd); int lo_close(PGconn *conn, int fd);
</synopsis> </synopsis>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/maintenance.sgml,v 1.67 2007/01/31 04:13:22 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/maintenance.sgml,v 1.68 2007/01/31 20:56:17 momjian Exp $ -->
<chapter id="maintenance"> <chapter id="maintenance">
<title>Routine Database Maintenance Tasks</title> <title>Routine Database Maintenance Tasks</title>
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
<para> <para>
Clearly, a table that receives frequent updates or deletes will need Clearly, a table that receives frequent updates or deletes will need
to be vacuumed more often than tables that are seldom updated. It to be vacuumed more often than tables that are seldom updated. It
may be useful to set up periodic <application>cron</> tasks that might be useful to set up periodic <application>cron</> tasks that
<command>VACUUM</command> only selected tables, skipping tables that are known not to <command>VACUUM</command> only selected tables, skipping tables that are known not to
change often. This is only likely to be helpful if you have both change often. This is only likely to be helpful if you have both
large heavily-updated tables and large seldom-updated tables &mdash; the large heavily-updated tables and large seldom-updated tables &mdash; the
...@@ -185,7 +185,7 @@ ...@@ -185,7 +185,7 @@
If you have multiple databases If you have multiple databases
in a cluster, don't forget to <command>VACUUM</command> each one; in a cluster, don't forget to <command>VACUUM</command> each one;
the program <xref linkend="app-vacuumdb" endterm="app-vacuumdb-title"> the program <xref linkend="app-vacuumdb" endterm="app-vacuumdb-title">
may be helpful. might be helpful.
</para> </para>
<para> <para>
...@@ -226,14 +226,14 @@ ...@@ -226,14 +226,14 @@
generate good plans for queries. These statistics are gathered by generate good plans for queries. These statistics are gathered by
the <command>ANALYZE</> command, which can be invoked by itself or the <command>ANALYZE</> command, which can be invoked by itself or
as an optional step in <command>VACUUM</>. It is important to have as an optional step in <command>VACUUM</>. It is important to have
reasonably accurate statistics, otherwise poor choices of plans may reasonably accurate statistics, otherwise poor choices of plans might
degrade database performance. degrade database performance.
</para> </para>
<para> <para>
As with vacuuming for space recovery, frequent updates of statistics As with vacuuming for space recovery, frequent updates of statistics
are more useful for heavily-updated tables than for seldom-updated are more useful for heavily-updated tables than for seldom-updated
ones. But even for a heavily-updated table, there may be no need for ones. But even for a heavily-updated table, there might be no need for
statistics updates if the statistical distribution of the data is statistics updates if the statistical distribution of the data is
not changing much. A simple rule of thumb is to think about how much not changing much. A simple rule of thumb is to think about how much
the minimum and maximum values of the columns in the table change. the minimum and maximum values of the columns in the table change.
...@@ -241,7 +241,7 @@ ...@@ -241,7 +241,7 @@
of row update will have a constantly-increasing maximum value as of row update will have a constantly-increasing maximum value as
rows are added and updated; such a column will probably need more rows are added and updated; such a column will probably need more
frequent statistics updates than, say, a column containing URLs for frequent statistics updates than, say, a column containing URLs for
pages accessed on a website. The URL column may receive changes just pages accessed on a website. The URL column might receive changes just
as often, but the statistical distribution of its values probably as often, but the statistical distribution of its values probably
changes relatively slowly. changes relatively slowly.
</para> </para>
...@@ -257,11 +257,11 @@ ...@@ -257,11 +257,11 @@
<tip> <tip>
<para> <para>
Although per-column tweaking of <command>ANALYZE</> frequency may not be Although per-column tweaking of <command>ANALYZE</> frequency might not be
very productive, you may well find it worthwhile to do per-column very productive, you might well find it worthwhile to do per-column
adjustment of the level of detail of the statistics collected by adjustment of the level of detail of the statistics collected by
<command>ANALYZE</>. Columns that are heavily used in <literal>WHERE</> clauses <command>ANALYZE</>. Columns that are heavily used in <literal>WHERE</> clauses
and have highly irregular data distributions may require a finer-grain and have highly irregular data distributions might require a finer-grain
data histogram than other columns. See <command>ALTER TABLE SET data histogram than other columns. See <command>ALTER TABLE SET
STATISTICS</>. STATISTICS</>.
</para> </para>
...@@ -271,7 +271,7 @@ ...@@ -271,7 +271,7 @@
Recommended practice for most sites is to schedule a database-wide Recommended practice for most sites is to schedule a database-wide
<command>ANALYZE</> once a day at a low-usage time of day; this can <command>ANALYZE</> once a day at a low-usage time of day; this can
usefully be combined with a nightly <command>VACUUM</>. However, usefully be combined with a nightly <command>VACUUM</>. However,
sites with relatively slowly changing table statistics may find that sites with relatively slowly changing table statistics might find that
this is overkill, and that less-frequent <command>ANALYZE</> runs this is overkill, and that less-frequent <command>ANALYZE</> runs
are sufficient. are sufficient.
</para> </para>
...@@ -381,7 +381,7 @@ ...@@ -381,7 +381,7 @@
<para> <para>
One disadvantage of decreasing <varname>vacuum_freeze_min_age</> is that One disadvantage of decreasing <varname>vacuum_freeze_min_age</> is that
it may cause <command>VACUUM</> to do useless work: changing a table row's it might cause <command>VACUUM</> to do useless work: changing a table row's
XID to <literal>FrozenXID</> is a waste of time if the row is modified XID to <literal>FrozenXID</> is a waste of time if the row is modified
soon thereafter (causing it to acquire a new XID). So the setting should soon thereafter (causing it to acquire a new XID). So the setting should
be large enough that rows are not frozen until they are unlikely to change be large enough that rows are not frozen until they are unlikely to change
...@@ -510,7 +510,7 @@ vacuum threshold = vacuum base threshold + vacuum scale factor * number of tuple ...@@ -510,7 +510,7 @@ vacuum threshold = vacuum base threshold + vacuum scale factor * number of tuple
The number of obsolete tuples is obtained from the statistics The number of obsolete tuples is obtained from the statistics
collector; it is a semi-accurate count updated by each collector; it is a semi-accurate count updated by each
<command>UPDATE</command> and <command>DELETE</command> operation. (It <command>UPDATE</command> and <command>DELETE</command> operation. (It
is only semi-accurate because some information may be lost under heavy is only semi-accurate because some information might be lost under heavy
load.) For analyze, a similar condition is used: the threshold, defined as load.) For analyze, a similar condition is used: the threshold, defined as
<programlisting> <programlisting>
analyze threshold = analyze base threshold + analyze scale factor * number of tuples analyze threshold = analyze base threshold + analyze scale factor * number of tuples
...@@ -658,7 +658,7 @@ analyze threshold = analyze base threshold + analyze scale factor * number of tu ...@@ -658,7 +658,7 @@ analyze threshold = analyze base threshold + analyze scale factor * number of tu
<command>postgres</command> into a <command>postgres</command> into a
file, you will have log output, but file, you will have log output, but
the only way to truncate the log file is to stop and restart the only way to truncate the log file is to stop and restart
the server. This may be OK if you are using the server. This might be OK if you are using
<productname>PostgreSQL</productname> in a development environment, <productname>PostgreSQL</productname> in a development environment,
but few production servers would find this behavior acceptable. but few production servers would find this behavior acceptable.
</para> </para>
...@@ -707,7 +707,7 @@ pg_ctl start | rotatelogs /var/log/pgsql_log 86400 ...@@ -707,7 +707,7 @@ pg_ctl start | rotatelogs /var/log/pgsql_log 86400
<para> <para>
On many systems, however, <application>syslog</> is not very reliable, On many systems, however, <application>syslog</> is not very reliable,
particularly with large log messages; it may truncate or drop messages particularly with large log messages; it might truncate or drop messages
just when you need them the most. Also, on <productname>Linux</>, just when you need them the most. Also, on <productname>Linux</>,
<application>syslog</> will sync each message to disk, yielding poor <application>syslog</> will sync each message to disk, yielding poor
performance. (You can use a <literal>-</> at the start of the file name performance. (You can use a <literal>-</> at the start of the file name
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/manage-ag.sgml,v 2.51 2007/01/22 02:47:56 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/manage-ag.sgml,v 2.52 2007/01/31 20:56:17 momjian Exp $ -->
<chapter id="managing-databases"> <chapter id="managing-databases">
<title>Managing Databases</title> <title>Managing Databases</title>
...@@ -143,7 +143,7 @@ createdb <replaceable class="parameter">dbname</replaceable> ...@@ -143,7 +143,7 @@ createdb <replaceable class="parameter">dbname</replaceable>
exactly as described above. exactly as described above.
The <xref linkend="app-createdb"> reference page contains the invocation The <xref linkend="app-createdb"> reference page contains the invocation
details. Note that <command>createdb</> without any arguments will create details. Note that <command>createdb</> without any arguments will create
a database with the current user name, which may or may not be what a database with the current user name, which might or might not be what
you want. you want.
</para> </para>
...@@ -204,7 +204,7 @@ createdb -O <replaceable>rolename</> <replaceable>dbname</> ...@@ -204,7 +204,7 @@ createdb -O <replaceable>rolename</> <replaceable>dbname</>
<literal>pg_dump</> dump: the dump script should be restored in a <literal>pg_dump</> dump: the dump script should be restored in a
virgin database to ensure that one recreates the correct contents virgin database to ensure that one recreates the correct contents
of the dumped database, without any conflicts with additions that of the dumped database, without any conflicts with additions that
may now be present in <literal>template1</>. can now be present in <literal>template1</>.
</para> </para>
<para> <para>
...@@ -221,7 +221,7 @@ createdb -T template0 <replaceable>dbname</> ...@@ -221,7 +221,7 @@ createdb -T template0 <replaceable>dbname</>
<para> <para>
It is possible to create additional template databases, and indeed It is possible to create additional template databases, and indeed
one may copy any database in a cluster by specifying its name one can copy any database in a cluster by specifying its name
as the template for <command>CREATE DATABASE</>. It is important to as the template for <command>CREATE DATABASE</>. It is important to
understand, however, that this is not (yet) intended as understand, however, that this is not (yet) intended as
a general-purpose <quote><command>COPY DATABASE</command></quote> facility. a general-purpose <quote><command>COPY DATABASE</command></quote> facility.
...@@ -236,11 +236,11 @@ createdb -T template0 <replaceable>dbname</> ...@@ -236,11 +236,11 @@ createdb -T template0 <replaceable>dbname</>
Two useful flags exist in <literal>pg_database</literal><indexterm><primary>pg_database</></> for each Two useful flags exist in <literal>pg_database</literal><indexterm><primary>pg_database</></> for each
database: the columns <literal>datistemplate</literal> and database: the columns <literal>datistemplate</literal> and
<literal>datallowconn</literal>. <literal>datistemplate</literal> <literal>datallowconn</literal>. <literal>datistemplate</literal>
may be set to indicate that a database is intended as a template for can be set to indicate that a database is intended as a template for
<command>CREATE DATABASE</>. If this flag is set, the database may be <command>CREATE DATABASE</>. If this flag is set, the database can be
cloned by cloned by
any user with <literal>CREATEDB</> privileges; if it is not set, only superusers any user with <literal>CREATEDB</> privileges; if it is not set, only superusers
and the owner of the database may clone it. and the owner of the database can clone it.
If <literal>datallowconn</literal> is false, then no new connections If <literal>datallowconn</literal> is false, then no new connections
to that database will be allowed (but existing sessions are not killed to that database will be allowed (but existing sessions are not killed
simply by setting the flag false). The <literal>template0</literal> simply by setting the flag false). The <literal>template0</literal>
...@@ -265,7 +265,7 @@ createdb -T template0 <replaceable>dbname</> ...@@ -265,7 +265,7 @@ createdb -T template0 <replaceable>dbname</>
The <literal>postgres</> database is also created when a database The <literal>postgres</> database is also created when a database
cluster is initialized. This database is meant as a default database for cluster is initialized. This database is meant as a default database for
users and applications to connect to. It is simply a copy of users and applications to connect to. It is simply a copy of
<literal>template1</> and may be dropped and recreated if required. <literal>template1</> and can be dropped and recreated if required.
</para> </para>
</note> </note>
</sect1> </sect1>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/monitoring.sgml,v 1.43 2006/12/08 19:16:17 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/monitoring.sgml,v 1.44 2007/01/31 20:56:18 momjian Exp $ -->
<chapter id="monitoring"> <chapter id="monitoring">
<title>Monitoring Database Activity</title> <title>Monitoring Database Activity</title>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
but one should not neglect regular Unix monitoring programs such as but one should not neglect regular Unix monitoring programs such as
<command>ps</>, <command>top</>, <command>iostat</>, and <command>vmstat</>. <command>ps</>, <command>top</>, <command>iostat</>, and <command>vmstat</>.
Also, once one has identified a Also, once one has identified a
poorly-performing query, further investigation may be needed using poorly-performing query, further investigation might be needed using
<productname>PostgreSQL</productname>'s <xref linkend="sql-explain" <productname>PostgreSQL</productname>'s <xref linkend="sql-explain"
endterm="sql-explain-title"> command. endterm="sql-explain-title"> command.
<xref linkend="using-explain"> discusses <command>EXPLAIN</> <xref linkend="using-explain"> discusses <command>EXPLAIN</>
...@@ -75,7 +75,7 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re ...@@ -75,7 +75,7 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
The user, database, and connection source host items remain the same for The user, database, and connection source host items remain the same for
the life of the client connection, but the activity indicator changes. the life of the client connection, but the activity indicator changes.
The activity may be <literal>idle</> (i.e., waiting for a client command), The activity can be <literal>idle</> (i.e., waiting for a client command),
<literal>idle in transaction</> (waiting for client inside a <command>BEGIN</> block), <literal>idle in transaction</> (waiting for client inside a <command>BEGIN</> block),
or a command type name such as <literal>SELECT</>. Also, or a command type name such as <literal>SELECT</>. Also,
<literal>waiting</> is attached if the server process is presently waiting <literal>waiting</> is attached if the server process is presently waiting
...@@ -141,7 +141,7 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re ...@@ -141,7 +141,7 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
<para> <para>
The parameter <xref linkend="guc-stats-start-collector"> must be The parameter <xref linkend="guc-stats-start-collector"> must be
set to <literal>true</> for the statistics collector to be launched set to <literal>true</> for the statistics collector to be launched
at all. This is the default and recommended setting, but it may be at all. This is the default and recommended setting, but it can be
turned off if you have no interest in statistics and want to turned off if you have no interest in statistics and want to
squeeze out every last drop of overhead. (The savings is likely to squeeze out every last drop of overhead. (The savings is likely to
be small, however.) Note that this option cannot be changed while be small, however.) Note that this option cannot be changed while
...@@ -423,8 +423,8 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re ...@@ -423,8 +423,8 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
invoking a kernel call. However, these statistics do not give the invoking a kernel call. However, these statistics do not give the
entire story: due to the way in which <productname>PostgreSQL</> entire story: due to the way in which <productname>PostgreSQL</>
handles disk I/O, data that is not in the handles disk I/O, data that is not in the
<productname>PostgreSQL</> buffer cache may still reside in the <productname>PostgreSQL</> buffer cache might still reside in the
kernel's I/O cache, and may therefore still be fetched without kernel's I/O cache, and might therefore still be fetched without
requiring a physical read. Users interested in obtaining more requiring a physical read. Users interested in obtaining more
detailed information on <productname>PostgreSQL</> I/O behavior are detailed information on <productname>PostgreSQL</> I/O behavior are
advised to use the <productname>PostgreSQL</> statistics collector advised to use the <productname>PostgreSQL</> statistics collector
...@@ -971,7 +971,7 @@ Total time (ns) 2312105013 ...@@ -971,7 +971,7 @@ Total time (ns) 2312105013
</para> </para>
<para> <para>
You should remember that trace programs need to be carefully written and You should remember that trace programs need to be carefully written and
debugged prior to their use, otherwise the trace information collected may debugged prior to their use, otherwise the trace information collected might
be meaningless. In most cases where problems are found it is the be meaningless. In most cases where problems are found it is the
instrumentation that is at fault, not the underlying system. When instrumentation that is at fault, not the underlying system. When
discussing information found using dynamic tracing, be sure to enclose discussing information found using dynamic tracing, be sure to enclose
...@@ -1027,7 +1027,7 @@ StartTransaction(void) ...@@ -1027,7 +1027,7 @@ StartTransaction(void)
</para> </para>
<para> <para>
The dynamic tracing utility may require you to further define these trace The dynamic tracing utility might require you to further define these trace
points. For example, DTrace requires you to add new probes to the file points. For example, DTrace requires you to add new probes to the file
<filename>src/backend/utils/probes.d</> as shown here: <filename>src/backend/utils/probes.d</> as shown here:
<programlisting> <programlisting>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/mvcc.sgml,v 2.65 2006/12/01 01:04:36 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/mvcc.sgml,v 2.66 2007/01/31 20:56:18 momjian Exp $ -->
<chapter id="mvcc"> <chapter id="mvcc">
<title>Concurrency Control</title> <title>Concurrency Control</title>
...@@ -215,7 +215,7 @@ ...@@ -215,7 +215,7 @@
Committed and Serializable. When you select the level Read Committed and Serializable. When you select the level Read
Uncommitted you really get Read Committed, and when you select Uncommitted you really get Read Committed, and when you select
Repeatable Read you really get Serializable, so the actual Repeatable Read you really get Serializable, so the actual
isolation level may be stricter than what you select. This is isolation level might be stricter than what you select. This is
permitted by the SQL standard: the four isolation levels only permitted by the SQL standard: the four isolation levels only
define which phenomena must not happen, they do not define which define which phenomena must not happen, they do not define which
phenomena must happen. The reason that <productname>PostgreSQL</> phenomena must happen. The reason that <productname>PostgreSQL</>
...@@ -261,7 +261,7 @@ ...@@ -261,7 +261,7 @@
behave the same as <command>SELECT</command> behave the same as <command>SELECT</command>
in terms of searching for target rows: they will only find target rows in terms of searching for target rows: they will only find target rows
that were committed as of the command start time. However, such a target that were committed as of the command start time. However, such a target
row may have already been updated (or deleted or locked) by row might have already been updated (or deleted or locked) by
another concurrent transaction by the time it is found. In this case, the another concurrent transaction by the time it is found. In this case, the
would-be updater will wait for the first updating transaction to commit or would-be updater will wait for the first updating transaction to commit or
roll back (if it is still in progress). If the first updater rolls back, roll back (if it is still in progress). If the first updater rolls back,
...@@ -314,7 +314,7 @@ COMMIT; ...@@ -314,7 +314,7 @@ COMMIT;
<para> <para>
The partial transaction isolation provided by Read Committed mode is The partial transaction isolation provided by Read Committed mode is
adequate for many applications, and this mode is fast and simple to use. adequate for many applications, and this mode is fast and simple to use.
However, for applications that do complex queries and updates, it may However, for applications that do complex queries and updates, it might
be necessary to guarantee a more rigorously consistent view of the be necessary to guarantee a more rigorously consistent view of the
database than the Read Committed mode provides. database than the Read Committed mode provides.
</para> </para>
...@@ -359,7 +359,7 @@ COMMIT; ...@@ -359,7 +359,7 @@ COMMIT;
in terms of searching for target rows: they will only find target rows in terms of searching for target rows: they will only find target rows
that were committed as of the transaction start time. However, such a that were committed as of the transaction start time. However, such a
target target
row may have already been updated (or deleted or locked) by row might have already been updated (or deleted or locked) by
another concurrent transaction by the time it is found. In this case, the another concurrent transaction by the time it is found. In this case, the
serializable transaction will wait for the first updating transaction to commit or serializable transaction will wait for the first updating transaction to commit or
roll back (if it is still in progress). If the first updater rolls back, roll back (if it is still in progress). If the first updater rolls back,
...@@ -386,7 +386,7 @@ ERROR: could not serialize access due to concurrent update ...@@ -386,7 +386,7 @@ ERROR: could not serialize access due to concurrent update
</para> </para>
<para> <para>
Note that only updating transactions may need to be retried; read-only Note that only updating transactions might need to be retried; read-only
transactions will never have serialization conflicts. transactions will never have serialization conflicts.
</para> </para>
...@@ -395,9 +395,9 @@ ERROR: could not serialize access due to concurrent update ...@@ -395,9 +395,9 @@ ERROR: could not serialize access due to concurrent update
transaction sees a wholly consistent view of the database. However, transaction sees a wholly consistent view of the database. However,
the application has to be prepared to retry transactions when concurrent the application has to be prepared to retry transactions when concurrent
updates make it impossible to sustain the illusion of serial execution. updates make it impossible to sustain the illusion of serial execution.
Since the cost of redoing complex transactions may be significant, Since the cost of redoing complex transactions might be significant,
this mode is recommended only when updating transactions contain logic this mode is recommended only when updating transactions contain logic
sufficiently complex that they may give wrong answers in Read sufficiently complex that they might give wrong answers in Read
Committed mode. Most commonly, Serializable mode is necessary when Committed mode. Most commonly, Serializable mode is necessary when
a transaction executes several successive commands that must see a transaction executes several successive commands that must see
identical views of the database. identical views of the database.
...@@ -418,7 +418,7 @@ ERROR: could not serialize access due to concurrent update ...@@ -418,7 +418,7 @@ ERROR: could not serialize access due to concurrent update
The intuitive meaning (and mathematical definition) of The intuitive meaning (and mathematical definition) of
<quote>serializable</> execution is that any two successfully committed <quote>serializable</> execution is that any two successfully committed
concurrent transactions will appear to have executed strictly serially, concurrent transactions will appear to have executed strictly serially,
one after the other &mdash; although which one appeared to occur first may one after the other &mdash; although which one appeared to occur first might
not be predictable in advance. It is important to realize that forbidding not be predictable in advance. It is important to realize that forbidding
the undesirable behaviors listed in <xref linkend="mvcc-isolevel-table"> the undesirable behaviors listed in <xref linkend="mvcc-isolevel-table">
is not sufficient to guarantee true serializability, and in fact is not sufficient to guarantee true serializability, and in fact
...@@ -538,10 +538,10 @@ SELECT SUM(value) FROM mytab WHERE class = 2; ...@@ -538,10 +538,10 @@ SELECT SUM(value) FROM mytab WHERE class = 2;
between one lock mode and another is the set of lock modes with between one lock mode and another is the set of lock modes with
which each conflicts. Two transactions cannot hold locks of conflicting which each conflicts. Two transactions cannot hold locks of conflicting
modes on the same table at the same time. (However, a transaction modes on the same table at the same time. (However, a transaction
never conflicts with itself. For example, it may acquire never conflicts with itself. For example, it might acquire
<literal>ACCESS EXCLUSIVE</literal> lock and later acquire <literal>ACCESS EXCLUSIVE</literal> lock and later acquire
<literal>ACCESS SHARE</literal> lock on the same table.) Non-conflicting <literal>ACCESS SHARE</literal> lock on the same table.) Non-conflicting
lock modes may be held concurrently by many transactions. Notice in lock modes can be held concurrently by many transactions. Notice in
particular that some lock modes are self-conflicting (for example, particular that some lock modes are self-conflicting (for example,
an <literal>ACCESS EXCLUSIVE</literal> lock cannot be held by more than one an <literal>ACCESS EXCLUSIVE</literal> lock cannot be held by more than one
transaction at a time) while others are not self-conflicting (for example, transaction at a time) while others are not self-conflicting (for example,
...@@ -760,7 +760,7 @@ SELECT SUM(value) FROM mytab WHERE class = 2; ...@@ -760,7 +760,7 @@ SELECT SUM(value) FROM mytab WHERE class = 2;
To acquire an exclusive row-level lock on a row without actually To acquire an exclusive row-level lock on a row without actually
modifying the row, select the row with <command>SELECT FOR modifying the row, select the row with <command>SELECT FOR
UPDATE</command>. Note that once the row-level lock is acquired, UPDATE</command>. Note that once the row-level lock is acquired,
the transaction may update the row multiple times without the transaction can update the row multiple times without
fear of conflicts. fear of conflicts.
</para> </para>
...@@ -777,7 +777,7 @@ SELECT SUM(value) FROM mytab WHERE class = 2; ...@@ -777,7 +777,7 @@ SELECT SUM(value) FROM mytab WHERE class = 2;
<productname>PostgreSQL</productname> doesn't remember any <productname>PostgreSQL</productname> doesn't remember any
information about modified rows in memory, so it has no limit to information about modified rows in memory, so it has no limit to
the number of rows locked at one time. However, locking a row the number of rows locked at one time. However, locking a row
may cause a disk write; thus, for example, <command>SELECT FOR might cause a disk write; thus, for example, <command>SELECT FOR
UPDATE</command> will modify selected rows to mark them locked, and so UPDATE</command> will modify selected rows to mark them locked, and so
will result in disk writes. will result in disk writes.
</para> </para>
...@@ -863,7 +863,7 @@ UPDATE accounts SET balance = balance - 100.00 WHERE acctnum = 22222; ...@@ -863,7 +863,7 @@ UPDATE accounts SET balance = balance - 100.00 WHERE acctnum = 22222;
occurred. One should also ensure that the first lock acquired on occurred. One should also ensure that the first lock acquired on
an object in a transaction is the highest mode that will be an object in a transaction is the highest mode that will be
needed for that object. If it is not feasible to verify this in needed for that object. If it is not feasible to verify this in
advance, then deadlocks may be handled on-the-fly by retrying advance, then deadlocks can be handled on-the-fly by retrying
transactions that are aborted due to deadlock. transactions that are aborted due to deadlock.
</para> </para>
...@@ -977,12 +977,12 @@ SELECT pg_advisory_lock(q.id) FROM ...@@ -977,12 +977,12 @@ SELECT pg_advisory_lock(q.id) FROM
<para> <para>
Another way to think about it is that each Another way to think about it is that each
transaction sees a snapshot of the database contents, and concurrently transaction sees a snapshot of the database contents, and concurrently
executing transactions may very well see different snapshots. So the executing transactions might very well see different snapshots. So the
whole concept of <quote>now</quote> is somewhat ill-defined anyway. whole concept of <quote>now</quote> is somewhat ill-defined anyway.
This is not normally This is not normally
a big problem if the client applications are isolated from each other, a big problem if the client applications are isolated from each other,
but if the clients can communicate via channels outside the database but if the clients can communicate via channels outside the database
then serious confusion may ensue. then serious confusion might ensue.
</para> </para>
<para> <para>
...@@ -1026,7 +1026,7 @@ SELECT pg_advisory_lock(q.id) FROM ...@@ -1026,7 +1026,7 @@ SELECT pg_advisory_lock(q.id) FROM
lock(s) before performing queries. A lock obtained by a lock(s) before performing queries. A lock obtained by a
serializable transaction guarantees that no other transactions modifying serializable transaction guarantees that no other transactions modifying
the table are still running, but if the snapshot seen by the the table are still running, but if the snapshot seen by the
transaction predates obtaining the lock, it may predate some now-committed transaction predates obtaining the lock, it might predate some now-committed
changes in the table. A serializable transaction's snapshot is actually changes in the table. A serializable transaction's snapshot is actually
frozen at the start of its first query or data-modification command frozen at the start of its first query or data-modification command
(<literal>SELECT</>, <literal>INSERT</>, (<literal>SELECT</>, <literal>INSERT</>,
...@@ -1092,7 +1092,7 @@ SELECT pg_advisory_lock(q.id) FROM ...@@ -1092,7 +1092,7 @@ SELECT pg_advisory_lock(q.id) FROM
read/write access. Locks are released immediately after each read/write access. Locks are released immediately after each
index row is fetched or inserted. But note that a GIN-indexed index row is fetched or inserted. But note that a GIN-indexed
value insertion usually produces several index key insertions value insertion usually produces several index key insertions
per row, so GIN may do substantial work for a single value's per row, so GIN might do substantial work for a single value's
insertion. insertion.
</para> </para>
</listitem> </listitem>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/nls.sgml,v 1.14 2006/03/10 19:10:48 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/nls.sgml,v 1.15 2007/01/31 20:56:18 momjian Exp $ -->
<chapter id="nls"> <chapter id="nls">
<chapterinfo> <chapterinfo>
...@@ -108,7 +108,7 @@ msgstr "another translated" ...@@ -108,7 +108,7 @@ msgstr "another translated"
<para> <para>
The # character introduces a comment. If whitespace immediately The # character introduces a comment. If whitespace immediately
follows the # character, then this is a comment maintained by the follows the # character, then this is a comment maintained by the
translator. There may also be automatic comments, which have a translator. There can also be automatic comments, which have a
non-whitespace character immediately following the #. These are non-whitespace character immediately following the #. These are
maintained by the various tools that operate on the PO files and maintained by the various tools that operate on the PO files and
are intended to aid the translator. are intended to aid the translator.
...@@ -157,7 +157,7 @@ msgstr "another translated" ...@@ -157,7 +157,7 @@ msgstr "another translated"
ISO 639-1 two-letter language code (in lower case)</ulink>, e.g., ISO 639-1 two-letter language code (in lower case)</ulink>, e.g.,
<filename>fr.po</filename> for French. If there is really a need <filename>fr.po</filename> for French. If there is really a need
for more than one translation effort per language then the files for more than one translation effort per language then the files
may also be named can also be named
<filename><replaceable>language</replaceable>_<replaceable>region</replaceable>.po</filename> <filename><replaceable>language</replaceable>_<replaceable>region</replaceable>.po</filename>
where <replaceable>region</replaceable> is the where <replaceable>region</replaceable> is the
<ulink url="http://www.din.de/gremien/nas/nabd/iso3166ma/codlstp1/en_listp1.html"> <ulink url="http://www.din.de/gremien/nas/nabd/iso3166ma/codlstp1/en_listp1.html">
...@@ -187,11 +187,11 @@ gmake init-po ...@@ -187,11 +187,11 @@ gmake init-po
<programlisting> <programlisting>
AVAIL_LANGUAGES := de fr AVAIL_LANGUAGES := de fr
</programlisting> </programlisting>
(Other languages may appear, of course.) (Other languages can appear, of course.)
</para> </para>
<para> <para>
As the underlying program or library changes, messages may be As the underlying program or library changes, messages might be
changed or added by the programmers. In this case you do not need changed or added by the programmers. In this case you do not need
to start from scratch. Instead, run the command to start from scratch. Instead, run the command
<programlisting> <programlisting>
...@@ -212,7 +212,7 @@ gmake update-po ...@@ -212,7 +212,7 @@ gmake update-po
<para> <para>
The PO files can be edited with a regular text editor. The The PO files can be edited with a regular text editor. The
translator should only change the area between the quotes after translator should only change the area between the quotes after
the msgstr directive, may add comments and alter the fuzzy flag. the msgstr directive, add comments, and alter the fuzzy flag.
There is (unsurprisingly) a PO mode for Emacs, which I find quite There is (unsurprisingly) a PO mode for Emacs, which I find quite
useful. useful.
</para> </para>
...@@ -255,7 +255,7 @@ msgstr "Die Datei %2$s hat %1$u Zeichen." ...@@ -255,7 +255,7 @@ msgstr "Die Datei %2$s hat %1$u Zeichen."
<literal><replaceable>digits</replaceable>$</literal> needs to <literal><replaceable>digits</replaceable>$</literal> needs to
follow the % immediately, before any other format manipulators. follow the % immediately, before any other format manipulators.
(This feature really exists in the <function>printf</function> (This feature really exists in the <function>printf</function>
family of functions. You may not have heard of it before because family of functions. You might not have heard of it before because
there is little use for it outside of message there is little use for it outside of message
internationalization.) internationalization.)
</para> </para>
...@@ -268,7 +268,7 @@ msgstr "Die Datei %2$s hat %1$u Zeichen." ...@@ -268,7 +268,7 @@ msgstr "Die Datei %2$s hat %1$u Zeichen."
normally. The corrected string can be merged in when the normally. The corrected string can be merged in when the
program sources have been updated. If the original string program sources have been updated. If the original string
contains a factual mistake, report that (or fix it yourself) contains a factual mistake, report that (or fix it yourself)
and do not translate it. Instead, you may mark the string with and do not translate it. Instead, you can mark the string with
a comment in the PO file. a comment in the PO file.
</para> </para>
</listitem> </listitem>
...@@ -280,7 +280,7 @@ msgstr "Die Datei %2$s hat %1$u Zeichen." ...@@ -280,7 +280,7 @@ msgstr "Die Datei %2$s hat %1$u Zeichen."
open file %s</literal>) should probably not start with a open file %s</literal>) should probably not start with a
capital letter (if your language distinguishes letter case) or capital letter (if your language distinguishes letter case) or
end with a period (if your language uses punctuation marks). end with a period (if your language uses punctuation marks).
It may help to read <xref linkend="error-style-guide">. It might help to read <xref linkend="error-style-guide">.
</para> </para>
</listitem> </listitem>
...@@ -353,7 +353,7 @@ fprintf(stderr, gettext("panic level %d\n"), lvl); ...@@ -353,7 +353,7 @@ fprintf(stderr, gettext("panic level %d\n"), lvl);
</para> </para>
<para> <para>
This may tend to add a lot of clutter. One common shortcut is to use This tends to add a lot of clutter. One common shortcut is to use
<programlisting> <programlisting>
#define _(x) gettext(x) #define _(x) gettext(x)
</programlisting> </programlisting>
...@@ -451,9 +451,9 @@ fprintf(stderr, gettext("panic level %d\n"), lvl); ...@@ -451,9 +451,9 @@ fprintf(stderr, gettext("panic level %d\n"), lvl);
<programlisting> <programlisting>
printf("Files were %s.\n", flag ? "copied" : "removed"); printf("Files were %s.\n", flag ? "copied" : "removed");
</programlisting> </programlisting>
The word order within the sentence may be different in other The word order within the sentence might be different in other
languages. Also, even if you remember to call gettext() on each languages. Also, even if you remember to call gettext() on each
fragment, the fragments may not translate well separately. It's fragment, the fragments might not translate well separately. It's
better to duplicate a little code so that each message to be better to duplicate a little code so that each message to be
translated is a coherent whole. Only numbers, file names, and translated is a coherent whole. Only numbers, file names, and
such-like run-time variables should be inserted at run time into such-like run-time variables should be inserted at run time into
...@@ -476,7 +476,7 @@ else ...@@ -476,7 +476,7 @@ else
printf("copied %d files", n): printf("copied %d files", n):
</programlisting> </programlisting>
then be disappointed. Some languages have more than two forms, then be disappointed. Some languages have more than two forms,
with some peculiar rules. We may have a solution for this in with some peculiar rules. We might have a solution for this in
the future, but for now the matter is best avoided altogether. the future, but for now the matter is best avoided altogether.
You could write: You could write:
<programlisting> <programlisting>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/perform.sgml,v 1.60 2007/01/25 02:17:25 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/perform.sgml,v 1.61 2007/01/31 20:56:18 momjian Exp $ -->
<chapter id="performance-tips"> <chapter id="performance-tips">
<title>Performance Tips</title> <title>Performance Tips</title>
...@@ -90,7 +90,7 @@ EXPLAIN SELECT * FROM tenk1; ...@@ -90,7 +90,7 @@ EXPLAIN SELECT * FROM tenk1;
<listitem> <listitem>
<para> <para>
Estimated total cost (If all rows were to be retrieved, which they may Estimated total cost (If all rows were to be retrieved, though they might
not be: for example, a query with a <literal>LIMIT</> clause will stop not be: for example, a query with a <literal>LIMIT</> clause will stop
short of paying the total cost of the <literal>Limit</> plan node's short of paying the total cost of the <literal>Limit</> plan node's
input node.) input node.)
...@@ -230,7 +230,7 @@ EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 100; ...@@ -230,7 +230,7 @@ EXPLAIN SELECT * FROM tenk1 WHERE unique1 &lt; 100;
</para> </para>
<para> <para>
If the <literal>WHERE</> condition is selective enough, the planner may If the <literal>WHERE</> condition is selective enough, the planner might
switch to a <quote>simple</> index scan plan: switch to a <quote>simple</> index scan plan:
<programlisting> <programlisting>
...@@ -426,7 +426,7 @@ EXPLAIN ANALYZE SELECT * FROM tenk1 t1, tenk2 t2 WHERE t1.unique1 &lt; 100 AND t ...@@ -426,7 +426,7 @@ EXPLAIN ANALYZE SELECT * FROM tenk1 t1, tenk2 t2 WHERE t1.unique1 &lt; 100 AND t
run time will normally be just a little larger than the total time run time will normally be just a little larger than the total time
reported for the top-level plan node. For <command>INSERT</>, reported for the top-level plan node. For <command>INSERT</>,
<command>UPDATE</>, and <command>DELETE</> commands, the total run time <command>UPDATE</>, and <command>DELETE</> commands, the total run time
may be considerably larger, because it includes the time spent processing might be considerably larger, because it includes the time spent processing
the result rows. In these commands, the time for the top plan node the result rows. In these commands, the time for the top plan node
essentially is the time spent computing the new rows and/or locating the essentially is the time spent computing the new rows and/or locating the
old ones, but it doesn't include the time spent applying the changes. old ones, but it doesn't include the time spent applying the changes.
...@@ -438,7 +438,7 @@ EXPLAIN ANALYZE SELECT * FROM tenk1 t1, tenk2 t2 WHERE t1.unique1 &lt; 100 AND t ...@@ -438,7 +438,7 @@ EXPLAIN ANALYZE SELECT * FROM tenk1 t1, tenk2 t2 WHERE t1.unique1 &lt; 100 AND t
It is worth noting that <command>EXPLAIN</> results should not be extrapolated It is worth noting that <command>EXPLAIN</> results should not be extrapolated
to situations other than the one you are actually testing; for example, to situations other than the one you are actually testing; for example,
results on a toy-sized table can't be assumed to apply to large tables. results on a toy-sized table can't be assumed to apply to large tables.
The planner's cost estimates are not linear and so it may well choose The planner's cost estimates are not linear and so it might choose
a different plan for a larger or smaller table. An extreme example a different plan for a larger or smaller table. An extreme example
is that on a table that only occupies one disk page, you'll nearly is that on a table that only occupies one disk page, you'll nearly
always get a sequential scan plan whether indexes are available or not. always get a sequential scan plan whether indexes are available or not.
...@@ -564,10 +564,10 @@ SELECT attname, n_distinct, most_common_vals FROM pg_stats WHERE tablename = 'ro ...@@ -564,10 +564,10 @@ SELECT attname, n_distinct, most_common_vals FROM pg_stats WHERE tablename = 'ro
command, or globally by setting the command, or globally by setting the
<xref linkend="guc-default-statistics-target"> configuration variable. <xref linkend="guc-default-statistics-target"> configuration variable.
The default limit is presently 10 entries. Raising the limit The default limit is presently 10 entries. Raising the limit
may allow more accurate planner estimates to be made, particularly for might allow more accurate planner estimates to be made, particularly for
columns with irregular data distributions, at the price of consuming columns with irregular data distributions, at the price of consuming
more space in <structname>pg_statistic</structname> and slightly more more space in <structname>pg_statistic</structname> and slightly more
time to compute the estimates. Conversely, a lower limit may be time to compute the estimates. Conversely, a lower limit might be
appropriate for columns with simple data distributions. appropriate for columns with simple data distributions.
</para> </para>
...@@ -605,7 +605,7 @@ SELECT * FROM a, b, c WHERE a.id = b.id AND b.ref = c.id; ...@@ -605,7 +605,7 @@ SELECT * FROM a, b, c WHERE a.id = b.id AND b.ref = c.id;
between two input tables, so it's necessary to build up the result between two input tables, so it's necessary to build up the result
in one or another of these fashions.) The important point is that in one or another of these fashions.) The important point is that
these different join possibilities give semantically equivalent these different join possibilities give semantically equivalent
results but may have hugely different execution costs. Therefore, results but might have hugely different execution costs. Therefore,
the planner will explore all of them to try to find the most the planner will explore all of them to try to find the most
efficient query plan. efficient query plan.
</para> </para>
...@@ -615,7 +615,7 @@ SELECT * FROM a, b, c WHERE a.id = b.id AND b.ref = c.id; ...@@ -615,7 +615,7 @@ SELECT * FROM a, b, c WHERE a.id = b.id AND b.ref = c.id;
orders to worry about. But the number of possible join orders grows orders to worry about. But the number of possible join orders grows
exponentially as the number of tables expands. Beyond ten or so input exponentially as the number of tables expands. Beyond ten or so input
tables it's no longer practical to do an exhaustive search of all the tables it's no longer practical to do an exhaustive search of all the
possibilities, and even for six or seven tables planning may take an possibilities, and even for six or seven tables planning might take an
annoyingly long time. When there are too many input tables, the annoyingly long time. When there are too many input tables, the
<productname>PostgreSQL</productname> planner will switch from exhaustive <productname>PostgreSQL</productname> planner will switch from exhaustive
search to a <firstterm>genetic</firstterm> probabilistic search search to a <firstterm>genetic</firstterm> probabilistic search
...@@ -638,7 +638,7 @@ SELECT * FROM a LEFT JOIN (b JOIN c ON (b.ref = c.id)) ON (a.id = b.id); ...@@ -638,7 +638,7 @@ SELECT * FROM a LEFT JOIN (b JOIN c ON (b.ref = c.id)) ON (a.id = b.id);
Therefore the planner has no choice of join order here: it must join Therefore the planner has no choice of join order here: it must join
B to C and then join A to that result. Accordingly, this query takes B to C and then join A to that result. Accordingly, this query takes
less time to plan than the previous query. In other cases, the planner less time to plan than the previous query. In other cases, the planner
may be able to determine that more than one join order is safe. might be able to determine that more than one join order is safe.
For example, given For example, given
<programlisting> <programlisting>
SELECT * FROM a LEFT JOIN b ON (a.bid = b.id) LEFT JOIN c ON (a.cid = c.id); SELECT * FROM a LEFT JOIN b ON (a.bid = b.id) LEFT JOIN c ON (a.cid = c.id);
...@@ -751,7 +751,7 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse; ...@@ -751,7 +751,7 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse;
<title>Populating a Database</title> <title>Populating a Database</title>
<para> <para>
One may need to insert a large amount of data when first populating One might need to insert a large amount of data when first populating
a database. This section contains some suggestions on how to make a database. This section contains some suggestions on how to make
this process as efficient as possible. this process as efficient as possible.
</para> </para>
...@@ -767,7 +767,7 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse; ...@@ -767,7 +767,7 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse;
<para> <para>
Turn off autocommit and just do one commit at the end. (In plain Turn off autocommit and just do one commit at the end. (In plain
SQL, this means issuing <command>BEGIN</command> at the start and SQL, this means issuing <command>BEGIN</command> at the start and
<command>COMMIT</command> at the end. Some client libraries may <command>COMMIT</command> at the end. Some client libraries might
do this behind your back, in which case you need to make sure the do this behind your back, in which case you need to make sure the
library does it when you want it done.) If you allow each library does it when you want it done.) If you allow each
insertion to be committed separately, insertion to be committed separately,
...@@ -795,7 +795,7 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse; ...@@ -795,7 +795,7 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse;
</para> </para>
<para> <para>
If you cannot use <command>COPY</command>, it may help to use <xref If you cannot use <command>COPY</command>, it might help to use <xref
linkend="sql-prepare" endterm="sql-prepare-title"> to create a linkend="sql-prepare" endterm="sql-prepare-title"> to create a
prepared <command>INSERT</command> statement, and then use prepared <command>INSERT</command> statement, and then use
<command>EXECUTE</command> as many times as required. This avoids <command>EXECUTE</command> as many times as required. This avoids
...@@ -840,9 +840,9 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse; ...@@ -840,9 +840,9 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse;
<para> <para>
If you are adding large amounts of data to an existing table, If you are adding large amounts of data to an existing table,
it may be a win to drop the index, it might be a win to drop the index,
load the table, and then recreate the index. Of course, the load the table, and then recreate the index. Of course, the
database performance for other users may be adversely affected database performance for other users might be adversely affected
during the time that the index is missing. One should also think during the time that the index is missing. One should also think
twice before dropping unique indexes, since the error checking twice before dropping unique indexes, since the error checking
afforded by the unique constraint will be lost while the index is afforded by the unique constraint will be lost while the index is
...@@ -855,7 +855,7 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse; ...@@ -855,7 +855,7 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse;
<para> <para>
Just as with indexes, a foreign key constraint can be checked Just as with indexes, a foreign key constraint can be checked
<quote>in bulk</> more efficiently than row-by-row. So it may be <quote>in bulk</> more efficiently than row-by-row. So it might be
useful to drop foreign key constraints, load data, and re-create useful to drop foreign key constraints, load data, and re-create
the constraints. Again, there is a trade-off between data load the constraints. Again, there is a trade-off between data load
speed and loss of error checking while the constraint is missing. speed and loss of error checking while the constraint is missing.
...@@ -897,8 +897,8 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse; ...@@ -897,8 +897,8 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse;
<title>Turn off <varname>archive_command</varname></title> <title>Turn off <varname>archive_command</varname></title>
<para> <para>
When loading large amounts of data you may want to unset the When loading large amounts of data you might want to unset the
<xref linkend="guc-archive-command"> before loading. It may be <xref linkend="guc-archive-command"> before loading. It might be
faster to take a new base backup once the load has completed faster to take a new base backup once the load has completed
than to allow a large archive to accumulate. than to allow a large archive to accumulate.
</para> </para>
...@@ -926,7 +926,7 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse; ...@@ -926,7 +926,7 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse;
includes bulk loading large amounts of data into the table. Running includes bulk loading large amounts of data into the table. Running
<command>ANALYZE</command> (or <command>VACUUM ANALYZE</command>) <command>ANALYZE</command> (or <command>VACUUM ANALYZE</command>)
ensures that the planner has up-to-date statistics about the ensures that the planner has up-to-date statistics about the
table. With no statistics or obsolete statistics, the planner may table. With no statistics or obsolete statistics, the planner might
make poor decisions during query planning, leading to poor make poor decisions during query planning, leading to poor
performance on any tables with inaccurate or nonexistent performance on any tables with inaccurate or nonexistent
statistics. statistics.
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/planstats.sgml,v 1.7 2006/09/16 00:30:14 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/planstats.sgml,v 1.8 2007/01/31 20:56:18 momjian Exp $ -->
<chapter id="planner-stats-details"> <chapter id="planner-stats-details">
<title>How the Planner Uses Statistics</title> <title>How the Planner Uses Statistics</title>
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<para> <para>
The outputs and algorithms shown below are taken from version 8.0. The outputs and algorithms shown below are taken from version 8.0.
The behavior of earlier (or later) versions may vary. The behavior of earlier (or later) versions might vary.
</para> </para>
<sect1 id="row-estimation-examples"> <sect1 id="row-estimation-examples">
...@@ -56,7 +56,7 @@ SELECT reltuples, relpages FROM pg_class WHERE relname = 'tenk1'; ...@@ -56,7 +56,7 @@ SELECT reltuples, relpages FROM pg_class WHERE relname = 'tenk1';
345 | 10000 345 | 10000
</programlisting> </programlisting>
The planner will check the <structfield>relpages</structfield> The planner will check the <structfield>relpages</structfield>
estimate (this is a cheap operation) and if incorrect may scale estimate (this is a cheap operation) and if incorrect might scale
<structfield>reltuples</structfield> to obtain a row estimate. In this <structfield>reltuples</structfield> to obtain a row estimate. In this
case it does not, thus: case it does not, thus:
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/plperl.sgml,v 2.60 2007/01/30 22:29:23 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/plperl.sgml,v 2.61 2007/01/31 20:56:18 momjian Exp $ -->
<chapter id="plperl"> <chapter id="plperl">
<title>PL/Perl - Perl Procedural Language</title> <title>PL/Perl - Perl Procedural Language</title>
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<para> The usual advantage to using PL/Perl is that this allows use, <para> The usual advantage to using PL/Perl is that this allows use,
within stored functions, of the manyfold <quote>string within stored functions, of the manyfold <quote>string
munging</quote> operators and functions available for Perl. Parsing munging</quote> operators and functions available for Perl. Parsing
complex strings may be be easier using Perl than it is with the complex strings might be be easier using Perl than it is with the
string functions and control structures provided in PL/pgSQL.</para> string functions and control structures provided in PL/pgSQL.</para>
<para> <para>
...@@ -382,7 +382,7 @@ SELECT * FROM test_munge(); ...@@ -382,7 +382,7 @@ SELECT * FROM test_munge();
</para> </para>
<para> <para>
<literal>spi_query</literal> and <literal>spi_fetchrow</literal> <literal>spi_query</literal> and <literal>spi_fetchrow</literal>
work together as a pair for row sets which may be large, or for cases work together as a pair for row sets which might be large, or for cases
where you wish to return rows as they arrive. where you wish to return rows as they arrive.
<literal>spi_fetchrow</literal> works <emphasis>only</emphasis> with <literal>spi_fetchrow</literal> works <emphasis>only</emphasis> with
<literal>spi_query</literal>. The following example illustrates how <literal>spi_query</literal>. The following example illustrates how
...@@ -429,7 +429,7 @@ SELECT * from lotsa_md5(500); ...@@ -429,7 +429,7 @@ SELECT * from lotsa_md5(500);
<para> <para>
The advantage of prepared queries is that is it possible to use one prepared plan for more The advantage of prepared queries is that is it possible to use one prepared plan for more
than one query execution. After the plan is not needed anymore, it may be freed with than one query execution. After the plan is not needed anymore, it can be freed with
<literal>spi_freeplan</literal>: <literal>spi_freeplan</literal>:
</para> </para>
...@@ -601,7 +601,7 @@ $$ LANGUAGE plperl; ...@@ -601,7 +601,7 @@ $$ LANGUAGE plperl;
external modules). There is no way to access internals of the external modules). There is no way to access internals of the
database server process or to gain OS-level access with the database server process or to gain OS-level access with the
permissions of the server process, permissions of the server process,
as a C function can do. Thus, any unprivileged database user may as a C function can do. Thus, any unprivileged database user can
be permitted to use this language. be permitted to use this language.
</para> </para>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/plpgsql.sgml,v 1.103 2007/01/30 22:29:23 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/plpgsql.sgml,v 1.104 2007/01/31 20:56:18 momjian Exp $ -->
<chapter id="plpgsql"> <chapter id="plpgsql">
<title><application>PL/pgSQL</application> - <acronym>SQL</acronym> Procedural Language</title> <title><application>PL/pgSQL</application> - <acronym>SQL</acronym> Procedural Language</title>
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
substantially reduce the total amount of time required to parse substantially reduce the total amount of time required to parse
and generate execution plans for the statements in a and generate execution plans for the statements in a
<application>PL/pgSQL</> function. A disadvantage is that errors <application>PL/pgSQL</> function. A disadvantage is that errors
in a specific expression or command may not be detected until that in a specific expression or command cannot be detected until that
part of the function is reached in execution. part of the function is reached in execution.
</para> </para>
...@@ -208,7 +208,7 @@ $$ LANGUAGE plpgsql; ...@@ -208,7 +208,7 @@ $$ LANGUAGE plpgsql;
</para> </para>
<para> <para>
<application>PL/pgSQL</> functions may also be declared to accept <application>PL/pgSQL</> functions can also be declared to accept
and return the polymorphic types and return the polymorphic types
<type>anyelement</type> and <type>anyarray</type>. The actual <type>anyelement</type> and <type>anyarray</type>. The actual
data types handled by a polymorphic function can vary from call to data types handled by a polymorphic function can vary from call to
...@@ -224,7 +224,7 @@ $$ LANGUAGE plpgsql; ...@@ -224,7 +224,7 @@ $$ LANGUAGE plpgsql;
</para> </para>
<para> <para>
Finally, a <application>PL/pgSQL</> function may be declared to return Finally, a <application>PL/pgSQL</> function can be declared to return
<type>void</> if it has no useful return value. <type>void</> if it has no useful return value.
</para> </para>
...@@ -313,7 +313,7 @@ $PROC$ LANGUAGE plpgsql; ...@@ -313,7 +313,7 @@ $PROC$ LANGUAGE plpgsql;
<para> <para>
The following chart shows what you have to do when writing quote The following chart shows what you have to do when writing quote
marks without dollar quoting. It may be useful when translating marks without dollar quoting. It might be useful when translating
pre-dollar quoting code into something more comprehensible. pre-dollar quoting code into something more comprehensible.
</para> </para>
...@@ -766,13 +766,13 @@ user_id users.user_id%TYPE; ...@@ -766,13 +766,13 @@ user_id users.user_id%TYPE;
type of the structure you are referencing, and most importantly, type of the structure you are referencing, and most importantly,
if the data type of the referenced item changes in the future (for if the data type of the referenced item changes in the future (for
instance: you change the type of <literal>user_id</> instance: you change the type of <literal>user_id</>
from <type>integer</type> to <type>real</type>), you may not need from <type>integer</type> to <type>real</type>), you might not need
to change your function definition. to change your function definition.
</para> </para>
<para> <para>
<literal>%TYPE</literal> is particularly valuable in polymorphic <literal>%TYPE</literal> is particularly valuable in polymorphic
functions, since the data types needed for internal variables may functions, since the data types needed for internal variables can
change from one call to the next. Appropriate variables can be change from one call to the next. Appropriate variables can be
created by applying <literal>%TYPE</literal> to the function's created by applying <literal>%TYPE</literal> to the function's
arguments or result placeholders. arguments or result placeholders.
...@@ -866,7 +866,7 @@ SELECT merge_fields(t.*) FROM table1 t WHERE ... ; ...@@ -866,7 +866,7 @@ SELECT merge_fields(t.*) FROM table1 t WHERE ... ;
Note that <literal>RECORD</> is not a true data type, only a placeholder. Note that <literal>RECORD</> is not a true data type, only a placeholder.
One should also realize that when a <application>PL/pgSQL</application> One should also realize that when a <application>PL/pgSQL</application>
function is declared to return type <type>record</>, this is not quite the function is declared to return type <type>record</>, this is not quite the
same concept as a record variable, even though such a function may well same concept as a record variable, even though such a function might
use a record variable to hold its result. In both cases the actual row use a record variable to hold its result. In both cases the actual row
structure is unknown when the function is written, but for a function structure is unknown when the function is written, but for a function
returning <type>record</> the actual structure is determined when the returning <type>record</> the actual structure is determined when the
...@@ -1530,7 +1530,7 @@ GET DIAGNOSTICS integer_var = ROW_COUNT; ...@@ -1530,7 +1530,7 @@ GET DIAGNOSTICS integer_var = ROW_COUNT;
loops). <literal>FOUND</literal> is set this way when the loops). <literal>FOUND</literal> is set this way when the
<command>FOR</> loop exits; inside the execution of the loop, <command>FOR</> loop exits; inside the execution of the loop,
<literal>FOUND</literal> is not modified by the <literal>FOUND</literal> is not modified by the
<command>FOR</> statement, although it may be changed by the <command>FOR</> statement, although it might be changed by the
execution of other statements within the loop body. execution of other statements within the loop body.
</para> </para>
</listitem> </listitem>
...@@ -1671,10 +1671,10 @@ SELECT * FROM some_func(); ...@@ -1671,10 +1671,10 @@ SELECT * FROM some_func();
for <application>PL/pgSQL</> stores the entire result set for <application>PL/pgSQL</> stores the entire result set
before returning from the function, as discussed above. That before returning from the function, as discussed above. That
means that if a <application>PL/pgSQL</> function produces a means that if a <application>PL/pgSQL</> function produces a
very large result set, performance may be poor: data will be very large result set, performance might be poor: data will be
written to disk to avoid memory exhaustion, but the function written to disk to avoid memory exhaustion, but the function
itself will not return until the entire result set has been itself will not return until the entire result set has been
generated. A future version of <application>PL/pgSQL</> may generated. A future version of <application>PL/pgSQL</> might
allow users to define set-returning functions allow users to define set-returning functions
that do not have this limitation. Currently, the point at that do not have this limitation. Currently, the point at
which data begins being written to disk is controlled by the which data begins being written to disk is controlled by the
...@@ -2364,7 +2364,7 @@ SELECT merge_db(1, 'dennis'); ...@@ -2364,7 +2364,7 @@ SELECT merge_db(1, 'dennis');
<synopsis> <synopsis>
<replaceable>name</replaceable> CURSOR <optional> ( <replaceable>arguments</replaceable> ) </optional> FOR <replaceable>query</replaceable>; <replaceable>name</replaceable> CURSOR <optional> ( <replaceable>arguments</replaceable> ) </optional> FOR <replaceable>query</replaceable>;
</synopsis> </synopsis>
(<literal>FOR</> may be replaced by <literal>IS</> for (<literal>FOR</> can be replaced by <literal>IS</> for
<productname>Oracle</productname> compatibility.) <productname>Oracle</productname> compatibility.)
<replaceable>arguments</replaceable>, if specified, is a <replaceable>arguments</replaceable>, if specified, is a
comma-separated list of pairs <literal><replaceable>name</replaceable> comma-separated list of pairs <literal><replaceable>name</replaceable>
...@@ -2382,7 +2382,7 @@ DECLARE ...@@ -2382,7 +2382,7 @@ DECLARE
curs3 CURSOR (key integer) IS SELECT * FROM tenk1 WHERE unique1 = key; curs3 CURSOR (key integer) IS SELECT * FROM tenk1 WHERE unique1 = key;
</programlisting> </programlisting>
All three of these variables have the data type <type>refcursor</>, All three of these variables have the data type <type>refcursor</>,
but the first may be used with any query, while the second has but the first can be used with any query, while the second has
a fully specified query already <firstterm>bound</> to it, and the last a fully specified query already <firstterm>bound</> to it, and the last
has a parameterized query bound to it. (<literal>key</> will be has a parameterized query bound to it. (<literal>key</> will be
replaced by an integer parameter value when the cursor is opened.) replaced by an integer parameter value when the cursor is opened.)
...@@ -2516,10 +2516,10 @@ FETCH <replaceable>cursor</replaceable> INTO <replaceable>target</replaceable>; ...@@ -2516,10 +2516,10 @@ FETCH <replaceable>cursor</replaceable> INTO <replaceable>target</replaceable>;
<para> <para>
<command>FETCH</command> retrieves the next row from the <command>FETCH</command> retrieves the next row from the
cursor into a target, which may be a row variable, a record cursor into a target, which might be a row variable, a record
variable, or a comma-separated list of simple variables, just like variable, or a comma-separated list of simple variables, just like
<command>SELECT INTO</command>. As with <command>SELECT <command>SELECT INTO</command>. As with <command>SELECT
INTO</command>, the special variable <literal>FOUND</literal> may INTO</command>, the special variable <literal>FOUND</literal> can
be checked to see whether a row was obtained or not. be checked to see whether a row was obtained or not.
</para> </para>
...@@ -2902,7 +2902,7 @@ RAISE EXCEPTION 'Nonexistent ID --> %', user_id; ...@@ -2902,7 +2902,7 @@ RAISE EXCEPTION 'Nonexistent ID --> %', user_id;
</para> </para>
<para> <para>
Row-level triggers fired <literal>BEFORE</> may return null to signal the Row-level triggers fired <literal>BEFORE</> can return null to signal the
trigger manager to skip the rest of the operation for this row trigger manager to skip the rest of the operation for this row
(i.e., subsequent triggers are not fired, and the (i.e., subsequent triggers are not fired, and the
<command>INSERT</>/<command>UPDATE</>/<command>DELETE</> does not occur <command>INSERT</>/<command>UPDATE</>/<command>DELETE</> does not occur
...@@ -2919,8 +2919,8 @@ RAISE EXCEPTION 'Nonexistent ID --> %', user_id; ...@@ -2919,8 +2919,8 @@ RAISE EXCEPTION 'Nonexistent ID --> %', user_id;
<para> <para>
The return value of a <literal>BEFORE</> or <literal>AFTER</> The return value of a <literal>BEFORE</> or <literal>AFTER</>
statement-level trigger or an <literal>AFTER</> row-level trigger is statement-level trigger or an <literal>AFTER</> row-level trigger is
always ignored; it may as well be null. However, any of these types of always ignored; it might as well be null. However, any of these types of
triggers can still abort the entire operation by raising an error. triggers might still abort the entire operation by raising an error.
</para> </para>
<para> <para>
...@@ -3037,7 +3037,7 @@ AFTER INSERT OR UPDATE OR DELETE ON emp ...@@ -3037,7 +3037,7 @@ AFTER INSERT OR UPDATE OR DELETE ON emp
original table for certain queries &mdash; often with vastly reduced run original table for certain queries &mdash; often with vastly reduced run
times. times.
This technique is commonly used in Data Warehousing, where the tables This technique is commonly used in Data Warehousing, where the tables
of measured or observed data (called fact tables) can be extremely large. of measured or observed data (called fact tables) might be extremely large.
<xref linkend="plpgsql-trigger-summary-example"> shows an example of a <xref linkend="plpgsql-trigger-summary-example"> shows an example of a
trigger procedure in <application>PL/pgSQL</application> that maintains trigger procedure in <application>PL/pgSQL</application> that maintains
a summary table for a fact table in a data warehouse. a summary table for a fact table in a data warehouse.
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/plpython.sgml,v 1.36 2006/10/23 18:10:31 petere Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/plpython.sgml,v 1.37 2007/01/31 20:56:18 momjian Exp $ -->
<chapter id="plpython"> <chapter id="plpython">
<title>PL/Python - Python Procedural Language</title> <title>PL/Python - Python Procedural Language</title>
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
available as an <quote>untrusted</> language (meaning it does not available as an <quote>untrusted</> language (meaning it does not
offer any way of restricting what users can do in it). It has offer any way of restricting what users can do in it). It has
therefore been renamed to <literal>plpythonu</>. The trusted therefore been renamed to <literal>plpythonu</>. The trusted
variant <literal>plpython</> may become available again in future, variant <literal>plpython</> might become available again in future,
if a new secure execution mechanism is developed in Python. if a new secure execution mechanism is developed in Python.
</para> </para>
...@@ -401,7 +401,7 @@ $$ LANGUAGE plpythonu; ...@@ -401,7 +401,7 @@ $$ LANGUAGE plpythonu;
</para> </para>
<para> <para>
If <literal>TD["when"]</literal> is <literal>BEFORE</>, you may If <literal>TD["when"]</literal> is <literal>BEFORE</>, you can
return <literal>None</literal> or <literal>"OK"</literal> from the return <literal>None</literal> or <literal>"OK"</literal> from the
Python function to indicate the row is unmodified, Python function to indicate the row is unmodified,
<literal>"SKIP"</> to abort the event, or <literal>"MODIFY"</> to <literal>"SKIP"</> to abort the event, or <literal>"MODIFY"</> to
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/pltcl.sgml,v 2.43 2007/01/30 22:29:23 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/pltcl.sgml,v 2.44 2007/01/31 20:56:18 momjian Exp $ -->
<chapter id="pltcl"> <chapter id="pltcl">
<title>PL/Tcl - Tcl Procedural Language</title> <title>PL/Tcl - Tcl Procedural Language</title>
...@@ -39,12 +39,12 @@ ...@@ -39,12 +39,12 @@
provides no way to access internals of the database server or to provides no way to access internals of the database server or to
gain OS-level access under the permissions of the gain OS-level access under the permissions of the
<productname>PostgreSQL</productname> server process, as a C <productname>PostgreSQL</productname> server process, as a C
function can do. Thus, unprivileged database users may be trusted function can do. Thus, unprivileged database users can be trusted
to use this language; it does not give them unlimited authority. to use this language; it does not give them unlimited authority.
</para> </para>
<para> <para>
The other notable implementation restriction is that Tcl functions The other notable implementation restriction is that Tcl functions
may not be used to create input/output functions for new data cannot be used to create input/output functions for new data
types. types.
</para> </para>
<para> <para>
...@@ -325,7 +325,7 @@ spi_exec -array C "SELECT * FROM pg_class" { ...@@ -325,7 +325,7 @@ spi_exec -array C "SELECT * FROM pg_class" {
PL/Tcl</></> PL/Tcl</></>
</para> </para>
<para> <para>
The query may use parameters, that is, placeholders for The query can use parameters, that is, placeholders for
values to be supplied whenever the plan is actually executed. values to be supplied whenever the plan is actually executed.
In the query string, refer to parameters In the query string, refer to parameters
by the symbols <literal>$1</literal> ... <literal>$<replaceable>n</replaceable></literal>. by the symbols <literal>$1</literal> ... <literal>$<replaceable>n</replaceable></literal>.
...@@ -417,7 +417,7 @@ $$ LANGUAGE pltcl; ...@@ -417,7 +417,7 @@ $$ LANGUAGE pltcl;
<listitem> <listitem>
<para> <para>
Doubles all occurrences of single quote and backslash characters Doubles all occurrences of single quote and backslash characters
in the given string. This may be used to safely quote strings in the given string. This can be used to safely quote strings
that are to be inserted into SQL commands given that are to be inserted into SQL commands given
to <function>spi_exec</function> or to <function>spi_exec</function> or
<function>spi_prepare</function>. <function>spi_prepare</function>.
...@@ -726,9 +726,8 @@ CREATE TRIGGER trig_mytab_modcount BEFORE INSERT OR UPDATE ON mytab ...@@ -726,9 +726,8 @@ CREATE TRIGGER trig_mytab_modcount BEFORE INSERT OR UPDATE ON mytab
<title>Tcl Procedure Names</title> <title>Tcl Procedure Names</title>
<para> <para>
In <productname>PostgreSQL</productname>, one and the In <productname>PostgreSQL</productname>, the same function name can be used for
same function name can be used for different function definitions as long as the number of arguments or their types
different functions as long as the number of arguments or their types
differ. Tcl, however, requires all procedure names to be distinct. differ. Tcl, however, requires all procedure names to be distinct.
PL/Tcl deals with this by making the internal Tcl procedure names contain PL/Tcl deals with this by making the internal Tcl procedure names contain
the object the object
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/postgres.sgml,v 1.80 2006/11/17 16:38:44 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/postgres.sgml,v 1.81 2007/01/31 20:56:18 momjian Exp $ -->
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.2//EN" [ <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.2//EN" [
...@@ -223,7 +223,7 @@ ...@@ -223,7 +223,7 @@
<partintro> <partintro>
<para> <para>
This part contains assorted information that can be of use to This part contains assorted information that might be of use to
<productname>PostgreSQL</> developers. <productname>PostgreSQL</> developers.
</para> </para>
</partintro> </partintro>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/problems.sgml,v 2.27 2006/09/16 00:30:15 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/problems.sgml,v 2.28 2007/01/31 20:56:18 momjian Exp $ -->
<sect1 id="bug-reporting"> <sect1 id="bug-reporting">
<title>Bug Reporting Guidelines</title> <title>Bug Reporting Guidelines</title>
...@@ -228,7 +228,7 @@ ...@@ -228,7 +228,7 @@
If the function or the options do not exist then your version is If the function or the options do not exist then your version is
more than old enough to warrant an upgrade. more than old enough to warrant an upgrade.
If you run a prepackaged version, such as RPMs, say so, including any If you run a prepackaged version, such as RPMs, say so, including any
subversion the package may have. If you are talking about a CVS subversion the package might have. If you are talking about a CVS
snapshot, mention that, including its date and time. snapshot, mention that, including its date and time.
</para> </para>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/protocol.sgml,v 1.66 2006/09/06 20:40:47 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/protocol.sgml,v 1.67 2007/01/31 20:56:18 momjian Exp $ -->
<chapter id="protocol"> <chapter id="protocol">
<title>Frontend/Backend Protocol</title> <title>Frontend/Backend Protocol</title>
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
The protocol is supported over <acronym>TCP/IP</acronym> and also over The protocol is supported over <acronym>TCP/IP</acronym> and also over
Unix-domain sockets. Port number 5432 has been registered with IANA as Unix-domain sockets. Port number 5432 has been registered with IANA as
the customary TCP port number for servers supporting this protocol, but the customary TCP port number for servers supporting this protocol, but
in practice any non-privileged port number may be used. in practice any non-privileged port number can be used.
</para> </para>
<para> <para>
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
count) before attempting to process its contents. This allows easy count) before attempting to process its contents. This allows easy
recovery if an error is detected while processing the contents. In recovery if an error is detected while processing the contents. In
extreme situations (such as not having enough memory to buffer the extreme situations (such as not having enough memory to buffer the
message), the receiver may use the byte count to determine how much message), the receiver can use the byte count to determine how much
input to skip before it resumes reading messages. input to skip before it resumes reading messages.
</para> </para>
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
<firstterm>portals</>. A prepared statement represents the result of <firstterm>portals</>. A prepared statement represents the result of
parsing, semantic analysis, and (optionally) planning of a textual query parsing, semantic analysis, and (optionally) planning of a textual query
string. string.
A prepared statement is not necessarily ready to execute, because it may A prepared statement is not necessarily ready to execute, because it might
lack specific values for <firstterm>parameters</>. A portal represents lack specific values for <firstterm>parameters</>. A portal represents
a ready-to-execute or already-partially-executed statement, with any a ready-to-execute or already-partially-executed statement, with any
missing parameter values filled in. (For <command>SELECT</> statements, missing parameter values filled in. (For <command>SELECT</> statements,
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
<firstterm>execute</> step that runs a portal's query. In the case of <firstterm>execute</> step that runs a portal's query. In the case of
a query that returns rows (<command>SELECT</>, <command>SHOW</>, etc), a query that returns rows (<command>SELECT</>, <command>SHOW</>, etc),
the execute step can be told to fetch only the execute step can be told to fetch only
a limited number of rows, so that multiple execute steps may be needed a limited number of rows, so that multiple execute steps might be needed
to complete the operation. to complete the operation.
</para> </para>
...@@ -170,7 +170,7 @@ ...@@ -170,7 +170,7 @@
the only supported formats are <quote>text</> and <quote>binary</>, the only supported formats are <quote>text</> and <quote>binary</>,
but the protocol makes provision for future extensions. The desired but the protocol makes provision for future extensions. The desired
format for any value is specified by a <firstterm>format code</>. format for any value is specified by a <firstterm>format code</>.
Clients may specify a format code for each transmitted parameter value Clients can specify a format code for each transmitted parameter value
and for each column of a query result. Text has format code zero, and for each column of a query result. Text has format code zero,
binary has format code one, and all other format codes are reserved binary has format code one, and all other format codes are reserved
for future definition. for future definition.
...@@ -189,7 +189,7 @@ ...@@ -189,7 +189,7 @@
Binary representations for integers use network byte order (most Binary representations for integers use network byte order (most
significant byte first). For other data types consult the documentation significant byte first). For other data types consult the documentation
or source code to learn about the binary representation. Keep in mind or source code to learn about the binary representation. Keep in mind
that binary representations for complex data types may change across that binary representations for complex data types might change across
server versions; the text format is usually the more portable choice. server versions; the text format is usually the more portable choice.
</para> </para>
</sect2> </sect2>
...@@ -380,7 +380,7 @@ ...@@ -380,7 +380,7 @@
This message informs the frontend about the current (initial) This message informs the frontend about the current (initial)
setting of backend parameters, such as <xref setting of backend parameters, such as <xref
linkend="guc-client-encoding"> or <xref linkend="guc-datestyle">. linkend="guc-client-encoding"> or <xref linkend="guc-datestyle">.
The frontend may ignore this message, or record the settings The frontend can ignore this message, or record the settings
for its future use; see <xref linkend="protocol-async"> for for its future use; see <xref linkend="protocol-async"> for
more details. The frontend should not respond to this more details. The frontend should not respond to this
message, but should continue listening for a ReadyForQuery message, but should continue listening for a ReadyForQuery
...@@ -393,7 +393,7 @@ ...@@ -393,7 +393,7 @@
<term>ReadyForQuery</term> <term>ReadyForQuery</term>
<listitem> <listitem>
<para> <para>
Start-up is completed. The frontend may now issue commands. Start-up is completed. The frontend can now issue commands.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -440,7 +440,7 @@ ...@@ -440,7 +440,7 @@
The backend then sends one or more response The backend then sends one or more response
messages depending on the contents of the query command string, messages depending on the contents of the query command string,
and finally a ReadyForQuery response message. ReadyForQuery and finally a ReadyForQuery response message. ReadyForQuery
informs the frontend that it may safely send a new command. informs the frontend that it can safely send a new command.
(It is not actually necessary for the frontend to wait for (It is not actually necessary for the frontend to wait for
ReadyForQuery before issuing another command, but the frontend must ReadyForQuery before issuing another command, but the frontend must
then take responsibility for figuring out what happens if the earlier then take responsibility for figuring out what happens if the earlier
...@@ -526,7 +526,7 @@ ...@@ -526,7 +526,7 @@
<listitem> <listitem>
<para> <para>
Processing of the query string is complete. A separate Processing of the query string is complete. A separate
message is sent to indicate this because the query string may message is sent to indicate this because the query string might
contain multiple SQL commands. (CommandComplete marks the contain multiple SQL commands. (CommandComplete marks the
end of processing one SQL command, not the whole string.) end of processing one SQL command, not the whole string.)
ReadyForQuery will always be sent, whether processing ReadyForQuery will always be sent, whether processing
...@@ -577,7 +577,7 @@ ...@@ -577,7 +577,7 @@
In the event of an error, ErrorResponse is issued followed by In the event of an error, ErrorResponse is issued followed by
ReadyForQuery. All further processing of the query string is aborted by ReadyForQuery. All further processing of the query string is aborted by
ErrorResponse (even if more queries remained in it). Note that this ErrorResponse (even if more queries remained in it). Note that this
may occur partway through the sequence of messages generated by an might occur partway through the sequence of messages generated by an
individual query. individual query.
</para> </para>
...@@ -593,7 +593,7 @@ ...@@ -593,7 +593,7 @@
A frontend must be prepared to accept ErrorResponse and A frontend must be prepared to accept ErrorResponse and
NoticeResponse messages whenever it is expecting any other type of NoticeResponse messages whenever it is expecting any other type of
message. See also <xref linkend="protocol-async"> concerning messages message. See also <xref linkend="protocol-async"> concerning messages
that the backend may generate due to outside events. that the backend might generate due to outside events.
</para> </para>
<para> <para>
...@@ -621,7 +621,7 @@ ...@@ -621,7 +621,7 @@
about data types of parameter placeholders, and the about data types of parameter placeholders, and the
name of a destination prepared-statement object (an empty string name of a destination prepared-statement object (an empty string
selects the unnamed prepared statement). The response is selects the unnamed prepared statement). The response is
either ParseComplete or ErrorResponse. Parameter data types may be either ParseComplete or ErrorResponse. Parameter data types can be
specified by OID; if not given, the parser attempts to infer the specified by OID; if not given, the parser attempts to infer the
data types in the same way as it would do for untyped literal string data types in the same way as it would do for untyped literal string
constants. constants.
...@@ -695,7 +695,7 @@ ...@@ -695,7 +695,7 @@
<para> <para>
Query planning for named prepared-statement objects occurs when the Parse Query planning for named prepared-statement objects occurs when the Parse
message is processed. If a query will be repeatedly executed with message is processed. If a query will be repeatedly executed with
different parameters, it may be beneficial to send a single Parse message different parameters, it might be beneficial to send a single Parse message
containing a parameterized query, followed by multiple Bind containing a parameterized query, followed by multiple Bind
and Execute messages. This will avoid replanning the query on each and Execute messages. This will avoid replanning the query on each
execution. execution.
...@@ -711,7 +711,7 @@ ...@@ -711,7 +711,7 @@
<note> <note>
<para> <para>
Query plans generated from a parameterized query may be less Query plans generated from a parameterized query might be less
efficient than query plans generated from an equivalent query with actual efficient than query plans generated from an equivalent query with actual
parameter values substituted. The query planner cannot make decisions parameter values substituted. The query planner cannot make decisions
based on actual parameter values (for example, index selectivity) when based on actual parameter values (for example, index selectivity) when
...@@ -877,7 +877,7 @@ ...@@ -877,7 +877,7 @@
FunctionCall message to the backend. The backend then sends one FunctionCall message to the backend. The backend then sends one
or more response messages depending on the results of the function or more response messages depending on the results of the function
call, and finally a ReadyForQuery response message. ReadyForQuery call, and finally a ReadyForQuery response message. ReadyForQuery
informs the frontend that it may safely send a new query or informs the frontend that it can safely send a new query or
function call. function call.
</para> </para>
...@@ -1080,7 +1080,7 @@ ...@@ -1080,7 +1080,7 @@
<para> <para>
At present, NotificationResponse can only be sent outside a At present, NotificationResponse can only be sent outside a
transaction, and thus it will not occur in the middle of a transaction, and thus it will not occur in the middle of a
command-response series, though it may occur just before ReadyForQuery. command-response series, though it might occur just before ReadyForQuery.
It is unwise to design frontend logic that assumes that, however. It is unwise to design frontend logic that assumes that, however.
Good practice is to be able to accept NotificationResponse at any Good practice is to be able to accept NotificationResponse at any
point in the protocol. point in the protocol.
...@@ -1092,7 +1092,7 @@ ...@@ -1092,7 +1092,7 @@
<title>Cancelling Requests in Progress</title> <title>Cancelling Requests in Progress</title>
<para> <para>
During the processing of a query, the frontend may request During the processing of a query, the frontend might request
cancellation of the query. The cancel request is not sent cancellation of the query. The cancel request is not sent
directly on the open connection to the backend for reasons of directly on the open connection to the backend for reasons of
implementation efficiency: we don't want to have the backend implementation efficiency: we don't want to have the backend
...@@ -1122,7 +1122,7 @@ ...@@ -1122,7 +1122,7 @@
</para> </para>
<para> <para>
The cancellation signal may or may not have any effect &mdash; for The cancellation signal might or might not have any effect &mdash; for
example, if it arrives after the backend has finished processing example, if it arrives after the backend has finished processing
the query, then it will have no effect. If the cancellation is the query, then it will have no effect. If the cancellation is
effective, it results in the current command being terminated effective, it results in the current command being terminated
...@@ -1144,7 +1144,7 @@ ...@@ -1144,7 +1144,7 @@
server and not across the regular frontend/backend communication server and not across the regular frontend/backend communication
link, it is possible for the cancel request to be issued by any link, it is possible for the cancel request to be issued by any
process, not just the frontend whose query is to be canceled. process, not just the frontend whose query is to be canceled.
This may have some benefits of flexibility in building This might provide additional flexibility when building
multiple-process applications. It also introduces a security multiple-process applications. It also introduces a security
risk, in that unauthorized persons might try to cancel queries. risk, in that unauthorized persons might try to cancel queries.
The security risk is addressed by requiring a dynamically The security risk is addressed by requiring a dynamically
...@@ -1164,7 +1164,7 @@ ...@@ -1164,7 +1164,7 @@
<para> <para>
In rare cases (such as an administrator-commanded database shutdown) In rare cases (such as an administrator-commanded database shutdown)
the backend may disconnect without any frontend request to do so. the backend might disconnect without any frontend request to do so.
In such cases the backend will attempt to send an error or notice message In such cases the backend will attempt to send an error or notice message
giving the reason for the disconnection before it closes the connection. giving the reason for the disconnection before it closes the connection.
</para> </para>
...@@ -1187,7 +1187,7 @@ ...@@ -1187,7 +1187,7 @@
is being processed, the backend will probably finish the query is being processed, the backend will probably finish the query
before noticing the disconnection. If the query is outside any before noticing the disconnection. If the query is outside any
transaction block (<command>BEGIN</> ... <command>COMMIT</> transaction block (<command>BEGIN</> ... <command>COMMIT</>
sequence) then its results may be committed before the sequence) then its results might be committed before the
disconnection is recognized. disconnection is recognized.
</para> </para>
</sect2> </sect2>
...@@ -1211,7 +1211,7 @@ ...@@ -1211,7 +1211,7 @@
StartupMessage. The server then responds with a single byte StartupMessage. The server then responds with a single byte
containing <literal>S</> or <literal>N</>, indicating that it is containing <literal>S</> or <literal>N</>, indicating that it is
willing or unwilling to perform <acronym>SSL</acronym>, willing or unwilling to perform <acronym>SSL</acronym>,
respectively. The frontend may close the connection at this point respectively. The frontend might close the connection at this point
if it is dissatisfied with the response. To continue after if it is dissatisfied with the response. To continue after
<literal>S</>, perform an <acronym>SSL</acronym> startup handshake <literal>S</>, perform an <acronym>SSL</acronym> startup handshake
(not described here, part of the <acronym>SSL</acronym> (not described here, part of the <acronym>SSL</acronym>
...@@ -1228,18 +1228,18 @@ ...@@ -1228,18 +1228,18 @@
response to SSLRequest from the server. This would only occur if response to SSLRequest from the server. This would only occur if
the server predates the addition of <acronym>SSL</acronym> support the server predates the addition of <acronym>SSL</acronym> support
to <productname>PostgreSQL</>. In this case the connection must to <productname>PostgreSQL</>. In this case the connection must
be closed, but the frontend may choose to open a fresh connection be closed, but the frontend might choose to open a fresh connection
and proceed without requesting <acronym>SSL</acronym>. and proceed without requesting <acronym>SSL</acronym>.
</para> </para>
<para> <para>
An initial SSLRequest may also be used in a connection that is being An initial SSLRequest can also be used in a connection that is being
opened to send a CancelRequest message. opened to send a CancelRequest message.
</para> </para>
<para> <para>
While the protocol itself does not provide a way for the server to While the protocol itself does not provide a way for the server to
force <acronym>SSL</acronym> encryption, the administrator may force <acronym>SSL</acronym> encryption, the administrator can
configure the server to reject unencrypted sessions as a byproduct configure the server to reject unencrypted sessions as a byproduct
of authentication checking. of authentication checking.
</para> </para>
...@@ -1333,13 +1333,13 @@ characters that don't fit into your fixed-size buffer. ...@@ -1333,13 +1333,13 @@ characters that don't fit into your fixed-size buffer.
<para> <para>
This section describes the detailed format of each message. Each is marked to This section describes the detailed format of each message. Each is marked to
indicate that it may be sent by a frontend (F), a backend (B), or both indicate that it can be sent by a frontend (F), a backend (B), or both
(F &amp; B). (F &amp; B).
Notice that although each message includes a byte count at the beginning, Notice that although each message includes a byte count at the beginning,
the message format is defined so that the message end can be found without the message format is defined so that the message end can be found without
reference to the byte count. This aids validity checking. (The CopyData reference to the byte count. This aids validity checking. (The CopyData
message is an exception, because it forms part of a data stream; the contents message is an exception, because it forms part of a data stream; the contents
of any individual CopyData message may not be interpretable on their own.) of any individual CopyData message cannot be interpretable on their own.)
</para> </para>
<variablelist> <variablelist>
...@@ -2155,7 +2155,7 @@ CopyData (F &amp; B) ...@@ -2155,7 +2155,7 @@ CopyData (F &amp; B)
<para> <para>
Data that forms part of a <command>COPY</command> data stream. Messages sent Data that forms part of a <command>COPY</command> data stream. Messages sent
from the backend will always correspond to single data rows, from the backend will always correspond to single data rows,
but messages sent by frontends may divide the data stream but messages sent by frontends might divide the data stream
arbitrarily. arbitrarily.
</para> </para>
</listitem> </listitem>
...@@ -2591,7 +2591,7 @@ ErrorResponse (B) ...@@ -2591,7 +2591,7 @@ ErrorResponse (B)
</varlistentry> </varlistentry>
</variablelist> </variablelist>
The message body consists of one or more identified fields, The message body consists of one or more identified fields,
followed by a zero byte as a terminator. Fields may appear in followed by a zero byte as a terminator. Fields can appear in
any order. For each field there is the following: any order. For each field there is the following:
<variablelist> <variablelist>
<varlistentry> <varlistentry>
...@@ -2604,7 +2604,7 @@ ErrorResponse (B) ...@@ -2604,7 +2604,7 @@ ErrorResponse (B)
the message terminator and no string follows. the message terminator and no string follows.
The presently defined field types are listed in The presently defined field types are listed in
<xref linkend="protocol-error-fields">. <xref linkend="protocol-error-fields">.
Since more field types may be added in future, Since more field types might be added in future,
frontends should silently ignore fields of unrecognized frontends should silently ignore fields of unrecognized
type. type.
</para> </para>
...@@ -2969,7 +2969,7 @@ NoticeResponse (B) ...@@ -2969,7 +2969,7 @@ NoticeResponse (B)
</varlistentry> </varlistentry>
</variablelist> </variablelist>
The message body consists of one or more identified fields, The message body consists of one or more identified fields,
followed by a zero byte as a terminator. Fields may appear in followed by a zero byte as a terminator. Fields can appear in
any order. For each field there is the following: any order. For each field there is the following:
<variablelist> <variablelist>
<varlistentry> <varlistentry>
...@@ -2982,7 +2982,7 @@ NoticeResponse (B) ...@@ -2982,7 +2982,7 @@ NoticeResponse (B)
the message terminator and no string follows. the message terminator and no string follows.
The presently defined field types are listed in The presently defined field types are listed in
<xref linkend="protocol-error-fields">. <xref linkend="protocol-error-fields">.
Since more field types may be added in future, Since more field types might be added in future,
frontends should silently ignore fields of unrecognized frontends should silently ignore fields of unrecognized
type. type.
</para> </para>
...@@ -3107,7 +3107,7 @@ ParameterDescription (B) ...@@ -3107,7 +3107,7 @@ ParameterDescription (B)
<listitem> <listitem>
<para> <para>
The number of parameters used by the statement The number of parameters used by the statement
(may be zero). (can be zero).
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -3240,7 +3240,7 @@ Parse (F) ...@@ -3240,7 +3240,7 @@ Parse (F)
<listitem> <listitem>
<para> <para>
The number of parameter data types specified The number of parameter data types specified
(may be zero). Note that this is not an indication of (can be zero). Note that this is not an indication of
the number of parameters that might appear in the the number of parameters that might appear in the
query string, only the number that the frontend wants to query string, only the number that the frontend wants to
prespecify types for. prespecify types for.
...@@ -3513,7 +3513,7 @@ RowDescription (B) ...@@ -3513,7 +3513,7 @@ RowDescription (B)
</term> </term>
<listitem> <listitem>
<para> <para>
Specifies the number of fields in a row (may be zero). Specifies the number of fields in a row (can be zero).
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -3726,7 +3726,7 @@ StartupMessage (F) ...@@ -3726,7 +3726,7 @@ StartupMessage (F)
</variablelist> </variablelist>
In addition to the above, any run-time parameter that can be In addition to the above, any run-time parameter that can be
set at backend start time may be listed. Such settings set at backend start time might be listed. Such settings
will be applied during backend start (after parsing the will be applied during backend start (after parsing the
command-line options if any). The values will act as command-line options if any). The values will act as
session defaults. session defaults.
...@@ -3829,7 +3829,7 @@ Terminate (F) ...@@ -3829,7 +3829,7 @@ Terminate (F)
<title>Error and Notice Message Fields</title> <title>Error and Notice Message Fields</title>
<para> <para>
This section describes the fields that may appear in ErrorResponse and This section describes the fields that can appear in ErrorResponse and
NoticeResponse messages. Each field type has a single-byte identification NoticeResponse messages. Each field type has a single-byte identification
token. Note that any given field type should appear at most once per token. Note that any given field type should appear at most once per
message. message.
...@@ -3885,7 +3885,7 @@ message. ...@@ -3885,7 +3885,7 @@ message.
<listitem> <listitem>
<para> <para>
Detail: an optional secondary error message carrying more Detail: an optional secondary error message carrying more
detail about the problem. May run to multiple lines. detail about the problem. Might run to multiple lines.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -3899,7 +3899,7 @@ message. ...@@ -3899,7 +3899,7 @@ message.
Hint: an optional suggestion what to do about the problem. Hint: an optional suggestion what to do about the problem.
This is intended to differ from Detail in that it offers advice This is intended to differ from Detail in that it offers advice
(potentially inappropriate) rather than hard facts. (potentially inappropriate) rather than hard facts.
May run to multiple lines. Might run to multiple lines.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -4030,7 +4030,7 @@ PasswordMessage now has a type byte. ...@@ -4030,7 +4030,7 @@ PasswordMessage now has a type byte.
<para> <para>
ErrorResponse and NoticeResponse ('<literal>E</>' and '<literal>N</>') ErrorResponse and NoticeResponse ('<literal>E</>' and '<literal>N</>')
messages now contain multiple fields, from which the client code may messages now contain multiple fields, from which the client code can
assemble an error message of the desired level of verbosity. Note that assemble an error message of the desired level of verbosity. Note that
individual fields will typically not end with a newline, whereas the single individual fields will typically not end with a newline, whereas the single
string sent in the older protocol always did. string sent in the older protocol always did.
...@@ -4055,7 +4055,7 @@ message types Parse, Bind, Execute, Describe, Close, Flush, and Sync, and the ...@@ -4055,7 +4055,7 @@ message types Parse, Bind, Execute, Describe, Close, Flush, and Sync, and the
backend message types ParseComplete, BindComplete, PortalSuspended, backend message types ParseComplete, BindComplete, PortalSuspended,
ParameterDescription, NoData, and CloseComplete. Existing clients do not ParameterDescription, NoData, and CloseComplete. Existing clients do not
have to concern themselves with this sub-protocol, but making use of it have to concern themselves with this sub-protocol, but making use of it
may allow improvements in performance or functionality. might allow improvements in performance or functionality.
</para> </para>
<para> <para>
...@@ -4098,7 +4098,7 @@ the backend. ...@@ -4098,7 +4098,7 @@ the backend.
<para> <para>
The NotificationResponse ('<literal>A</>') message has an additional string The NotificationResponse ('<literal>A</>') message has an additional string
field, which is presently empty but may someday carry additional data passed field, which is presently empty but might someday carry additional data passed
from the <command>NOTIFY</command> event sender. from the <command>NOTIFY</command> event sender.
</para> </para>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/queries.sgml,v 1.41 2007/01/09 16:59:20 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/queries.sgml,v 1.42 2007/01/31 20:56:18 momjian Exp $ -->
<chapter id="queries"> <chapter id="queries">
<title>Queries</title> <title>Queries</title>
...@@ -116,11 +116,11 @@ SELECT random(); ...@@ -116,11 +116,11 @@ SELECT random();
FROM <replaceable>table_reference</replaceable> <optional>, <replaceable>table_reference</replaceable> <optional>, ...</optional></optional> FROM <replaceable>table_reference</replaceable> <optional>, <replaceable>table_reference</replaceable> <optional>, ...</optional></optional>
</synopsis> </synopsis>
A table reference may be a table name (possibly schema-qualified), A table reference can be a table name (possibly schema-qualified),
or a derived table such as a subquery, a table join, or complex or a derived table such as a subquery, a table join, or complex
combinations of these. If more than one table reference is listed combinations of these. If more than one table reference is listed
in the <literal>FROM</> clause they are cross-joined (see below) in the <literal>FROM</> clause they are cross-joined (see below)
to form the intermediate virtual table that may then be subject to to form the intermediate virtual table that can then be subject to
transformations by the <literal>WHERE</>, <literal>GROUP BY</>, transformations by the <literal>WHERE</>, <literal>GROUP BY</>,
and <literal>HAVING</> clauses and is finally the result of the and <literal>HAVING</> clauses and is finally the result of the
overall table expression. overall table expression.
...@@ -350,8 +350,8 @@ FROM <replaceable>table_reference</replaceable> <optional>, <replaceable>table_r ...@@ -350,8 +350,8 @@ FROM <replaceable>table_reference</replaceable> <optional>, <replaceable>table_r
<para> <para>
Joins of all types can be chained together or nested: either or Joins of all types can be chained together or nested: either or
both of <replaceable>T1</replaceable> and both of <replaceable>T1</replaceable> and
<replaceable>T2</replaceable> may be joined tables. Parentheses <replaceable>T2</replaceable> might be joined tables. Parentheses
may be used around <literal>JOIN</> clauses to control the join can be used around <literal>JOIN</> clauses to control the join
order. In the absence of parentheses, <literal>JOIN</> clauses order. In the absence of parentheses, <literal>JOIN</> clauses
nest left-to-right. nest left-to-right.
</para> </para>
...@@ -623,7 +623,7 @@ FROM (VALUES ('anne', 'smith'), ('bob', 'jones'), ('joe', 'blow')) ...@@ -623,7 +623,7 @@ FROM (VALUES ('anne', 'smith'), ('bob', 'jones'), ('joe', 'blow'))
of either base data types (scalar types) or composite data types of either base data types (scalar types) or composite data types
(table rows). They are used like a table, view, or subquery in (table rows). They are used like a table, view, or subquery in
the <literal>FROM</> clause of a query. Columns returned by table the <literal>FROM</> clause of a query. Columns returned by table
functions may be included in <literal>SELECT</>, functions can be included in <literal>SELECT</>,
<literal>JOIN</>, or <literal>WHERE</> clauses in the same manner <literal>JOIN</>, or <literal>WHERE</> clauses in the same manner
as a table, view, or subquery column. as a table, view, or subquery column.
</para> </para>
...@@ -636,8 +636,8 @@ FROM (VALUES ('anne', 'smith'), ('bob', 'jones'), ('joe', 'blow')) ...@@ -636,8 +636,8 @@ FROM (VALUES ('anne', 'smith'), ('bob', 'jones'), ('joe', 'blow'))
</para> </para>
<para> <para>
A table function may be aliased in the <literal>FROM</> clause, A table function can be aliased in the <literal>FROM</> clause,
but it also may be left unaliased. If a function is used in the but it also can be left unaliased. If a function is used in the
<literal>FROM</> clause with no alias, the function name is used <literal>FROM</> clause with no alias, the function name is used
as the resulting table name. as the resulting table name.
</para> </para>
...@@ -788,7 +788,7 @@ SELECT ... FROM fdt WHERE EXISTS (SELECT c1 FROM t2 WHERE c2 &gt; fdt.c1) ...@@ -788,7 +788,7 @@ SELECT ... FROM fdt WHERE EXISTS (SELECT c1 FROM t2 WHERE c2 &gt; fdt.c1)
<para> <para>
After passing the <literal>WHERE</> filter, the derived input After passing the <literal>WHERE</> filter, the derived input
table may be subject to grouping, using the <literal>GROUP BY</> table might be subject to grouping, using the <literal>GROUP BY</>
clause, and elimination of group rows using the <literal>HAVING</> clause, and elimination of group rows using the <literal>HAVING</>
clause. clause.
</para> </para>
...@@ -877,7 +877,7 @@ SELECT product_id, p.name, (sum(s.units) * p.price) AS sales ...@@ -877,7 +877,7 @@ SELECT product_id, p.name, (sum(s.units) * p.price) AS sales
<literal>p.name</literal>, and <literal>p.price</literal> must be <literal>p.name</literal>, and <literal>p.price</literal> must be
in the <literal>GROUP BY</> clause since they are referenced in in the <literal>GROUP BY</> clause since they are referenced in
the query select list. (Depending on how exactly the products the query select list. (Depending on how exactly the products
table is set up, name and price may be fully dependent on the table is set up, name and price might be fully dependent on the
product ID, so the additional groupings could theoretically be product ID, so the additional groupings could theoretically be
unnecessary, but this is not implemented yet.) The column unnecessary, but this is not implemented yet.) The column
<literal>s.units</> does not have to be in the <literal>GROUP <literal>s.units</> does not have to be in the <literal>GROUP
...@@ -1070,7 +1070,7 @@ SELECT a AS value, b + c AS sum FROM ... ...@@ -1070,7 +1070,7 @@ SELECT a AS value, b + c AS sum FROM ...
</indexterm> </indexterm>
<para> <para>
After the select list has been processed, the result table may After the select list has been processed, the result table can
optionally be subject to the elimination of duplicate rows. The optionally be subject to the elimination of duplicate rows. The
<literal>DISTINCT</literal> key word is written directly after <literal>DISTINCT</literal> key word is written directly after
<literal>SELECT</literal> to specify this: <literal>SELECT</literal> to specify this:
...@@ -1234,7 +1234,7 @@ SELECT a, b FROM table1 ORDER BY a + b, c; ...@@ -1234,7 +1234,7 @@ SELECT a, b FROM table1 ORDER BY a + b, c;
</programlisting> </programlisting>
When more than one expression is specified, When more than one expression is specified,
the later values are used to sort rows that are equal according to the the later values are used to sort rows that are equal according to the
earlier values. Each expression may be followed by an optional earlier values. Each expression can be followed by an optional
<literal>ASC</> or <literal>DESC</> keyword to set the sort direction to <literal>ASC</> or <literal>DESC</> keyword to set the sort direction to
ascending or descending. <literal>ASC</> order is the default. ascending or descending. <literal>ASC</> order is the default.
Ascending order puts smaller values first, where Ascending order puts smaller values first, where
...@@ -1342,7 +1342,7 @@ SELECT <replaceable>select_list</replaceable> ...@@ -1342,7 +1342,7 @@ SELECT <replaceable>select_list</replaceable>
When using <literal>LIMIT</>, it is important to use an When using <literal>LIMIT</>, it is important to use an
<literal>ORDER BY</> clause that constrains the result rows into a <literal>ORDER BY</> clause that constrains the result rows into a
unique order. Otherwise you will get an unpredictable subset of unique order. Otherwise you will get an unpredictable subset of
the query's rows. You may be asking for the tenth through the query's rows. You might be asking for the tenth through
twentieth rows, but tenth through twentieth in what ordering? The twentieth rows, but tenth through twentieth in what ordering? The
ordering is unknown, unless you specified <literal>ORDER BY</>. ordering is unknown, unless you specified <literal>ORDER BY</>.
</para> </para>
...@@ -1364,7 +1364,7 @@ SELECT <replaceable>select_list</replaceable> ...@@ -1364,7 +1364,7 @@ SELECT <replaceable>select_list</replaceable>
<para> <para>
The rows skipped by an <literal>OFFSET</> clause still have to be The rows skipped by an <literal>OFFSET</> clause still have to be
computed inside the server; therefore a large <literal>OFFSET</> computed inside the server; therefore a large <literal>OFFSET</>
can be inefficient. might be inefficient.
</para> </para>
</sect1> </sect1>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/query.sgml,v 1.48 2006/10/21 23:12:57 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/query.sgml,v 1.49 2007/01/31 20:56:18 momjian Exp $ -->
<chapter id="tutorial-sql"> <chapter id="tutorial-sql">
<title>The <acronym>SQL</acronym> Language</title> <title>The <acronym>SQL</acronym> Language</title>
...@@ -134,7 +134,7 @@ CREATE TABLE weather ( ...@@ -134,7 +134,7 @@ CREATE TABLE weather (
</para> </para>
<para> <para>
White space (i.e., spaces, tabs, and newlines) may be used freely White space (i.e., spaces, tabs, and newlines) can be used freely
in SQL commands. That means you can type the command aligned in SQL commands. That means you can type the command aligned
differently than above, or even all on one line. Two dashes differently than above, or even all on one line. Two dashes
(<quote><literal>--</literal></quote>) introduce comments. (<quote><literal>--</literal></quote>) introduce comments.
...@@ -151,7 +151,7 @@ CREATE TABLE weather ( ...@@ -151,7 +151,7 @@ CREATE TABLE weather (
a type for storing single precision floating-point numbers. a type for storing single precision floating-point numbers.
<type>date</type> should be self-explanatory. (Yes, the column of <type>date</type> should be self-explanatory. (Yes, the column of
type <type>date</type> is also named <literal>date</literal>. type <type>date</type> is also named <literal>date</literal>.
This may be convenient or confusing &mdash; you choose.) This might be convenient or confusing &mdash; you choose.)
</para> </para>
<para> <para>
...@@ -817,7 +817,7 @@ SELECT city, max(temp_lo) ...@@ -817,7 +817,7 @@ SELECT city, max(temp_lo)
You can update existing rows using the You can update existing rows using the
<command>UPDATE</command> command. <command>UPDATE</command> command.
Suppose you discover the temperature readings are Suppose you discover the temperature readings are
all off by 2 degrees after November 28. You may correct the all off by 2 degrees after November 28. You can correct the
data as follows: data as follows:
<programlisting> <programlisting>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/reference.sgml,v 1.61 2007/01/23 05:07:17 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/reference.sgml,v 1.62 2007/01/31 20:56:18 momjian Exp $ -->
<part id="reference"> <part id="reference">
<title>Reference</title> <title>Reference</title>
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
length an authoritative, complete, and formal summary about their length an authoritative, complete, and formal summary about their
respective subjects. More information about the use of respective subjects. More information about the use of
<productname>PostgreSQL</productname>, in narrative, tutorial, or <productname>PostgreSQL</productname>, in narrative, tutorial, or
example form, may be found in other parts of this book. See the example form, can be found in other parts of this book. See the
cross-references listed on each reference page. cross-references listed on each reference page.
</para> </para>
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
This part contains reference information for This part contains reference information for
<productname>PostgreSQL</productname> client applications and <productname>PostgreSQL</productname> client applications and
utilities. Not all of these commands are of general utility, some utilities. Not all of these commands are of general utility, some
may require special privileges. The common feature of these might require special privileges. The common feature of these
applications is that they can be run on any host, independent of applications is that they can be run on any host, independent of
where the database server resides. where the database server resides.
</para> </para>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/regress.sgml,v 1.55 2006/09/16 00:30:15 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/regress.sgml,v 1.56 2007/01/31 20:56:18 momjian Exp $ -->
<chapter id="regress"> <chapter id="regress">
<title id="regress-title">Regression Tests</title> <title id="regress-title">Regression Tests</title>
...@@ -84,7 +84,7 @@ gmake check ...@@ -84,7 +84,7 @@ gmake check
If you have configured <productname>PostgreSQL</productname> to install If you have configured <productname>PostgreSQL</productname> to install
into a location where an older <productname>PostgreSQL</productname> into a location where an older <productname>PostgreSQL</productname>
installation already exists, and you perform <literal>gmake check</> installation already exists, and you perform <literal>gmake check</>
before installing the new version, you may find that the tests fail before installing the new version, you might find that the tests fail
because the new programs try to use the already-installed shared because the new programs try to use the already-installed shared
libraries. (Typical symptoms are complaints about undefined symbols.) libraries. (Typical symptoms are complaints about undefined symbols.)
If you wish to run the tests before overwriting the old installation, If you wish to run the tests before overwriting the old installation,
...@@ -99,7 +99,7 @@ gmake check ...@@ -99,7 +99,7 @@ gmake check
scripts, which means forty processes: there's a server process and a scripts, which means forty processes: there's a server process and a
<application>psql</> process for each test script. <application>psql</> process for each test script.
So if your system enforces a per-user limit on the number of processes, So if your system enforces a per-user limit on the number of processes,
make sure this limit is at least fifty or so, else you may get make sure this limit is at least fifty or so, else you might get
random-seeming failures in the parallel test. If you are not in random-seeming failures in the parallel test. If you are not in
a position to raise the limit, you can cut down the degree of parallelism a position to raise the limit, you can cut down the degree of parallelism
by setting the <literal>MAX_CONNECTIONS</> parameter. For example, by setting the <literal>MAX_CONNECTIONS</> parameter. For example,
...@@ -161,7 +161,7 @@ gmake installcheck ...@@ -161,7 +161,7 @@ gmake installcheck
generated on a reference system, so the results are sensitive to generated on a reference system, so the results are sensitive to
small system differences. When a test is reported as small system differences. When a test is reported as
<quote>failed</quote>, always examine the differences between <quote>failed</quote>, always examine the differences between
expected and actual results; you may well find that the expected and actual results; you might find that the
differences are not significant. Nonetheless, we still strive to differences are not significant. Nonetheless, we still strive to
maintain accurate reference files across all supported platforms, maintain accurate reference files across all supported platforms,
so it can be expected that all tests pass. so it can be expected that all tests pass.
...@@ -193,7 +193,7 @@ gmake installcheck ...@@ -193,7 +193,7 @@ gmake installcheck
Some of the regression tests involve intentional invalid input Some of the regression tests involve intentional invalid input
values. Error messages can come from either the values. Error messages can come from either the
<productname>PostgreSQL</productname> code or from the host <productname>PostgreSQL</productname> code or from the host
platform system routines. In the latter case, the messages may platform system routines. In the latter case, the messages can
vary between platforms, but should reflect similar vary between platforms, but should reflect similar
information. These differences in messages will result in a information. These differences in messages will result in a
<quote>failed</quote> regression test that can be validated by <quote>failed</quote> regression test that can be validated by
...@@ -207,7 +207,7 @@ gmake installcheck ...@@ -207,7 +207,7 @@ gmake installcheck
<para> <para>
If you run the tests against an already-installed server that was If you run the tests against an already-installed server that was
initialized with a collation-order locale other than C, then initialized with a collation-order locale other than C, then
there may be differences due to sort order and follow-up there might be differences due to sort order and follow-up
failures. The regression test suite is set up to handle this failures. The regression test suite is set up to handle this
problem by providing alternative result files that together are problem by providing alternative result files that together are
known to handle a large number of locales. known to handle a large number of locales.
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/release.sgml,v 1.491 2007/01/06 15:19:45 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/release.sgml,v 1.492 2007/01/31 20:56:18 momjian Exp $ -->
<!-- <!--
Typical markup: Typical markup:
...@@ -504,7 +504,7 @@ do it for earlier branch release files. ...@@ -504,7 +504,7 @@ do it for earlier branch release files.
</para> </para>
<para> <para>
This may eliminate the need to set unrealistically small This might eliminate the need to set unrealistically small
values of <link values of <link
linkend="guc-random-page-cost"><varname>random_page_cost</></link>. linkend="guc-random-page-cost"><varname>random_page_cost</></link>.
If you have been using a very small <varname>random_page_cost</>, If you have been using a very small <varname>random_page_cost</>,
...@@ -989,7 +989,7 @@ do it for earlier branch release files. ...@@ -989,7 +989,7 @@ do it for earlier branch release files.
<para> <para>
On platforms where it is expensive to update the <application>ps</> On platforms where it is expensive to update the <application>ps</>
display, it may be worthwhile to turn this off and rely solely on display, it might be worthwhile to turn this off and rely solely on
<structname>pg_stat_activity</> for status information. <structname>pg_stat_activity</> for status information.
</para> </para>
</listitem> </listitem>
...@@ -1270,7 +1270,7 @@ do it for earlier branch release files. ...@@ -1270,7 +1270,7 @@ do it for earlier branch release files.
<para> <para>
This prevents surprising behavior due to multiple evaluation This prevents surprising behavior due to multiple evaluation
of a <literal>volatile</> function (such as <function>random()</> of a <literal>volatile</> function (such as <function>random()</>
or <function>nextval()</>). It may cause performance or <function>nextval()</>). It might cause performance
degradation in the presence of functions that are unnecessarily degradation in the presence of functions that are unnecessarily
marked as <literal>volatile</>. marked as <literal>volatile</>.
</para> </para>
...@@ -2966,7 +2966,7 @@ compilers (Hiroshi Saito)</para></listitem> ...@@ -2966,7 +2966,7 @@ compilers (Hiroshi Saito)</para></listitem>
<para> <para>
Full security against the SQL-injection attacks described in Full security against the SQL-injection attacks described in
CVE-2006-2313 and CVE-2006-2314 may require changes in application CVE-2006-2313 and CVE-2006-2314 might require changes in application
code. If you have applications that embed untrustworthy strings code. If you have applications that embed untrustworthy strings
into SQL commands, you should examine them as soon as possible to into SQL commands, you should examine them as soon as possible to
ensure that they are using recommended escaping techniques. In ensure that they are using recommended escaping techniques. In
...@@ -2998,7 +2998,7 @@ literals. By default, <literal>\'</> is rejected only when ...@@ -2998,7 +2998,7 @@ literals. By default, <literal>\'</> is rejected only when
GB18030, or UHC), which is the scenario in which SQL injection is possible. GB18030, or UHC), which is the scenario in which SQL injection is possible.
A new configuration parameter <varname>backslash_quote</> is available to A new configuration parameter <varname>backslash_quote</> is available to
adjust this behavior when needed. Note that full security against adjust this behavior when needed. Note that full security against
CVE-2006-2314 may require client-side changes; the purpose of CVE-2006-2314 might require client-side changes; the purpose of
<varname>backslash_quote</> is in part to make it obvious that insecure <varname>backslash_quote</> is in part to make it obvious that insecure
clients are insecure. clients are insecure.
</para></listitem> </para></listitem>
...@@ -3265,7 +3265,7 @@ to ensure that <application>plperl</> won't change the locale later</para> ...@@ -3265,7 +3265,7 @@ to ensure that <application>plperl</> won't change the locale later</para>
<para>This fixes a problem that occurred if the <application>postmaster</> was <para>This fixes a problem that occurred if the <application>postmaster</> was
started with environment variables specifying a different locale than what started with environment variables specifying a different locale than what
<application>initdb</> had been told. Under these conditions, any use of <application>initdb</> had been told. Under these conditions, any use of
<application>plperl</> was likely to lead to corrupt indexes. You may need <application>plperl</> was likely to lead to corrupt indexes. You might need
<command>REINDEX</> to fix existing indexes on <command>REINDEX</> to fix existing indexes on
textual columns if this has happened to you.</para></listitem> textual columns if this has happened to you.</para></listitem>
...@@ -3663,7 +3663,7 @@ DISTINCT query</para></listitem> ...@@ -3663,7 +3663,7 @@ DISTINCT query</para></listitem>
</para> </para>
<para> <para>
It may be necessary to set <varname>add_missing_from</> to true It might be necessary to set <varname>add_missing_from</> to true
in order to load an existing dump file, if the dump contains any in order to load an existing dump file, if the dump contains any
views or rules created using the implicit-<literal>FROM</> syntax. views or rules created using the implicit-<literal>FROM</> syntax.
This should be a one-time annoyance, because This should be a one-time annoyance, because
...@@ -3885,7 +3885,7 @@ psql -t -f fixseq.sql db1 | psql -e db1 ...@@ -3885,7 +3885,7 @@ psql -t -f fixseq.sql db1 | psql -e db1
<listitem> <listitem>
<para> <para>
<command>CREATE LANGUAGE</> may ignore the provided arguments <command>CREATE LANGUAGE</> can ignore the provided arguments
in favor of information from <structname>pg_pltemplate</> in favor of information from <structname>pg_pltemplate</>
(Tom) (Tom)
</para> </para>
...@@ -5724,7 +5724,7 @@ Wieland)</para></listitem> ...@@ -5724,7 +5724,7 @@ Wieland)</para></listitem>
<para> <para>
Full security against the SQL-injection attacks described in Full security against the SQL-injection attacks described in
CVE-2006-2313 and CVE-2006-2314 may require changes in application CVE-2006-2313 and CVE-2006-2314 might require changes in application
code. If you have applications that embed untrustworthy strings code. If you have applications that embed untrustworthy strings
into SQL commands, you should examine them as soon as possible to into SQL commands, you should examine them as soon as possible to
ensure that they are using recommended escaping techniques. In ensure that they are using recommended escaping techniques. In
...@@ -5756,7 +5756,7 @@ literals. By default, <literal>\'</> is rejected only when ...@@ -5756,7 +5756,7 @@ literals. By default, <literal>\'</> is rejected only when
GB18030, or UHC), which is the scenario in which SQL injection is possible. GB18030, or UHC), which is the scenario in which SQL injection is possible.
A new configuration parameter <varname>backslash_quote</> is available to A new configuration parameter <varname>backslash_quote</> is available to
adjust this behavior when needed. Note that full security against adjust this behavior when needed. Note that full security against
CVE-2006-2314 may require client-side changes; the purpose of CVE-2006-2314 might require client-side changes; the purpose of
<varname>backslash_quote</> is in part to make it obvious that insecure <varname>backslash_quote</> is in part to make it obvious that insecure
clients are insecure. clients are insecure.
</para></listitem> </para></listitem>
...@@ -5962,7 +5962,7 @@ to ensure that <application>plperl</> won't change the locale later</para> ...@@ -5962,7 +5962,7 @@ to ensure that <application>plperl</> won't change the locale later</para>
<para>This fixes a problem that occurred if the <application>postmaster</> was <para>This fixes a problem that occurred if the <application>postmaster</> was
started with environment variables specifying a different locale than what started with environment variables specifying a different locale than what
<application>initdb</> had been told. Under these conditions, any use of <application>initdb</> had been told. Under these conditions, any use of
<application>plperl</> was likely to lead to corrupt indexes. You may need <application>plperl</> was likely to lead to corrupt indexes. You might need
<command>REINDEX</> to fix existing indexes on <command>REINDEX</> to fix existing indexes on
textual columns if this has happened to you.</para></listitem> textual columns if this has happened to you.</para></listitem>
...@@ -6213,7 +6213,7 @@ code</para></listitem> ...@@ -6213,7 +6213,7 @@ code</para></listitem>
It is strongly recommended that all installations repair these errors, It is strongly recommended that all installations repair these errors,
either by initdb or by following the manual repair procedure given either by initdb or by following the manual repair procedure given
below. The errors at least allow unprivileged database users to crash below. The errors at least allow unprivileged database users to crash
their server process, and may allow unprivileged users to gain the their server process, and might allow unprivileged users to gain the
privileges of a database superuser. privileges of a database superuser.
</para> </para>
...@@ -6882,8 +6882,7 @@ typedefs (Michael)</para></listitem> ...@@ -6882,8 +6882,7 @@ typedefs (Michael)</para></listitem>
behavior across all platforms. In most cases, there should be behavior across all platforms. In most cases, there should be
little noticeable difference in time zone behavior, except that little noticeable difference in time zone behavior, except that
the time zone names used by <command>SET</>/<command>SHOW</> the time zone names used by <command>SET</>/<command>SHOW</>
<varname>TimeZone</> may <varname>TimeZone</> might be different from what your platform provides.
be different from what your platform provides.
</para> </para>
</listitem> </listitem>
...@@ -7312,7 +7311,7 @@ typedefs (Michael)</para></listitem> ...@@ -7312,7 +7311,7 @@ typedefs (Michael)</para></listitem>
Some logging-related configuration parameters could formerly be adjusted Some logging-related configuration parameters could formerly be adjusted
by ordinary users, but only in the <quote>more verbose</> direction. by ordinary users, but only in the <quote>more verbose</> direction.
They are now treated more strictly: only superusers can set them. They are now treated more strictly: only superusers can set them.
However, a superuser may use <command>ALTER USER</> to provide per-user However, a superuser can use <command>ALTER USER</> to provide per-user
settings of these values for non-superusers. Also, it is now possible settings of these values for non-superusers. Also, it is now possible
for superusers to set values of superuser-only configuration parameters for superusers to set values of superuser-only configuration parameters
via <literal>PGOPTIONS</>. via <literal>PGOPTIONS</>.
...@@ -9011,7 +9010,7 @@ ANYARRAY</para></listitem> ...@@ -9011,7 +9010,7 @@ ANYARRAY</para></listitem>
<para> <para>
Full security against the SQL-injection attacks described in Full security against the SQL-injection attacks described in
CVE-2006-2313 and CVE-2006-2314 may require changes in application CVE-2006-2313 and CVE-2006-2314 might require changes in application
code. If you have applications that embed untrustworthy strings code. If you have applications that embed untrustworthy strings
into SQL commands, you should examine them as soon as possible to into SQL commands, you should examine them as soon as possible to
ensure that they are using recommended escaping techniques. In ensure that they are using recommended escaping techniques. In
...@@ -9043,7 +9042,7 @@ literals. By default, <literal>\'</> is rejected only when ...@@ -9043,7 +9042,7 @@ literals. By default, <literal>\'</> is rejected only when
GB18030, or UHC), which is the scenario in which SQL injection is possible. GB18030, or UHC), which is the scenario in which SQL injection is possible.
A new configuration parameter <varname>backslash_quote</> is available to A new configuration parameter <varname>backslash_quote</> is available to
adjust this behavior when needed. Note that full security against adjust this behavior when needed. Note that full security against
CVE-2006-2314 may require client-side changes; the purpose of CVE-2006-2314 might require client-side changes; the purpose of
<varname>backslash_quote</> is in part to make it obvious that insecure <varname>backslash_quote</> is in part to make it obvious that insecure
clients are insecure. clients are insecure.
</para></listitem> </para></listitem>
...@@ -9196,7 +9195,7 @@ to ensure that <application>plperl</> won't change the locale later</para> ...@@ -9196,7 +9195,7 @@ to ensure that <application>plperl</> won't change the locale later</para>
<para>This fixes a problem that occurred if the <application>postmaster</> was <para>This fixes a problem that occurred if the <application>postmaster</> was
started with environment variables specifying a different locale than what started with environment variables specifying a different locale than what
<application>initdb</> had been told. Under these conditions, any use of <application>initdb</> had been told. Under these conditions, any use of
<application>plperl</> was likely to lead to corrupt indexes. You may need <application>plperl</> was likely to lead to corrupt indexes. You might need
<command>REINDEX</> to fix existing indexes on <command>REINDEX</> to fix existing indexes on
textual columns if this has happened to you.</para></listitem> textual columns if this has happened to you.</para></listitem>
...@@ -9382,7 +9381,7 @@ code</para></listitem> ...@@ -9382,7 +9381,7 @@ code</para></listitem>
It is strongly recommended that all installations repair these errors, It is strongly recommended that all installations repair these errors,
either by initdb or by following the manual repair procedures given either by initdb or by following the manual repair procedures given
below. The errors at least allow unprivileged database users to crash below. The errors at least allow unprivileged database users to crash
their server process, and may allow unprivileged users to gain the their server process, and might allow unprivileged users to gain the
privileges of a database superuser. privileges of a database superuser.
</para> </para>
...@@ -9806,7 +9805,7 @@ names from outer query levels. ...@@ -9806,7 +9805,7 @@ names from outer query levels.
<para> <para>
A dump/restore is not required for those running 7.4.X. However, A dump/restore is not required for those running 7.4.X. However,
it may be advisable as the easiest method of incorporating fixes for it might be advisable as the easiest method of incorporating fixes for
two errors that have been found in the initial contents of 7.4.X system two errors that have been found in the initial contents of 7.4.X system
catalogs. A dump/initdb/reload sequence using 7.4.2's initdb will catalogs. A dump/initdb/reload sequence using 7.4.2's initdb will
automatically correct these problems. automatically correct these problems.
...@@ -10360,7 +10359,7 @@ DROP SCHEMA information_schema CASCADE; ...@@ -10360,7 +10359,7 @@ DROP SCHEMA information_schema CASCADE;
<listitem> <listitem>
<para> <para>
Inner joins using the explicit <literal>JOIN</literal> syntax Inner joins using the explicit <literal>JOIN</literal> syntax
may behave differently because they are now better might behave differently because they are now better
optimized. optimized.
</para> </para>
</listitem> </listitem>
...@@ -11327,7 +11326,7 @@ DROP SCHEMA information_schema CASCADE; ...@@ -11327,7 +11326,7 @@ DROP SCHEMA information_schema CASCADE;
<listitem> <listitem>
<para> <para>
Arrays may now be specified as <literal>ARRAY[1,2,3]</literal>, Arrays can now be specified as <literal>ARRAY[1,2,3]</literal>,
<literal>ARRAY[['a','b'],['c','d']]</literal>, or <literal>ARRAY[['a','b'],['c','d']]</literal>, or
<literal>ARRAY[ARRAY[ARRAY[2]]]</literal> (Joe) <literal>ARRAY[ARRAY[ARRAY[2]]]</literal> (Joe)
</para> </para>
...@@ -12025,7 +12024,7 @@ DROP SCHEMA information_schema CASCADE; ...@@ -12025,7 +12024,7 @@ DROP SCHEMA information_schema CASCADE;
<para> <para>
Full security against the SQL-injection attacks described in Full security against the SQL-injection attacks described in
CVE-2006-2313 and CVE-2006-2314 may require changes in application CVE-2006-2313 and CVE-2006-2314 might require changes in application
code. If you have applications that embed untrustworthy strings code. If you have applications that embed untrustworthy strings
into SQL commands, you should examine them as soon as possible to into SQL commands, you should examine them as soon as possible to
ensure that they are using recommended escaping techniques. In ensure that they are using recommended escaping techniques. In
...@@ -12057,7 +12056,7 @@ literals. By default, <literal>\'</> is rejected only when ...@@ -12057,7 +12056,7 @@ literals. By default, <literal>\'</> is rejected only when
GB18030, or UHC), which is the scenario in which SQL injection is possible. GB18030, or UHC), which is the scenario in which SQL injection is possible.
A new configuration parameter <varname>backslash_quote</> is available to A new configuration parameter <varname>backslash_quote</> is available to
adjust this behavior when needed. Note that full security against adjust this behavior when needed. Note that full security against
CVE-2006-2314 may require client-side changes; the purpose of CVE-2006-2314 might require client-side changes; the purpose of
<varname>backslash_quote</> is in part to make it obvious that insecure <varname>backslash_quote</> is in part to make it obvious that insecure
clients are insecure. clients are insecure.
</para></listitem> </para></listitem>
...@@ -12190,7 +12189,7 @@ to ensure that <application>plperl</> won't change the locale later</para> ...@@ -12190,7 +12189,7 @@ to ensure that <application>plperl</> won't change the locale later</para>
<para>This fixes a problem that occurred if the <application>postmaster</> was <para>This fixes a problem that occurred if the <application>postmaster</> was
started with environment variables specifying a different locale than what started with environment variables specifying a different locale than what
<application>initdb</> had been told. Under these conditions, any use of <application>initdb</> had been told. Under these conditions, any use of
<application>plperl</> was likely to lead to corrupt indexes. You may need <application>plperl</> was likely to lead to corrupt indexes. You might need
<command>REINDEX</> to fix existing indexes on <command>REINDEX</> to fix existing indexes on
textual columns if this has happened to you.</para></listitem> textual columns if this has happened to you.</para></listitem>
...@@ -12345,7 +12344,7 @@ the variable is of pass-by-reference type</para></listitem> ...@@ -12345,7 +12344,7 @@ the variable is of pass-by-reference type</para></listitem>
It is strongly recommended that all installations repair this error, It is strongly recommended that all installations repair this error,
either by initdb or by following the manual repair procedure given either by initdb or by following the manual repair procedure given
below. The error at least allows unprivileged database users to crash below. The error at least allows unprivileged database users to crash
their server process, and may allow unprivileged users to gain the their server process, and might allow unprivileged users to gain the
privileges of a database superuser. privileges of a database superuser.
</para> </para>
...@@ -12929,7 +12928,7 @@ operations on bytea columns (Joe)</para></listitem> ...@@ -12929,7 +12928,7 @@ operations on bytea columns (Joe)</para></listitem>
A dump/restore is <emphasis>not</emphasis> required for those A dump/restore is <emphasis>not</emphasis> required for those
running version 7.3. However, it should be noted that the main running version 7.3. However, it should be noted that the main
<productname>PostgreSQL</productname> interface library, libpq, <productname>PostgreSQL</productname> interface library, libpq,
has a new major version number for this release, which may require has a new major version number for this release, which might require
recompilation of client code in certain cases. recompilation of client code in certain cases.
</para> </para>
</sect2> </sect2>
...@@ -13165,7 +13164,7 @@ operations on bytea columns (Joe)</para></listitem> ...@@ -13165,7 +13164,7 @@ operations on bytea columns (Joe)</para></listitem>
<para> <para>
<command>COPY</command> no longer considers missing trailing <command>COPY</command> no longer considers missing trailing
columns to be null. All columns need to be specified. columns to be null. All columns need to be specified.
(However, one may achieve a similar effect by specifying a (However, one can achieve a similar effect by specifying a
column list in the <command>COPY</command> command.) column list in the <command>COPY</command> command.)
</para> </para>
</listitem> </listitem>
...@@ -14066,7 +14065,7 @@ since <productname>PostgreSQL</productname> 7.1. ...@@ -14066,7 +14065,7 @@ since <productname>PostgreSQL</productname> 7.1.
<listitem> <listitem>
<para> <para>
The semantics of the <command>VACUUM</command> command have The semantics of the <command>VACUUM</command> command have
changed in this release. You may wish to update your changed in this release. You might wish to update your
maintenance procedures accordingly. maintenance procedures accordingly.
</para> </para>
</listitem> </listitem>
...@@ -14661,7 +14660,7 @@ previous releases of <productname>PostgreSQL</productname> have forced ...@@ -14661,7 +14660,7 @@ previous releases of <productname>PostgreSQL</productname> have forced
all data modifications to disk before each transaction commit. With all data modifications to disk before each transaction commit. With
WAL, only one log file must be flushed to disk, greatly improving WAL, only one log file must be flushed to disk, greatly improving
performance. If you have been using -F in previous releases to performance. If you have been using -F in previous releases to
disable disk flushes, you may want to consider discontinuing its use. disable disk flushes, you might want to consider discontinuing its use.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -14702,7 +14701,7 @@ outer join syntax. ...@@ -14702,7 +14701,7 @@ outer join syntax.
The previous C function manager did not The previous C function manager did not
handle null values properly, nor did it support 64-bit <acronym>CPU</acronym>'s (Alpha). The new handle null values properly, nor did it support 64-bit <acronym>CPU</acronym>'s (Alpha). The new
function manager does. You can continue using your old custom function manager does. You can continue using your old custom
functions, but you may want to rewrite them in the future to use the new functions, but you might want to rewrite them in the future to use the new
function manager call interface. function manager call interface.
</para> </para>
</listitem> </listitem>
...@@ -15175,7 +15174,7 @@ ecpg changes (Michael) ...@@ -15175,7 +15174,7 @@ ecpg changes (Michael)
A dump/restore using <application>pg_dump</application> A dump/restore using <application>pg_dump</application>
is required for those wishing to migrate data from any is required for those wishing to migrate data from any
previous release of <productname>PostgreSQL</productname>. previous release of <productname>PostgreSQL</productname>.
For those upgrading from 6.5.*, you may instead use For those upgrading from 6.5.*, you can instead use
<application>pg_upgrade</application> to upgrade to this <application>pg_upgrade</application> to upgrade to this
release; however, a full dump/reload installation is always the release; however, a full dump/reload installation is always the
most robust method for upgrades. most robust method for upgrades.
...@@ -15196,7 +15195,7 @@ ecpg changes (Michael) ...@@ -15196,7 +15195,7 @@ ecpg changes (Michael)
ease the transition by allowing ease the transition by allowing
<productname>PostgreSQL</productname> to recognize <productname>PostgreSQL</productname> to recognize
the deprecated type names and translate them to the new type the deprecated type names and translate them to the new type
names, this mechanism may not be completely transparent to names, this mechanism cannot be completely transparent to
your existing application. your existing application.
</para> </para>
</listitem> </listitem>
...@@ -15208,8 +15207,8 @@ ecpg changes (Michael) ...@@ -15208,8 +15207,8 @@ ecpg changes (Michael)
decreased query times as the optimizer makes a better choice decreased query times as the optimizer makes a better choice
for the preferred plan. However, in a small number of cases, for the preferred plan. However, in a small number of cases,
usually involving pathological distributions of data, your usually involving pathological distributions of data, your
query times may go up. If you are dealing with large amounts query times might go up. If you are dealing with large amounts
of data, you may want to check your queries to verify of data, you might want to check your queries to verify
performance. performance.
</para> </para>
</listitem> </listitem>
...@@ -16690,7 +16689,7 @@ Better identify tcl and tk libs and includes(Bruce) ...@@ -16690,7 +16689,7 @@ Better identify tcl and tk libs and includes(Bruce)
<listitem> <listitem>
<para> <para>
Socket interface for client/server connection. This is the default now Socket interface for client/server connection. This is the default now
so you may need to start <application>postmaster</application> with the so you might need to start <application>postmaster</application> with the
<option>-i</option> flag. <option>-i</option> flag.
</para> </para>
</listitem> </listitem>
...@@ -16726,7 +16725,7 @@ Better identify tcl and tk libs and includes(Bruce) ...@@ -16726,7 +16725,7 @@ Better identify tcl and tk libs and includes(Bruce)
mention that without subselects, SQL is a very limited language. mention that without subselects, SQL is a very limited language.
Subselects are a major feature, and you should review your code for Subselects are a major feature, and you should review your code for
places where subselects provide a better solution for your queries. I places where subselects provide a better solution for your queries. I
think you will find that there are more uses for subselects than you may think you will find that there are more uses for subselects than you might
think. Vadim has put us on the big SQL map with subselects, and fully think. Vadim has put us on the big SQL map with subselects, and fully
functional ones too. The only thing you can't do with subselects is to functional ones too. The only thing you can't do with subselects is to
use them in the target list. use them in the target list.
...@@ -16741,7 +16740,7 @@ Better identify tcl and tk libs and includes(Bruce) ...@@ -16741,7 +16740,7 @@ Better identify tcl and tk libs and includes(Bruce)
Third, <type>char()</type> fields will now allow faster access than <type>varchar()</type> or Third, <type>char()</type> fields will now allow faster access than <type>varchar()</type> or
<type>text</type>. Specifically, the <type>text</> and <type>varchar()</type> have a penalty for access to <type>text</type>. Specifically, the <type>text</> and <type>varchar()</type> have a penalty for access to
any columns after the first column of this type. <type>char()</type> used to also any columns after the first column of this type. <type>char()</type> used to also
have this access penalty, but it no longer does. This may suggest that have this access penalty, but it no longer does. This might suggest that
you redesign some of your tables, especially if you have short character you redesign some of your tables, especially if you have short character
columns that you have defined as <type>varchar()</type> or <type>text</type>. This and other columns that you have defined as <type>varchar()</type> or <type>text</type>. This and other
changes make 6.3 even faster than earlier releases. changes make 6.3 even faster than earlier releases.
...@@ -17290,7 +17289,7 @@ optimizer which uses <firstterm>genetic</firstterm> ...@@ -17290,7 +17289,7 @@ optimizer which uses <firstterm>genetic</firstterm>
The interpretation of array specifiers (the curly braces around atomic The interpretation of array specifiers (the curly braces around atomic
values) appears to have changed sometime after the original regression values) appears to have changed sometime after the original regression
tests were generated. The current <filename>./expected/*.out</filename> files reflect this tests were generated. The current <filename>./expected/*.out</filename> files reflect this
new interpretation, which may not be correct! new interpretation, which might not be correct!
</para> </para>
<para> <para>
...@@ -18004,7 +18003,7 @@ Incompatible changes: ...@@ -18004,7 +18003,7 @@ Incompatible changes:
* float literals (eg. 3.14) are now of type float4 (instead of float8 in * float literals (eg. 3.14) are now of type float4 (instead of float8 in
previous releases); you might have to do typecasting if you depend on it previous releases); you might have to do typecasting if you depend on it
being of type float8. If you neglect to do the typecasting and you assign being of type float8. If you neglect to do the typecasting and you assign
a float literal to a field of type float8, you may get incorrect values a float literal to a field of type float8, you might get incorrect values
stored! stored!
* LIBPQ has been totally revamped so that frontend applications * LIBPQ has been totally revamped so that frontend applications
can connect to multiple backends can connect to multiple backends
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/rowtypes.sgml,v 2.7 2007/01/30 22:29:23 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/rowtypes.sgml,v 2.8 2007/01/31 20:56:18 momjian Exp $ -->
<sect1 id="rowtypes"> <sect1 id="rowtypes">
<title>Composite Types</title> <title>Composite Types</title>
...@@ -99,7 +99,7 @@ CREATE TABLE inventory_item ( ...@@ -99,7 +99,7 @@ CREATE TABLE inventory_item (
<para> <para>
To write a composite value as a literal constant, enclose the field To write a composite value as a literal constant, enclose the field
values within parentheses and separate them by commas. You may put double values within parentheses and separate them by commas. You can put double
quotes around any field value, and must do so if it contains commas or quotes around any field value, and must do so if it contains commas or
parentheses. (More details appear below.) Thus, the general format of a parentheses. (More details appear below.) Thus, the general format of a
composite constant is the following: composite constant is the following:
...@@ -133,7 +133,7 @@ CREATE TABLE inventory_item ( ...@@ -133,7 +133,7 @@ CREATE TABLE inventory_item (
</para> </para>
<para> <para>
The <literal>ROW</literal> expression syntax may also be used to The <literal>ROW</literal> expression syntax can also be used to
construct composite values. In most cases this is considerably construct composite values. In most cases this is considerably
simpler to use than the string-literal syntax, since you don't have simpler to use than the string-literal syntax, since you don't have
to worry about multiple layers of quoting. We already used this to worry about multiple layers of quoting. We already used this
...@@ -252,7 +252,7 @@ INSERT INTO mytab (complex_col.r, complex_col.i) VALUES(1.1, 2.2); ...@@ -252,7 +252,7 @@ INSERT INTO mytab (complex_col.r, complex_col.i) VALUES(1.1, 2.2);
The decoration consists of parentheses (<literal>(</> and <literal>)</>) The decoration consists of parentheses (<literal>(</> and <literal>)</>)
around the whole value, plus commas (<literal>,</>) between adjacent around the whole value, plus commas (<literal>,</>) between adjacent
items. Whitespace outside the parentheses is ignored, but within the items. Whitespace outside the parentheses is ignored, but within the
parentheses it is considered part of the field value, and may or may not be parentheses it is considered part of the field value, and might or might not be
significant depending on the input conversion rules for the field data type. significant depending on the input conversion rules for the field data type.
For example, in For example, in
<programlisting> <programlisting>
...@@ -263,7 +263,7 @@ INSERT INTO mytab (complex_col.r, complex_col.i) VALUES(1.1, 2.2); ...@@ -263,7 +263,7 @@ INSERT INTO mytab (complex_col.r, complex_col.i) VALUES(1.1, 2.2);
</para> </para>
<para> <para>
As shown previously, when writing a composite value you may write double As shown previously, when writing a composite value you can write double
quotes around any individual field value. quotes around any individual field value.
You <emphasis>must</> do so if the field value would otherwise You <emphasis>must</> do so if the field value would otherwise
confuse the composite-value parser. In particular, fields containing confuse the composite-value parser. In particular, fields containing
...@@ -309,7 +309,7 @@ INSERT ... VALUES (E'("\\"\\\\")'); ...@@ -309,7 +309,7 @@ INSERT ... VALUES (E'("\\"\\\\")');
with a data type whose input routine also treated backslashes specially, with a data type whose input routine also treated backslashes specially,
<type>bytea</> for example, we might need as many as eight backslashes <type>bytea</> for example, we might need as many as eight backslashes
in the command to get one backslash into the stored composite field.) in the command to get one backslash into the stored composite field.)
Dollar quoting (see <xref linkend="sql-syntax-dollar-quoting">) may be Dollar quoting (see <xref linkend="sql-syntax-dollar-quoting">) can be
used to avoid the need to double backslashes. used to avoid the need to double backslashes.
</para> </para>
</note> </note>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/rules.sgml,v 1.48 2006/12/27 16:07:36 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/rules.sgml,v 1.49 2007/01/31 20:56:18 momjian Exp $ -->
<chapter id="rules"> <chapter id="rules">
<title>The Rule System</title> <title>The Rule System</title>
...@@ -1807,7 +1807,7 @@ GRANT SELECT ON phone_number TO secretary; ...@@ -1807,7 +1807,7 @@ GRANT SELECT ON phone_number TO secretary;
the originally given query will be executed, and its command the originally given query will be executed, and its command
status will be returned as usual. (But note that if there were status will be returned as usual. (But note that if there were
any conditional <literal>INSTEAD</> rules, the negation of their qualifications any conditional <literal>INSTEAD</> rules, the negation of their qualifications
will have been added to the original query. This may reduce the will have been added to the original query. This might reduce the
number of rows it processes, and if so the reported status will number of rows it processes, and if so the reported status will
be affected.) be affected.)
</para> </para>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.374 2006/11/25 22:44:48 petere Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.375 2007/01/31 20:56:19 momjian Exp $ -->
<chapter Id="runtime"> <chapter Id="runtime">
<title>Operating System Environment</title> <title>Operating System Environment</title>
...@@ -338,9 +338,9 @@ FATAL: could not create TCP/IP listen socket ...@@ -338,9 +338,9 @@ FATAL: could not create TCP/IP listen socket
This usually means just what it suggests: you tried to start This usually means just what it suggests: you tried to start
another server on the same port where one is already running. another server on the same port where one is already running.
However, if the kernel error message is not <computeroutput>Address However, if the kernel error message is not <computeroutput>Address
already in use</computeroutput> or some variant of that, there may already in use</computeroutput> or some variant of that, there might
be a different problem. For example, trying to start a server be a different problem. For example, trying to start a server
on a reserved port number may draw something like: on a reserved port number might draw something like:
<screen> <screen>
$ <userinput>postgres -p 666</userinput> $ <userinput>postgres -p 666</userinput>
LOG: could not bind IPv4 socket: Permission denied LOG: could not bind IPv4 socket: Permission denied
...@@ -363,7 +363,7 @@ DETAIL: Failed system call was shmget(key=5440001, size=4011376640, 03600). ...@@ -363,7 +363,7 @@ DETAIL: Failed system call was shmget(key=5440001, size=4011376640, 03600).
can try starting the server with a smaller-than-normal number of can try starting the server with a smaller-than-normal number of
buffers (<xref linkend="guc-shared-buffers">). You will eventually want buffers (<xref linkend="guc-shared-buffers">). You will eventually want
to reconfigure your kernel to increase the allowed shared memory to reconfigure your kernel to increase the allowed shared memory
size. You may also see this message when trying to start multiple size. You might also see this message when trying to start multiple
servers on the same machine, if their total space requested servers on the same machine, if their total space requested
exceeds the kernel limit. exceeds the kernel limit.
</para> </para>
...@@ -378,7 +378,7 @@ DETAIL: Failed system call was semget(5440126, 17, 03600). ...@@ -378,7 +378,7 @@ DETAIL: Failed system call was semget(5440126, 17, 03600).
space. It means your kernel's limit on the number of <systemitem space. It means your kernel's limit on the number of <systemitem
class="osname">System V</> semaphores is smaller than the number class="osname">System V</> semaphores is smaller than the number
<productname>PostgreSQL</productname> wants to create. As above, <productname>PostgreSQL</productname> wants to create. As above,
you may be able to work around the problem by starting the you might be able to work around the problem by starting the
server with a reduced number of allowed connections server with a reduced number of allowed connections
(<xref linkend="guc-max-connections">), but you'll eventually want to (<xref linkend="guc-max-connections">), but you'll eventually want to
increase the kernel limit. increase the kernel limit.
...@@ -442,7 +442,7 @@ psql: could not connect to server: No such file or directory ...@@ -442,7 +442,7 @@ psql: could not connect to server: No such file or directory
connection request and rejected it. That case will produce a connection request and rejected it. That case will produce a
different message, as shown in <xref different message, as shown in <xref
linkend="client-authentication-problems">.) Other error messages linkend="client-authentication-problems">.) Other error messages
such as <computeroutput>Connection timed out</computeroutput> may such as <computeroutput>Connection timed out</computeroutput> might
indicate more fundamental problems, like lack of network indicate more fundamental problems, like lack of network
connectivity. connectivity.
</para> </para>
...@@ -861,7 +861,7 @@ options SEMMAP=256 ...@@ -861,7 +861,7 @@ options SEMMAP=256
</para> </para>
<para> <para>
Older distributions may not have the <command>sysctl</command> program, Older distributions might not have the <command>sysctl</command> program,
but equivalent changes can be made by manipulating the but equivalent changes can be made by manipulating the
<filename>/proc</filename> file system: <filename>/proc</filename> file system:
<screen> <screen>
...@@ -900,7 +900,7 @@ sysctl -w kern.sysv.shmall ...@@ -900,7 +900,7 @@ sysctl -w kern.sysv.shmall
<para> <para>
In OS X 10.3.9 and later, instead of editing <filename>/etc/rc</> In OS X 10.3.9 and later, instead of editing <filename>/etc/rc</>
you may create a file named <filename>/etc/sysctl.conf</>, you can create a file named <filename>/etc/sysctl.conf</>,
containing variable assignments such as containing variable assignments such as
<programlisting> <programlisting>
kern.sysv.shmmax=4194304 kern.sysv.shmmax=4194304
...@@ -970,11 +970,11 @@ kern.sysv.shmall=1024 ...@@ -970,11 +970,11 @@ kern.sysv.shmall=1024
sort of configuration commonly used for other databases such sort of configuration commonly used for other databases such
as <application>DB/2</application>.</para> as <application>DB/2</application>.</para>
<para> It may, however, be necessary to modify the global <para> It might , however, be necessary to modify the global
<command>ulimit</command> information in <command>ulimit</command> information in
<filename>/etc/security/limits</filename>, as the default hard <filename>/etc/security/limits</filename>, as the default hard
limits for file sizes (<varname>fsize</varname>) and numbers of limits for file sizes (<varname>fsize</varname>) and numbers of
files (<varname>nofiles</varname>) may be too low. files (<varname>nofiles</varname>) might be too low.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -1158,7 +1158,7 @@ default:\ ...@@ -1158,7 +1158,7 @@ default:\
<quote>socially friendly</quote> values that allow many users to <quote>socially friendly</quote> values that allow many users to
coexist on a machine without using an inappropriate fraction of coexist on a machine without using an inappropriate fraction of
the system resources. If you run many servers on a machine this the system resources. If you run many servers on a machine this
is perhaps what you want, but on dedicated servers you may want to is perhaps what you want, but on dedicated servers you might want to
raise this limit. raise this limit.
</para> </para>
...@@ -1179,7 +1179,7 @@ default:\ ...@@ -1179,7 +1179,7 @@ default:\
<para> <para>
In Linux 2.4 and later, the default virtual memory behavior is not In Linux 2.4 and later, the default virtual memory behavior is not
optimal for <productname>PostgreSQL</productname>. Because of the optimal for <productname>PostgreSQL</productname>. Because of the
way that the kernel implements memory overcommit, the kernel may way that the kernel implements memory overcommit, the kernel might
terminate the <productname>PostgreSQL</productname> server (the terminate the <productname>PostgreSQL</productname> server (the
master server process) if the memory demands of master server process) if the memory demands of
another process cause the system to run out of virtual memory. another process cause the system to run out of virtual memory.
...@@ -1214,7 +1214,7 @@ Out of Memory: Killed process 12345 (postgres). ...@@ -1214,7 +1214,7 @@ Out of Memory: Killed process 12345 (postgres).
sysctl -w vm.overcommit_memory=2 sysctl -w vm.overcommit_memory=2
</programlisting> </programlisting>
or placing an equivalent entry in <filename>/etc/sysctl.conf</>. or placing an equivalent entry in <filename>/etc/sysctl.conf</>.
You may also wish to modify the related setting You might also wish to modify the related setting
<literal>vm.overcommit_ratio</>. For details see the kernel documentation <literal>vm.overcommit_ratio</>. For details see the kernel documentation
file <filename>Documentation/vm/overcommit-accounting</>. file <filename>Documentation/vm/overcommit-accounting</>.
</para> </para>
...@@ -1314,7 +1314,7 @@ $ <userinput>kill -INT `head -1 /usr/local/pgsql/data/postmaster.pid`</userinput ...@@ -1314,7 +1314,7 @@ $ <userinput>kill -INT `head -1 /usr/local/pgsql/data/postmaster.pid`</userinput
<para> <para>
It is best not to use <systemitem>SIGKILL</systemitem> to shut down It is best not to use <systemitem>SIGKILL</systemitem> to shut down
the server. Doing so will prevent the server from releasing the server. Doing so will prevent the server from releasing
shared memory and semaphores, which may then have to be done shared memory and semaphores, which might then have to be done
manually before a new server can be started. Furthermore, manually before a new server can be started. Furthermore,
<systemitem>SIGKILL</systemitem> kills the <command>postgres</command> <systemitem>SIGKILL</systemitem> kills the <command>postgres</command>
process without letting it relay the signal to its subprocesses, process without letting it relay the signal to its subprocesses,
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/sources.sgml,v 2.20 2006/10/23 18:10:32 petere Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/sources.sgml,v 2.21 2007/01/31 20:56:19 momjian Exp $ -->
<chapter id="source"> <chapter id="source">
<title>PostgreSQL Coding Conventions</title> <title>PostgreSQL Coding Conventions</title>
...@@ -95,7 +95,7 @@ ereport(ERROR, ...@@ -95,7 +95,7 @@ ereport(ERROR,
func_signature_string(funcname, nargs, func_signature_string(funcname, nargs,
actual_arg_types)), actual_arg_types)),
errhint("Unable to choose a best candidate function. " errhint("Unable to choose a best candidate function. "
"You may need to add explicit typecasts."))); "You might need to add explicit typecasts.")));
</programlisting> </programlisting>
This illustrates the use of format codes to embed run-time values into This illustrates the use of format codes to embed run-time values into
a message text. Also, an optional <quote>hint</> message is provided. a message text. Also, an optional <quote>hint</> message is provided.
...@@ -276,7 +276,7 @@ Hint: the addendum ...@@ -276,7 +276,7 @@ Hint: the addendum
<para> <para>
Rationale: keeping the primary message short helps keep it to the point, Rationale: keeping the primary message short helps keep it to the point,
and lets clients lay out screen space on the assumption that one line is and lets clients lay out screen space on the assumption that one line is
enough for error messages. Detail and hint messages may be relegated to a enough for error messages. Detail and hint messages can be relegated to a
verbose mode, or perhaps a pop-up error-details window. Also, details and verbose mode, or perhaps a pop-up error-details window. Also, details and
hints would normally be suppressed from the server log to save hints would normally be suppressed from the server log to save
space. Reference to implementation details is best avoided since users space. Reference to implementation details is best avoided since users
...@@ -291,7 +291,7 @@ Hint: the addendum ...@@ -291,7 +291,7 @@ Hint: the addendum
<para> <para>
Don't put any specific assumptions about formatting into the message Don't put any specific assumptions about formatting into the message
texts. Expect clients and the server log to wrap lines to fit their own texts. Expect clients and the server log to wrap lines to fit their own
needs. In long messages, newline characters (\n) may be used to indicate needs. In long messages, newline characters (\n) can be used to indicate
suggested paragraph breaks. Don't end a message with a newline. Don't suggested paragraph breaks. Don't end a message with a newline. Don't
use tabs or other formatting characters. (In error context displays, use tabs or other formatting characters. (In error context displays,
newlines are automatically added to separate levels of context such as newlines are automatically added to separate levels of context such as
...@@ -376,7 +376,7 @@ Hint: the addendum ...@@ -376,7 +376,7 @@ Hint: the addendum
messages are not grammatically complete sentences anyway. (And if they're messages are not grammatically complete sentences anyway. (And if they're
long enough to be more than one sentence, they should be split into long enough to be more than one sentence, they should be split into
primary and detail parts.) However, detail and hint messages are longer primary and detail parts.) However, detail and hint messages are longer
and may need to include multiple sentences. For consistency, they should and might need to include multiple sentences. For consistency, they should
follow complete-sentence style even when there's only one sentence. follow complete-sentence style even when there's only one sentence.
</para> </para>
...@@ -435,7 +435,7 @@ cannot open file "%s" ...@@ -435,7 +435,7 @@ cannot open file "%s"
The first one means that the attempt to open the file failed. The The first one means that the attempt to open the file failed. The
message should give a reason, such as <quote>disk full</quote> or message should give a reason, such as <quote>disk full</quote> or
<quote>file doesn't exist</quote>. The past tense is appropriate because <quote>file doesn't exist</quote>. The past tense is appropriate because
next time the disk might not be full anymore or the file in question may next time the disk might not be full anymore or the file in question might
exist. exist.
</para> </para>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/spi.sgml,v 1.49 2006/10/23 18:10:32 petere Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/spi.sgml,v 1.50 2007/01/31 20:56:19 momjian Exp $ -->
<chapter id="spi"> <chapter id="spi">
<title>Server Programming Interface</title> <title>Server Programming Interface</title>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
Note that if a command invoked via SPI fails, then control will not be Note that if a command invoked via SPI fails, then control will not be
returned to your procedure. Rather, the returned to your procedure. Rather, the
transaction or subtransaction in which your procedure executes will be transaction or subtransaction in which your procedure executes will be
rolled back. (This may seem surprising given that the SPI functions mostly rolled back. (This might seem surprising given that the SPI functions mostly
have documented error-return conventions. Those conventions only apply have documented error-return conventions. Those conventions only apply
for errors detected within the SPI functions themselves, however.) for errors detected within the SPI functions themselves, however.)
It is possible to recover control after an error by establishing your own It is possible to recover control after an error by establishing your own
...@@ -87,7 +87,7 @@ int SPI_connect(void) ...@@ -87,7 +87,7 @@ int SPI_connect(void)
<function>SPI_connect</function> opens a connection from a <function>SPI_connect</function> opens a connection from a
procedure invocation to the SPI manager. You must call this procedure invocation to the SPI manager. You must call this
function if you want to execute commands through SPI. Some utility function if you want to execute commands through SPI. Some utility
SPI functions may be called from unconnected procedures. SPI functions can be called from unconnected procedures.
</para> </para>
<para> <para>
...@@ -305,7 +305,7 @@ int SPI_execute(const char * <parameter>command</parameter>, bool <parameter>rea ...@@ -305,7 +305,7 @@ int SPI_execute(const char * <parameter>command</parameter>, bool <parameter>rea
</para> </para>
<para> <para>
This function may only be called from a connected procedure. This function can only be called from a connected procedure.
</para> </para>
<para> <para>
...@@ -321,7 +321,7 @@ SPI_execute("INSERT INTO foo SELECT * FROM bar", false, 5); ...@@ -321,7 +321,7 @@ SPI_execute("INSERT INTO foo SELECT * FROM bar", false, 5);
</para> </para>
<para> <para>
You may pass multiple commands in one string. You can pass multiple commands in one string.
<function>SPI_execute</function> returns the <function>SPI_execute</function> returns the
result for the command executed last. The <parameter>count</parameter> result for the command executed last. The <parameter>count</parameter>
limit applies to each command separately, but it is not applied to limit applies to each command separately, but it is not applied to
...@@ -366,7 +366,7 @@ SPI_execute("INSERT INTO foo SELECT * FROM bar", false, 5); ...@@ -366,7 +366,7 @@ SPI_execute("INSERT INTO foo SELECT * FROM bar", false, 5);
<symbol>SPI_OK_INSERT_RETURNING</symbol>, <symbol>SPI_OK_INSERT_RETURNING</symbol>,
<symbol>SPI_OK_DELETE_RETURNING</symbol>, or <symbol>SPI_OK_DELETE_RETURNING</symbol>, or
<symbol>SPI_OK_UPDATE_RETURNING</symbol>, <symbol>SPI_OK_UPDATE_RETURNING</symbol>,
then you may use the then you can use the
global pointer <literal>SPITupleTable *SPI_tuptable</literal> to global pointer <literal>SPITupleTable *SPI_tuptable</literal> to
access the result rows. Some utility commands (such as access the result rows. Some utility commands (such as
<command>EXPLAIN</>) also return row sets, and <literal>SPI_tuptable</> <command>EXPLAIN</>) also return row sets, and <literal>SPI_tuptable</>
...@@ -388,7 +388,7 @@ typedef struct ...@@ -388,7 +388,7 @@ typedef struct
</programlisting> </programlisting>
<structfield>vals</> is an array of pointers to rows. (The number <structfield>vals</> is an array of pointers to rows. (The number
of valid entries is given by <varname>SPI_processed</varname>.) of valid entries is given by <varname>SPI_processed</varname>.)
<structfield>tupdesc</> is a row descriptor which you may pass to <structfield>tupdesc</> is a row descriptor which you can pass to
SPI functions dealing with rows. <structfield>tuptabcxt</>, SPI functions dealing with rows. <structfield>tuptabcxt</>,
<structfield>alloced</>, and <structfield>free</> are internal <structfield>alloced</>, and <structfield>free</> are internal
fields not intended for use by SPI callers. fields not intended for use by SPI callers.
...@@ -713,7 +713,7 @@ void * SPI_prepare(const char * <parameter>command</parameter>, int <parameter>n ...@@ -713,7 +713,7 @@ void * SPI_prepare(const char * <parameter>command</parameter>, int <parameter>n
<para> <para>
When the same or a similar command is to be executed repeatedly, it When the same or a similar command is to be executed repeatedly, it
may be advantageous to perform the planning only once. might be advantageous to perform the planning only once.
<function>SPI_prepare</function> converts a command string into an <function>SPI_prepare</function> converts a command string into an
execution plan that can be executed repeatedly using execution plan that can be executed repeatedly using
<function>SPI_execute_plan</function>. <function>SPI_execute_plan</function>.
...@@ -792,7 +792,7 @@ void * SPI_prepare(const char * <parameter>command</parameter>, int <parameter>n ...@@ -792,7 +792,7 @@ void * SPI_prepare(const char * <parameter>command</parameter>, int <parameter>n
<para> <para>
There is a disadvantage to using parameters: since the planner does There is a disadvantage to using parameters: since the planner does
not know the values that will be supplied for the parameters, it not know the values that will be supplied for the parameters, it
may make worse planning choices than it would make for a normal might make worse planning choices than it would make for a normal
command with all constants visible. command with all constants visible.
</para> </para>
</refsect1> </refsect1>
...@@ -1685,7 +1685,7 @@ void * SPI_saveplan(void * <parameter>plan</parameter>) ...@@ -1685,7 +1685,7 @@ void * SPI_saveplan(void * <parameter>plan</parameter>)
</para> </para>
<para> <para>
All functions described in this section may be used by both All functions described in this section can be used by both
connected and unconnected procedures. connected and unconnected procedures.
</para> </para>
...@@ -2311,7 +2311,7 @@ char * SPI_getnspname(Relation <parameter>rel</parameter>) ...@@ -2311,7 +2311,7 @@ char * SPI_getnspname(Relation <parameter>rel</parameter>)
</para> </para>
<para> <para>
All functions described in this section may be used by both All functions described in this section can be used by both
connected and unconnected procedures. In an unconnected procedure, connected and unconnected procedures. In an unconnected procedure,
they act the same as the underlying ordinary server functions they act the same as the underlying ordinary server functions
(<function>palloc</>, etc.). (<function>palloc</>, etc.).
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/sql.sgml,v 1.43 2007/01/09 02:14:10 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/sql.sgml,v 1.44 2007/01/31 20:56:19 momjian Exp $ -->
<chapter id="sql-intro"> <chapter id="sql-intro">
<title>SQL</title> <title>SQL</title>
...@@ -173,9 +173,9 @@ PART: 4 | 3 ...@@ -173,9 +173,9 @@ PART: 4 | 3
</para> </para>
<para> <para>
The tables PART and SUPPLIER may be regarded as The tables PART and SUPPLIER can be regarded as
<firstterm>entities</firstterm> and <firstterm>entities</firstterm> and
SELLS may be regarded as a <firstterm>relationship</firstterm> SELLS can be regarded as a <firstterm>relationship</firstterm>
between a particular between a particular
part and a particular supplier. part and a particular supplier.
</para> </para>
...@@ -949,7 +949,7 @@ SELECT PNAME, PRICE ...@@ -949,7 +949,7 @@ SELECT PNAME, PRICE
</para> </para>
<para> <para>
Arithmetic operations may be used in the target list and in the WHERE Arithmetic operations can be used in the target list and in the WHERE
clause. For example if we want to know how much it would cost if we clause. For example if we want to know how much it would cost if we
take two pieces of a part we could use the following query: take two pieces of a part we could use the following query:
...@@ -1059,7 +1059,7 @@ select sname, pname from supplier ...@@ -1059,7 +1059,7 @@ select sname, pname from supplier
A joined table, created using JOIN syntax, is a table reference list A joined table, created using JOIN syntax, is a table reference list
item that occurs in a FROM clause and before any WHERE, GROUP BY, item that occurs in a FROM clause and before any WHERE, GROUP BY,
or HAVING clause. Other table references, including table names or or HAVING clause. Other table references, including table names or
other JOIN clauses, may be included in the FROM clause if separated other JOIN clauses, can be included in the FROM clause if separated
by commas. JOINed tables are logically like any other by commas. JOINed tables are logically like any other
table listed in the FROM clause. table listed in the FROM clause.
</para> </para>
...@@ -1239,7 +1239,7 @@ select sname, pname from supplier ...@@ -1239,7 +1239,7 @@ select sname, pname from supplier
<para> <para>
JOINs of all types can be chained together or nested where either or both of JOINs of all types can be chained together or nested where either or both of
<replaceable class="parameter">T1</replaceable> and <replaceable class="parameter">T1</replaceable> and
<replaceable class="parameter">T2</replaceable> may be JOINed tables. <replaceable class="parameter">T2</replaceable> can be JOINed tables.
Parenthesis can be used around JOIN clauses to control the order Parenthesis can be used around JOIN clauses to control the order
of JOINs which are otherwise processed left to right. of JOINs which are otherwise processed left to right.
</para> </para>
...@@ -1405,7 +1405,7 @@ SELECT S.SNO, S.SNAME, COUNT(SE.PNO) ...@@ -1405,7 +1405,7 @@ SELECT S.SNO, S.SNAME, COUNT(SE.PNO)
<para> <para>
Note that for a query using GROUP BY and aggregate Note that for a query using GROUP BY and aggregate
functions to make sense, the target list can only refer directly to functions to make sense, the target list can only refer directly to
the attributes being grouped by. Other attributes may only be used the attributes being grouped by. Other attributes can only be used
inside the arguments of aggregate functions. Otherwise there would inside the arguments of aggregate functions. Otherwise there would
not be a unique value to associate with the other attributes. not be a unique value to associate with the other attributes.
</para> </para>
...@@ -1825,7 +1825,7 @@ CREATE INDEX I ON SUPPLIER (SNAME); ...@@ -1825,7 +1825,7 @@ CREATE INDEX I ON SUPPLIER (SNAME);
<title>Create View</title> <title>Create View</title>
<para> <para>
A view may be regarded as a <firstterm>virtual table</firstterm>, A view can be regarded as a <firstterm>virtual table</firstterm>,
i.e. a table that i.e. a table that
does not <emphasis>physically</emphasis> exist in the database does not <emphasis>physically</emphasis> exist in the database
but looks to the user but looks to the user
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/start.sgml,v 1.43 2006/10/21 23:12:57 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/start.sgml,v 1.44 2007/01/31 20:56:19 momjian Exp $ -->
<chapter id="tutorial-start"> <chapter id="tutorial-start">
<title>Getting Started</title> <title>Getting Started</title>
...@@ -38,11 +38,11 @@ ...@@ -38,11 +38,11 @@
<para> <para>
If your site administrator has not set things up in the default If your site administrator has not set things up in the default
way, you may have some more work to do. For example, if the way, you might have some more work to do. For example, if the
database server machine is a remote machine, you will need to set database server machine is a remote machine, you will need to set
the <envar>PGHOST</envar> environment variable to the name of the the <envar>PGHOST</envar> environment variable to the name of the
database server machine. The environment variable database server machine. The environment variable
<envar>PGPORT</envar> may also have to be set. The bottom line is <envar>PGPORT</envar> might also have to be set. The bottom line is
this: if you try to start an application program and it complains this: if you try to start an application program and it complains
that it cannot connect to the database, you should consult your that it cannot connect to the database, you should consult your
site administrator or, if that is you, the documentation to make site administrator or, if that is you, the documentation to make
...@@ -272,7 +272,7 @@ createdb: database creation failed: ERROR: permission denied to create database ...@@ -272,7 +272,7 @@ createdb: database creation failed: ERROR: permission denied to create database
</para> </para>
<para> <para>
More about <command>createdb</command> and <command>dropdb</command> may More about <command>createdb</command> and <command>dropdb</command> can
be found in <xref linkend="APP-CREATEDB"> and <xref linkend="APP-DROPDB"> be found in <xref linkend="APP-CREATEDB"> and <xref linkend="APP-DROPDB">
respectively. respectively.
</para> </para>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/storage.sgml,v 1.13 2006/11/25 22:55:59 petere Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/storage.sgml,v 1.14 2007/01/31 20:56:19 momjian Exp $ -->
<chapter id="storage"> <chapter id="storage">
...@@ -365,7 +365,7 @@ fixed size (usually 8 kB, although a different page size can be selected ...@@ -365,7 +365,7 @@ fixed size (usually 8 kB, although a different page size can be selected
when compiling the server). In a table, all the pages are logically when compiling the server). In a table, all the pages are logically
equivalent, so a particular item (row) can be stored in any page. In equivalent, so a particular item (row) can be stored in any page. In
indexes, the first page is generally reserved as a <firstterm>metapage</> indexes, the first page is generally reserved as a <firstterm>metapage</>
holding control information, and there may be different types of pages holding control information, and there can be different types of pages
within the index, depending on the index access method. within the index, depending on the index access method.
</para> </para>
...@@ -503,7 +503,7 @@ data. Empty in ordinary tables.</entry> ...@@ -503,7 +503,7 @@ data. Empty in ordinary tables.</entry>
</table> </table>
<para> <para>
All the details may be found in All the details can be found in
<filename>src/include/storage/bufpage.h</filename>. <filename>src/include/storage/bufpage.h</filename>.
</para> </para>
...@@ -519,7 +519,7 @@ data. Empty in ordinary tables.</entry> ...@@ -519,7 +519,7 @@ data. Empty in ordinary tables.</entry>
The number of item identifiers present can be determined by looking at The number of item identifiers present can be determined by looking at
<structfield>pd_lower</>, which is increased to allocate a new identifier. <structfield>pd_lower</>, which is increased to allocate a new identifier.
Because an item Because an item
identifier is never moved until it is freed, its index may be used on a identifier is never moved until it is freed, its index can be used on a
long-term basis to reference an item, even when the item itself is moved long-term basis to reference an item, even when the item itself is moved
around on the page to compact free space. In fact, every pointer to an around on the page to compact free space. In fact, every pointer to an
item (<type>ItemPointer</type>, also known as item (<type>ItemPointer</type>, also known as
...@@ -540,7 +540,7 @@ data. Empty in ordinary tables.</entry> ...@@ -540,7 +540,7 @@ data. Empty in ordinary tables.</entry>
<para> <para>
The final section is the <quote>special section</quote> which may The final section is the <quote>special section</quote> which can
contain anything the access method wishes to store. For example, contain anything the access method wishes to store. For example,
b-tree indexes store links to the page's left and right siblings, b-tree indexes store links to the page's left and right siblings,
as well as some other data relevant to the index structure. as well as some other data relevant to the index structure.
...@@ -647,7 +647,7 @@ data. Empty in ordinary tables.</entry> ...@@ -647,7 +647,7 @@ data. Empty in ordinary tables.</entry>
</table> </table>
<para> <para>
All the details may be found in All the details can be found in
<filename>src/include/access/htup.h</filename>. <filename>src/include/access/htup.h</filename>.
</para> </para>
...@@ -673,7 +673,7 @@ data. Empty in ordinary tables.</entry> ...@@ -673,7 +673,7 @@ data. Empty in ordinary tables.</entry>
variable length field (attlen = -1) then it's a bit more complicated. variable length field (attlen = -1) then it's a bit more complicated.
All variable-length datatypes share the common header structure All variable-length datatypes share the common header structure
<type>varattrib</type>, which includes the total length of the stored <type>varattrib</type>, which includes the total length of the stored
value and some flag bits. Depending on the flags, the data may be either value and some flag bits. Depending on the flags, the data can be either
inline or in a <acronym>TOAST</> table; inline or in a <acronym>TOAST</> table;
it might be compressed, too (see <xref linkend="storage-toast">). it might be compressed, too (see <xref linkend="storage-toast">).
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/syntax.sgml,v 1.111 2006/10/22 03:03:41 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/syntax.sgml,v 1.112 2007/01/31 20:56:19 momjian Exp $ -->
<chapter id="sql-syntax"> <chapter id="sql-syntax">
<title>SQL Syntax</title> <title>SQL Syntax</title>
...@@ -120,7 +120,7 @@ INSERT INTO MY_TABLE VALUES (3, 'hi there'); ...@@ -120,7 +120,7 @@ INSERT INTO MY_TABLE VALUES (3, 'hi there');
key word can be letters, underscores, digits key word can be letters, underscores, digits
(<literal>0</literal>-<literal>9</literal>), or dollar signs (<literal>0</literal>-<literal>9</literal>), or dollar signs
(<literal>$</>). Note that dollar signs are not allowed in identifiers (<literal>$</>). Note that dollar signs are not allowed in identifiers
according to the letter of the SQL standard, so their use may render according to the letter of the SQL standard, so their use might render
applications less portable. applications less portable.
The SQL standard will not define a key word that contains The SQL standard will not define a key word that contains
digits or starts or ends with an underscore, so identifiers of this digits or starts or ends with an underscore, so identifiers of this
...@@ -466,7 +466,7 @@ $function$ ...@@ -466,7 +466,7 @@ $function$
digits (0 through 9). At least one digit must be before or after the digits (0 through 9). At least one digit must be before or after the
decimal point, if one is used. At least one digit must follow the decimal point, if one is used. At least one digit must follow the
exponent marker (<literal>e</literal>), if one is present. exponent marker (<literal>e</literal>), if one is present.
There may not be any spaces or other characters embedded in the There cannot be any spaces or other characters embedded in the
constant. Note that any leading plus or minus sign is not actually constant. Note that any leading plus or minus sign is not actually
considered part of the constant; it is an operator applied to the considered part of the constant; it is an operator applied to the
constant. constant.
...@@ -537,7 +537,7 @@ CAST ( '<replaceable>string</replaceable>' AS <replaceable>type</replaceable> ) ...@@ -537,7 +537,7 @@ CAST ( '<replaceable>string</replaceable>' AS <replaceable>type</replaceable> )
The string constant's text is passed to the input conversion The string constant's text is passed to the input conversion
routine for the type called <replaceable>type</replaceable>. The routine for the type called <replaceable>type</replaceable>. The
result is a constant of the indicated type. The explicit type result is a constant of the indicated type. The explicit type
cast may be omitted if there is no ambiguity as to the type the cast can be omitted if there is no ambiguity as to the type the
constant must be (for example, when it is assigned directly to a constant must be (for example, when it is assigned directly to a
table column), in which case it is automatically coerced. table column), in which case it is automatically coerced.
</para> </para>
...@@ -553,7 +553,7 @@ CAST ( '<replaceable>string</replaceable>' AS <replaceable>type</replaceable> ) ...@@ -553,7 +553,7 @@ CAST ( '<replaceable>string</replaceable>' AS <replaceable>type</replaceable> )
<synopsis> <synopsis>
<replaceable>typename</replaceable> ( '<replaceable>string</replaceable>' ) <replaceable>typename</replaceable> ( '<replaceable>string</replaceable>' )
</synopsis> </synopsis>
but not all type names may be used in this way; see <xref but not all type names can be used in this way; see <xref
linkend="sql-syntax-type-casts"> for details. linkend="sql-syntax-type-casts"> for details.
</para> </para>
...@@ -650,7 +650,7 @@ CAST ( '<replaceable>string</replaceable>' AS <replaceable>type</replaceable> ) ...@@ -650,7 +650,7 @@ CAST ( '<replaceable>string</replaceable>' AS <replaceable>type</replaceable> )
A dollar sign (<literal>$</literal>) followed by digits is used A dollar sign (<literal>$</literal>) followed by digits is used
to represent a positional parameter in the body of a function to represent a positional parameter in the body of a function
definition or a prepared statement. In other contexts the definition or a prepared statement. In other contexts the
dollar sign may be part of an identifier or a dollar-quoted string dollar sign can be part of an identifier or a dollar-quoted string
constant. constant.
</para> </para>
</listitem> </listitem>
...@@ -743,7 +743,7 @@ CAST ( '<replaceable>string</replaceable>' AS <replaceable>type</replaceable> ) ...@@ -743,7 +743,7 @@ CAST ( '<replaceable>string</replaceable>' AS <replaceable>type</replaceable> )
where the comment begins with <literal>/*</literal> and extends to where the comment begins with <literal>/*</literal> and extends to
the matching occurrence of <literal>*/</literal>. These block the matching occurrence of <literal>*/</literal>. These block
comments nest, as specified in the SQL standard but unlike C, so that one can comments nest, as specified in the SQL standard but unlike C, so that one can
comment out larger blocks of code that may contain existing block comment out larger blocks of code that might contain existing block
comments. comments.
</para> </para>
...@@ -766,7 +766,7 @@ CAST ( '<replaceable>string</replaceable>' AS <replaceable>type</replaceable> ) ...@@ -766,7 +766,7 @@ CAST ( '<replaceable>string</replaceable>' AS <replaceable>type</replaceable> )
associativity of the operators in <productname>PostgreSQL</>. associativity of the operators in <productname>PostgreSQL</>.
Most operators have the same precedence and are left-associative. Most operators have the same precedence and are left-associative.
The precedence and associativity of the operators is hard-wired The precedence and associativity of the operators is hard-wired
into the parser. This may lead to non-intuitive behavior; for into the parser. This can lead to non-intuitive behavior; for
example the Boolean operators <literal>&lt;</> and example the Boolean operators <literal>&lt;</> and
<literal>&gt;</> have a different precedence than the Boolean <literal>&gt;</> have a different precedence than the Boolean
operators <literal>&lt;=</> and <literal>&gt;=</>. Also, you will operators <literal>&lt;=</> and <literal>&gt;=</>. Also, you will
...@@ -1101,7 +1101,7 @@ SELECT 3 OPERATOR(pg_catalog.+) 4; ...@@ -1101,7 +1101,7 @@ SELECT 3 OPERATOR(pg_catalog.+) 4;
the key words <literal>NEW</literal> or <literal>OLD</literal>. the key words <literal>NEW</literal> or <literal>OLD</literal>.
(<literal>NEW</literal> and <literal>OLD</literal> can only appear in rewrite rules, (<literal>NEW</literal> and <literal>OLD</literal> can only appear in rewrite rules,
while other correlation names can be used in any SQL statement.) while other correlation names can be used in any SQL statement.)
The correlation name and separating dot may be omitted if the column name The correlation name and separating dot can be omitted if the column name
is unique across all the tables being used in the current query. (See also <xref linkend="queries">.) is unique across all the tables being used in the current query. (See also <xref linkend="queries">.)
</para> </para>
</sect2> </sect2>
...@@ -1171,7 +1171,7 @@ CREATE FUNCTION dept(text) RETURNS dept ...@@ -1171,7 +1171,7 @@ CREATE FUNCTION dept(text) RETURNS dept
<para> <para>
In general the array <replaceable>expression</replaceable> must be In general the array <replaceable>expression</replaceable> must be
parenthesized, but the parentheses may be omitted when the expression parenthesized, but the parentheses can be omitted when the expression
to be subscripted is just a column reference or positional parameter. to be subscripted is just a column reference or positional parameter.
Also, multiple subscripts can be concatenated when the original array Also, multiple subscripts can be concatenated when the original array
is multidimensional. is multidimensional.
...@@ -1206,7 +1206,7 @@ $1[10:42] ...@@ -1206,7 +1206,7 @@ $1[10:42]
<para> <para>
In general the row <replaceable>expression</replaceable> must be In general the row <replaceable>expression</replaceable> must be
parenthesized, but the parentheses may be omitted when the expression parenthesized, but the parentheses can be omitted when the expression
to be selected from is just a table reference or positional parameter. to be selected from is just a table reference or positional parameter.
For example, For example,
...@@ -1277,7 +1277,7 @@ sqrt(2) ...@@ -1277,7 +1277,7 @@ sqrt(2)
<para> <para>
The list of built-in functions is in <xref linkend="functions">. The list of built-in functions is in <xref linkend="functions">.
Other functions may be added by the user. Other functions can be added by the user.
</para> </para>
</sect2> </sect2>
...@@ -1334,12 +1334,12 @@ sqrt(2) ...@@ -1334,12 +1334,12 @@ sqrt(2)
<para> <para>
The predefined aggregate functions are described in <xref The predefined aggregate functions are described in <xref
linkend="functions-aggregate">. Other aggregate functions may be added linkend="functions-aggregate">. Other aggregate functions can be added
by the user. by the user.
</para> </para>
<para> <para>
An aggregate expression may only appear in the result list or An aggregate expression can only appear in the result list or
<literal>HAVING</> clause of a <command>SELECT</> command. <literal>HAVING</> clause of a <command>SELECT</> command.
It is forbidden in other clauses, such as <literal>WHERE</>, It is forbidden in other clauses, such as <literal>WHERE</>,
because those clauses are logically evaluated before the results because those clauses are logically evaluated before the results
...@@ -1407,7 +1407,7 @@ CAST ( <replaceable>expression</replaceable> AS <replaceable>type</replaceable> ...@@ -1407,7 +1407,7 @@ CAST ( <replaceable>expression</replaceable> AS <replaceable>type</replaceable>
</para> </para>
<para> <para>
An explicit type cast may usually be omitted if there is no ambiguity as An explicit type cast can usually be omitted if there is no ambiguity as
to the type that a value expression must produce (for example, when it is to the type that a value expression must produce (for example, when it is
assigned to a table column); the system will automatically apply a assigned to a table column); the system will automatically apply a
type cast in such cases. However, automatic casting is only done for type cast in such cases. However, automatic casting is only done for
...@@ -1510,7 +1510,7 @@ SELECT ARRAY[1,2,3+4]; ...@@ -1510,7 +1510,7 @@ SELECT ARRAY[1,2,3+4];
<para> <para>
Multidimensional array values can be built by nesting array Multidimensional array values can be built by nesting array
constructors. constructors.
In the inner constructors, the key word <literal>ARRAY</literal> may In the inner constructors, the key word <literal>ARRAY</literal> can
be omitted. For example, these produce the same result: be omitted. For example, these produce the same result:
<programlisting> <programlisting>
...@@ -1634,7 +1634,7 @@ SELECT ROW(t.f1, t.f2, 42) FROM t; ...@@ -1634,7 +1634,7 @@ SELECT ROW(t.f1, t.f2, 42) FROM t;
By default, the value created by a <literal>ROW</> expression is of By default, the value created by a <literal>ROW</> expression is of
an anonymous record type. If necessary, it can be cast to a named an anonymous record type. If necessary, it can be cast to a named
composite type &mdash; either the row type of a table, or a composite type composite type &mdash; either the row type of a table, or a composite type
created with <command>CREATE TYPE AS</>. An explicit cast may be needed created with <command>CREATE TYPE AS</>. An explicit cast might be needed
to avoid ambiguity. For example: to avoid ambiguity. For example:
<programlisting> <programlisting>
CREATE TABLE mytable(f1 int, f2 float, f3 text); CREATE TABLE mytable(f1 int, f2 float, f3 text);
...@@ -1725,13 +1725,13 @@ SELECT somefunc() OR true; ...@@ -1725,13 +1725,13 @@ SELECT somefunc() OR true;
rely on side effects or evaluation order in <literal>WHERE</> and <literal>HAVING</> clauses, rely on side effects or evaluation order in <literal>WHERE</> and <literal>HAVING</> clauses,
since those clauses are extensively reprocessed as part of since those clauses are extensively reprocessed as part of
developing an execution plan. Boolean developing an execution plan. Boolean
expressions (<literal>AND</>/<literal>OR</>/<literal>NOT</> combinations) in those clauses may be reorganized expressions (<literal>AND</>/<literal>OR</>/<literal>NOT</> combinations) in those clauses can be reorganized
in any manner allowed by the laws of Boolean algebra. in any manner allowed by the laws of Boolean algebra.
</para> </para>
<para> <para>
When it is essential to force evaluation order, a <literal>CASE</> When it is essential to force evaluation order, a <literal>CASE</>
construct (see <xref linkend="functions-conditional">) may be construct (see <xref linkend="functions-conditional">) can be
used. For example, this is an untrustworthy way of trying to used. For example, this is an untrustworthy way of trying to
avoid division by zero in a <literal>WHERE</> clause: avoid division by zero in a <literal>WHERE</> clause:
<programlisting> <programlisting>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/trigger.sgml,v 1.47 2006/09/16 00:30:16 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/trigger.sgml,v 1.48 2007/01/31 20:56:19 momjian Exp $ -->
<chapter id="triggers"> <chapter id="triggers">
<title>Triggers</title> <title>Triggers</title>
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
<para> <para>
The return value is ignored for row-level triggers fired after an The return value is ignored for row-level triggers fired after an
operation, and so they may as well return <symbol>NULL</>. operation, and so they can return <symbol>NULL</>.
</para> </para>
<para> <para>
...@@ -152,7 +152,7 @@ ...@@ -152,7 +152,7 @@
<para> <para>
If a trigger function executes SQL commands then these If a trigger function executes SQL commands then these
commands may fire triggers again. This is known as cascading commands might fire triggers again. This is known as cascading
triggers. There is no direct limitation on the number of cascade triggers. There is no direct limitation on the number of cascade
levels. It is possible for cascades to cause a recursive invocation levels. It is possible for cascades to cause a recursive invocation
of the same trigger; for example, an <command>INSERT</command> of the same trigger; for example, an <command>INSERT</command>
...@@ -233,7 +233,7 @@ ...@@ -233,7 +233,7 @@
changes for rows previously processed in the same outer changes for rows previously processed in the same outer
command. This requires caution, since the ordering of these command. This requires caution, since the ordering of these
change events is not in general predictable; a SQL command that change events is not in general predictable; a SQL command that
affects multiple rows may visit the rows in any order. affects multiple rows can visit the rows in any order.
</para> </para>
</listitem> </listitem>
...@@ -332,7 +332,7 @@ typedef struct TriggerData ...@@ -332,7 +332,7 @@ typedef struct TriggerData
<term><structfield>tg_event</></term> <term><structfield>tg_event</></term>
<listitem> <listitem>
<para> <para>
Describes the event for which the function is called. You may use the Describes the event for which the function is called. You can use the
following macros to examine <literal>tg_event</literal>: following macros to examine <literal>tg_event</literal>:
<variablelist> <variablelist>
...@@ -524,7 +524,7 @@ typedef struct Trigger ...@@ -524,7 +524,7 @@ typedef struct Trigger
<para> <para>
Here is a very simple example of a trigger function written in C. Here is a very simple example of a trigger function written in C.
(Examples of triggers written in procedural languages may be found (Examples of triggers written in procedural languages can be found
in the documentation of the procedural languages.) in the documentation of the procedural languages.)
</para> </para>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/typeconv.sgml,v 1.48 2006/09/18 19:54:01 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/typeconv.sgml,v 1.49 2007/01/31 20:56:19 momjian Exp $ -->
<chapter Id="typeconv"> <chapter Id="typeconv">
<title>Type Conversion</title> <title>Type Conversion</title>
...@@ -447,7 +447,7 @@ try a similar case with <literal>~</>, we get: ...@@ -447,7 +447,7 @@ try a similar case with <literal>~</>, we get:
SELECT ~ '20' AS "negation"; SELECT ~ '20' AS "negation";
ERROR: operator is not unique: ~ "unknown" ERROR: operator is not unique: ~ "unknown"
HINT: Could not choose a best candidate operator. You may need to add explicit HINT: Could not choose a best candidate operator. You might need to add explicit
type casts. type casts.
</screen> </screen>
This happens because the system can't decide which of the several This happens because the system can't decide which of the several
...@@ -619,7 +619,7 @@ SELECT round(CAST (4 AS numeric), 4); ...@@ -619,7 +619,7 @@ SELECT round(CAST (4 AS numeric), 4);
<para> <para>
Since numeric constants with decimal points are initially assigned the Since numeric constants with decimal points are initially assigned the
type <type>numeric</type>, the following query will require no type type <type>numeric</type>, the following query will require no type
conversion and may therefore be slightly more efficient: conversion and might therefore be slightly more efficient:
<screen> <screen>
SELECT round(4.0, 4); SELECT round(4.0, 4);
</screen> </screen>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/user-manag.sgml,v 1.37 2006/09/05 21:08:34 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/user-manag.sgml,v 1.38 2007/01/31 20:56:19 momjian Exp $ -->
<chapter id="user-manag"> <chapter id="user-manag">
<title>Database Roles and Privileges</title> <title>Database Roles and Privileges</title>
...@@ -126,7 +126,7 @@ SELECT rolname FROM pg_roles; ...@@ -126,7 +126,7 @@ SELECT rolname FROM pg_roles;
</para> </para>
<para> <para>
The set of database roles a given client connection may connect as The set of database roles a given client connection can connect as
is determined by the client authentication setup, as explained in is determined by the client authentication setup, as explained in
<xref linkend="client-authentication">. (Thus, a client is not <xref linkend="client-authentication">. (Thus, a client is not
necessarily limited to connect as the role with the same name as necessarily limited to connect as the role with the same name as
...@@ -142,7 +142,7 @@ SELECT rolname FROM pg_roles; ...@@ -142,7 +142,7 @@ SELECT rolname FROM pg_roles;
<title>Role Attributes</title> <title>Role Attributes</title>
<para> <para>
A database role may have a number of attributes that define its A database role can have a number of attributes that define its
privileges and interact with the client authentication system. privileges and interact with the client authentication system.
<variablelist> <variablelist>
...@@ -482,7 +482,7 @@ DROP ROLE <replaceable>name</replaceable>; ...@@ -482,7 +482,7 @@ DROP ROLE <replaceable>name</replaceable>;
<para> <para>
Functions and triggers allow users to insert code into the backend Functions and triggers allow users to insert code into the backend
server that other users may execute unintentionally. Hence, both server that other users might execute unintentionally. Hence, both
mechanisms permit users to <quote>Trojan horse</quote> mechanisms permit users to <quote>Trojan horse</quote>
others with relative ease. The only real protection is tight others with relative ease. The only real protection is tight
control over who can define functions. control over who can define functions.
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/wal.sgml,v 1.42 2006/11/25 22:44:48 petere Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/wal.sgml,v 1.43 2007/01/31 20:56:19 momjian Exp $ -->
<chapter id="wal"> <chapter id="wal">
<title>Reliability and the Write-Ahead Log</title> <title>Reliability and the Write-Ahead Log</title>
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
</para> </para>
<para> <para>
Next, there may be a cache in the disk drive controller; this is Next, there might be a cache in the disk drive controller; this is
particularly common on <acronym>RAID</> controller cards. Some of particularly common on <acronym>RAID</> controller cards. Some of
these caches are <firstterm>write-through</>, meaning writes are passed these caches are <firstterm>write-through</>, meaning writes are passed
along to the drive as soon as they arrive. Others are along to the drive as soon as they arrive. Others are
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
<para> <para>
<firstterm>Write-Ahead Logging</firstterm> (<acronym>WAL</acronym>) <firstterm>Write-Ahead Logging</firstterm> (<acronym>WAL</acronym>)
is a standard approach to transaction logging. Its detailed is a standard approach to transaction logging. Its detailed
description may be found in most (if not all) books about description can be found in most (if not all) books about
transaction processing. Briefly, <acronym>WAL</acronym>'s central transaction processing. Briefly, <acronym>WAL</acronym>'s central
concept is that changes to data files (where tables and indexes concept is that changes to data files (where tables and indexes
reside) must be written only after those changes have been logged, reside) must be written only after those changes have been logged,
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
file needs to be flushed to disk at the time of transaction file needs to be flushed to disk at the time of transaction
commit, rather than every data file changed by the transaction. commit, rather than every data file changed by the transaction.
In multiuser environments, commits of many transactions In multiuser environments, commits of many transactions
may be accomplished with a single <function>fsync</function> of can be accomplished with a single <function>fsync</function> of
the log file. Furthermore, the log file is written sequentially, the log file. Furthermore, the log file is written sequentially,
and so the cost of syncing the log is much less than the cost of and so the cost of syncing the log is much less than the cost of
flushing the data pages. This is especially true for servers flushing the data pages. This is especially true for servers
...@@ -211,7 +211,7 @@ ...@@ -211,7 +211,7 @@
<varname>checkpoint_segments</varname>. Occasional appearance of such <varname>checkpoint_segments</varname>. Occasional appearance of such
a message is not cause for alarm, but if it appears often then the a message is not cause for alarm, but if it appears often then the
checkpoint control parameters should be increased. Bulk operations such checkpoint control parameters should be increased. Bulk operations such
as large <command>COPY</> transfers may cause a number of such warnings as large <command>COPY</> transfers might cause a number of such warnings
to appear if you have not set <varname>checkpoint_segments</> high to appear if you have not set <varname>checkpoint_segments</> high
enough. enough.
</para> </para>
...@@ -241,13 +241,13 @@ ...@@ -241,13 +241,13 @@
is used on every database low level modification (for example, row is used on every database low level modification (for example, row
insertion) at a time when an exclusive lock is held on affected insertion) at a time when an exclusive lock is held on affected
data pages, so the operation needs to be as fast as possible. What data pages, so the operation needs to be as fast as possible. What
is worse, writing <acronym>WAL</acronym> buffers may also force the is worse, writing <acronym>WAL</acronym> buffers might also force the
creation of a new log segment, which takes even more creation of a new log segment, which takes even more
time. Normally, <acronym>WAL</acronym> buffers should be written time. Normally, <acronym>WAL</acronym> buffers should be written
and flushed by a <function>LogFlush</function> request, which is and flushed by a <function>LogFlush</function> request, which is
made, for the most part, at transaction commit time to ensure that made, for the most part, at transaction commit time to ensure that
transaction records are flushed to permanent storage. On systems transaction records are flushed to permanent storage. On systems
with high log output, <function>LogFlush</function> requests may with high log output, <function>LogFlush</function> requests might
not occur often enough to prevent <function>LogInsert</function> not occur often enough to prevent <function>LogInsert</function>
from having to do writes. On such systems from having to do writes. On such systems
one should increase the number of <acronym>WAL</acronym> buffers by one should increase the number of <acronym>WAL</acronym> buffers by
...@@ -294,7 +294,7 @@ ...@@ -294,7 +294,7 @@
compiled with support for it) will result in each compiled with support for it) will result in each
<function>LogInsert</function> and <function>LogFlush</function> <function>LogInsert</function> and <function>LogFlush</function>
<acronym>WAL</acronym> call being logged to the server log. This <acronym>WAL</acronym> call being logged to the server log. This
option may be replaced by a more general mechanism in the future. option might be replaced by a more general mechanism in the future.
</para> </para>
</sect1> </sect1>
...@@ -324,7 +324,7 @@ ...@@ -324,7 +324,7 @@
<para> <para>
It is of advantage if the log is located on another disk than the It is of advantage if the log is located on another disk than the
main database files. This may be achieved by moving the directory main database files. This can be achieved by moving the directory
<filename>pg_xlog</filename> to another location (while the server <filename>pg_xlog</filename> to another location (while the server
is shut down, of course) and creating a symbolic link from the is shut down, of course) and creating a symbolic link from the
original location in the main data directory to the new location. original location in the main data directory to the new location.
...@@ -332,11 +332,11 @@ ...@@ -332,11 +332,11 @@
<para> <para>
The aim of <acronym>WAL</acronym>, to ensure that the log is The aim of <acronym>WAL</acronym>, to ensure that the log is
written before database records are altered, may be subverted by written before database records are altered, can be subverted by
disk drives<indexterm><primary>disk drive</></> that falsely report a disk drives<indexterm><primary>disk drive</></> that falsely report a
successful write to the kernel, successful write to the kernel,
when in fact they have only cached the data and not yet stored it when in fact they have only cached the data and not yet stored it
on the disk. A power failure in such a situation may still lead to on the disk. A power failure in such a situation might still lead to
irrecoverable data corruption. Administrators should try to ensure irrecoverable data corruption. Administrators should try to ensure
that disks holding <productname>PostgreSQL</productname>'s that disks holding <productname>PostgreSQL</productname>'s
<acronym>WAL</acronym> log files do not make such false reports. <acronym>WAL</acronym> log files do not make such false reports.
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/xaggr.sgml,v 1.33 2006/09/16 00:30:16 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/xaggr.sgml,v 1.34 2007/01/31 20:56:20 momjian Exp $ -->
<sect1 id="xaggr"> <sect1 id="xaggr">
<title>User-Defined Aggregates</title> <title>User-Defined Aggregates</title>
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<para> <para>
Thus, in addition to the argument and result data types seen by a user Thus, in addition to the argument and result data types seen by a user
of the aggregate, there is an internal state-value data type that of the aggregate, there is an internal state-value data type that
may be different from both the argument and result types. might be different from both the argument and result types.
</para> </para>
<para> <para>
...@@ -112,12 +112,12 @@ CREATE AGGREGATE avg (float8) ...@@ -112,12 +112,12 @@ CREATE AGGREGATE avg (float8)
</para> </para>
<para> <para>
Aggregate functions may use polymorphic Aggregate functions can use polymorphic
state transition functions or final functions, so that the same functions state transition functions or final functions, so that the same functions
can be used to implement multiple aggregates. can be used to implement multiple aggregates.
See <xref linkend="extend-types-polymorphic"> See <xref linkend="extend-types-polymorphic">
for an explanation of polymorphic functions. for an explanation of polymorphic functions.
Going a step further, the aggregate function itself may be specified Going a step further, the aggregate function itself can be specified
with polymorphic input type(s) and state type, allowing a single with polymorphic input type(s) and state type, allowing a single
aggregate definition to serve for multiple input data types. aggregate definition to serve for multiple input data types.
Here is an example of a polymorphic aggregate: Here is an example of a polymorphic aggregate:
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/xfunc.sgml,v 1.122 2007/01/30 22:29:23 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/xfunc.sgml,v 1.123 2007/01/31 20:56:20 momjian Exp $ -->
<sect1 id="xfunc"> <sect1 id="xfunc">
<title>User-Defined Functions</title> <title>User-Defined Functions</title>
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
of function can take base types, composite types, or of function can take base types, composite types, or
combinations of these as arguments (parameters). In addition, combinations of these as arguments (parameters). In addition,
every kind of function can return a base type or every kind of function can return a base type or
a composite type. Functions may also be defined to return a composite type. Functions can also be defined to return
sets of base or composite values. sets of base or composite values.
</para> </para>
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
<para> <para>
<indexterm><primary>SETOF</><seealso>function</></> Alternatively, <indexterm><primary>SETOF</><seealso>function</></> Alternatively,
an SQL function may be declared to return a set, by specifying the an SQL function can be declared to return a set, by specifying the
function's return type as <literal>SETOF function's return type as <literal>SETOF
<replaceable>sometype</></literal>. In this case all rows of the <replaceable>sometype</></literal>. In this case all rows of the
last query's result are returned. Further details appear below. last query's result are returned. Further details appear below.
...@@ -157,7 +157,7 @@ SELECT clean_emp(); ...@@ -157,7 +157,7 @@ SELECT clean_emp();
body using the syntax <literal>$<replaceable>n</></>: <literal>$1</> body using the syntax <literal>$<replaceable>n</></>: <literal>$1</>
refers to the first argument, <literal>$2</> to the second, and so on. refers to the first argument, <literal>$2</> to the second, and so on.
If an argument is of a composite type, then the dot notation, If an argument is of a composite type, then the dot notation,
e.g., <literal>$1.name</literal>, may be used to access attributes e.g., <literal>$1.name</literal>, can be used to access attributes
of the argument. The arguments can only be used as data values, of the argument. The arguments can only be used as data values,
not as identifiers. Thus for example this is reasonable: not as identifiers. Thus for example this is reasonable:
<programlisting> <programlisting>
...@@ -588,7 +588,7 @@ DROP FUNCTION sum_n_product (int, int); ...@@ -588,7 +588,7 @@ DROP FUNCTION sum_n_product (int, int);
<title><acronym>SQL</acronym> Functions as Table Sources</title> <title><acronym>SQL</acronym> Functions as Table Sources</title>
<para> <para>
All SQL functions may be used in the <literal>FROM</> clause of a query, All SQL functions can be used in the <literal>FROM</> clause of a query,
but it is particularly useful for functions returning composite types. but it is particularly useful for functions returning composite types.
If the function is defined to return a base type, the table function If the function is defined to return a base type, the table function
produces a one-column table. If the function is defined to return produces a one-column table. If the function is defined to return
...@@ -662,11 +662,11 @@ SELECT * FROM getfoo(1) AS t1; ...@@ -662,11 +662,11 @@ SELECT * FROM getfoo(1) AS t1;
</para> </para>
<para> <para>
Currently, functions returning sets may also be called in the select list Currently, functions returning sets can also be called in the select list
of a query. For each row that the query of a query. For each row that the query
generates by itself, the function returning set is invoked, and an output generates by itself, the function returning set is invoked, and an output
row is generated for each element of the function's result set. Note, row is generated for each element of the function's result set. Note,
however, that this capability is deprecated and may be removed in future however, that this capability is deprecated and might be removed in future
releases. The following is an example function returning a set from the releases. The following is an example function returning a set from the
select list: select list:
...@@ -716,7 +716,7 @@ SELECT name, listchildren(name) FROM nodes; ...@@ -716,7 +716,7 @@ SELECT name, listchildren(name) FROM nodes;
<title>Polymorphic <acronym>SQL</acronym> Functions</title> <title>Polymorphic <acronym>SQL</acronym> Functions</title>
<para> <para>
<acronym>SQL</acronym> functions may be declared to accept and <acronym>SQL</acronym> functions can be declared to accept and
return the polymorphic types <type>anyelement</type> and return the polymorphic types <type>anyelement</type> and
<type>anyarray</type>. See <xref <type>anyarray</type>. See <xref
linkend="extend-types-polymorphic"> for a more detailed linkend="extend-types-polymorphic"> for a more detailed
...@@ -799,7 +799,7 @@ SELECT * FROM dup(22); ...@@ -799,7 +799,7 @@ SELECT * FROM dup(22);
</indexterm> </indexterm>
<para> <para>
More than one function may be defined with the same SQL name, so long More than one function can be defined with the same SQL name, so long
as the arguments they take are different. In other words, as the arguments they take are different. In other words,
function names can be <firstterm>overloaded</firstterm>. When a function names can be <firstterm>overloaded</firstterm>. When a
query is executed, the server will determine which function to query is executed, the server will determine which function to
...@@ -941,7 +941,7 @@ CREATE FUNCTION test(int, int) RETURNS int ...@@ -941,7 +941,7 @@ CREATE FUNCTION test(int, int) RETURNS int
a lot whether a function is executed once during planning or once during a lot whether a function is executed once during planning or once during
query execution startup. But there is a big difference if the plan is query execution startup. But there is a big difference if the plan is
saved and reused later. Labeling a function <literal>IMMUTABLE</> when saved and reused later. Labeling a function <literal>IMMUTABLE</> when
it really isn't may allow it to be prematurely folded to a constant during it really isn't might allow it to be prematurely folded to a constant during
planning, resulting in a stale value being re-used during subsequent uses planning, resulting in a stale value being re-used during subsequent uses
of the plan. This is a hazard when using prepared statements or when of the plan. This is a hazard when using prepared statements or when
using function languages that cache plans (such as using function languages that cache plans (such as
...@@ -1310,7 +1310,7 @@ typedef int int4; ...@@ -1310,7 +1310,7 @@ typedef int int4;
</para> </para>
<para> <para>
On the other hand, fixed-length types of any size may On the other hand, fixed-length types of any size can
be passed by-reference. For example, here is a sample be passed by-reference. For example, here is a sample
implementation of a <productname>PostgreSQL</productname> type: implementation of a <productname>PostgreSQL</productname> type:
...@@ -1347,7 +1347,7 @@ typedef struct ...@@ -1347,7 +1347,7 @@ typedef struct
<para> <para>
<emphasis>Never</> modify the contents of a pass-by-reference input <emphasis>Never</> modify the contents of a pass-by-reference input
value. If you do so you are likely to corrupt on-disk data, since value. If you do so you are likely to corrupt on-disk data, since
the pointer you are given may well point directly into a disk buffer. the pointer you are given might point directly into a disk buffer.
The sole exception to this rule is explained in The sole exception to this rule is explained in
<xref linkend="xaggr">. <xref linkend="xaggr">.
</para> </para>
...@@ -1402,7 +1402,7 @@ memcpy(destination-&gt;data, buffer, 40); ...@@ -1402,7 +1402,7 @@ memcpy(destination-&gt;data, buffer, 40);
that uses a built-in type of <productname>PostgreSQL</>. that uses a built-in type of <productname>PostgreSQL</>.
The <quote>Defined In</quote> column gives the header file that The <quote>Defined In</quote> column gives the header file that
needs to be included to get the type definition. (The actual needs to be included to get the type definition. (The actual
definition may be in a different file that is included by the definition might be in a different file that is included by the
listed file. It is recommended that users stick to the defined listed file. It is recommended that users stick to the defined
interface.) Note that you should always include interface.) Note that you should always include
<filename>postgres.h</filename> first in any source file, because <filename>postgres.h</filename> first in any source file, because
...@@ -1708,7 +1708,7 @@ CREATE FUNCTION concat_text(text, text) RETURNS text ...@@ -1708,7 +1708,7 @@ CREATE FUNCTION concat_text(text, text) RETURNS text
(Better style would be to use just <literal>'funcs'</> in the (Better style would be to use just <literal>'funcs'</> in the
<literal>AS</> clause, after having added <literal>AS</> clause, after having added
<replaceable>DIRECTORY</replaceable> to the search path. In any <replaceable>DIRECTORY</replaceable> to the search path. In any
case, we may omit the system-specific extension for a shared case, we can omit the system-specific extension for a shared
library, commonly <literal>.so</literal> or library, commonly <literal>.so</literal> or
<literal>.sl</literal>.) <literal>.sl</literal>.)
</para> </para>
...@@ -1866,7 +1866,7 @@ concat_text(PG_FUNCTION_ARGS) ...@@ -1866,7 +1866,7 @@ concat_text(PG_FUNCTION_ARGS)
</para> </para>
<para> <para>
At first glance, the version-1 coding conventions may appear to At first glance, the version-1 coding conventions might appear to
be just pointless obscurantism. They do, however, offer a number be just pointless obscurantism. They do, however, offer a number
of improvements, because the macros can hide unnecessary detail. of improvements, because the macros can hide unnecessary detail.
An example is that in coding <function>add_one_float8</>, we no longer need to An example is that in coding <function>add_one_float8</>, we no longer need to
...@@ -1938,7 +1938,7 @@ concat_text(PG_FUNCTION_ARGS) ...@@ -1938,7 +1938,7 @@ concat_text(PG_FUNCTION_ARGS)
<para> <para>
Before we turn to the more advanced topics, we should discuss Before we turn to the more advanced topics, we should discuss
some coding rules for <productname>PostgreSQL</productname> some coding rules for <productname>PostgreSQL</productname>
C-language functions. While it may be possible to load functions C-language functions. While it might be possible to load functions
written in languages other than C into written in languages other than C into
<productname>PostgreSQL</productname>, this is usually difficult <productname>PostgreSQL</productname>, this is usually difficult
(when it is possible at all) because other languages, such as (when it is possible at all) because other languages, such as
...@@ -1999,8 +1999,8 @@ concat_text(PG_FUNCTION_ARGS) ...@@ -1999,8 +1999,8 @@ concat_text(PG_FUNCTION_ARGS)
<function>memset</function>. Without this, it's difficult to <function>memset</function>. Without this, it's difficult to
support hash indexes or hash joins, as you must pick out only support hash indexes or hash joins, as you must pick out only
the significant bits of your data structure to compute a hash. the significant bits of your data structure to compute a hash.
Even if you initialize all fields of your structure, there may be Even if you initialize all fields of your structure, there might be
alignment padding (holes in the structure) that may contain alignment padding (holes in the structure) that contain
garbage values. garbage values.
</para> </para>
</listitem> </listitem>
...@@ -2265,9 +2265,9 @@ include $(PGXS) ...@@ -2265,9 +2265,9 @@ include $(PGXS)
<para> <para>
Composite types do not have a fixed layout like C structures. Composite types do not have a fixed layout like C structures.
Instances of a composite type may contain null fields. In Instances of a composite type can contain null fields. In
addition, composite types that are part of an inheritance addition, composite types that are part of an inheritance
hierarchy may have different fields than other members of the hierarchy can have different fields than other members of the
same inheritance hierarchy. Therefore, same inheritance hierarchy. Therefore,
<productname>PostgreSQL</productname> provides a function <productname>PostgreSQL</productname> provides a function
interface for accessing fields of composite types from C. interface for accessing fields of composite types from C.
...@@ -2829,7 +2829,7 @@ CREATE OR REPLACE FUNCTION retcomposite(IN integer, IN integer, ...@@ -2829,7 +2829,7 @@ CREATE OR REPLACE FUNCTION retcomposite(IN integer, IN integer,
<title>Polymorphic Arguments and Return Types</title> <title>Polymorphic Arguments and Return Types</title>
<para> <para>
C-language functions may be declared to accept and C-language functions can be declared to accept and
return the polymorphic types return the polymorphic types
<type>anyelement</type> and <type>anyarray</type>. <type>anyelement</type> and <type>anyarray</type>.
See <xref linkend="extend-types-polymorphic"> for a more detailed explanation See <xref linkend="extend-types-polymorphic"> for a more detailed explanation
...@@ -2913,7 +2913,7 @@ CREATE FUNCTION make_array(anyelement) RETURNS anyarray ...@@ -2913,7 +2913,7 @@ CREATE FUNCTION make_array(anyelement) RETURNS anyarray
<title>Shared Memory and LWLocks</title> <title>Shared Memory and LWLocks</title>
<para> <para>
Add-ins may reserve LWLocks and an allocation of shared memory on server Add-ins can reserve LWLocks and an allocation of shared memory on server
startup. The add-in's shared library must be preloaded by specifying startup. The add-in's shared library must be preloaded by specifying
it in it in
<xref linkend="guc-shared-preload-libraries"><indexterm><primary>shared-preload-libraries</></>. <xref linkend="guc-shared-preload-libraries"><indexterm><primary>shared-preload-libraries</></>.
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/xindex.sgml,v 1.56 2007/01/23 20:45:28 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/xindex.sgml,v 1.57 2007/01/31 20:56:20 momjian Exp $ -->
<sect1 id="xindex"> <sect1 id="xindex">
<title>Interfacing Extensions To Indexes</title> <title>Interfacing Extensions To Indexes</title>
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
called because one thing they specify is the set of called because one thing they specify is the set of
<literal>WHERE</>-clause operators that can be used with an index <literal>WHERE</>-clause operators that can be used with an index
(i.e., can be converted into an index-scan qualification). An (i.e., can be converted into an index-scan qualification). An
operator class may also specify some <firstterm>support operator class can also specify some <firstterm>support
procedures</> that are needed by the internal operations of the procedures</> that are needed by the internal operations of the
index method, but do not directly correspond to any index method, but do not directly correspond to any
<literal>WHERE</>-clause operator that can be used with the index. <literal>WHERE</>-clause operator that can be used with the index.
...@@ -663,7 +663,7 @@ CREATE OPERATOR CLASS complex_abs_ops ...@@ -663,7 +663,7 @@ CREATE OPERATOR CLASS complex_abs_ops
To handle these needs, <productname>PostgreSQL</productname> To handle these needs, <productname>PostgreSQL</productname>
uses the concept of an <firstterm>operator uses the concept of an <firstterm>operator
family</><indexterm><primary>operator family</></indexterm>. family</><indexterm><primary>operator family</></indexterm>.
An operator family contains one or more operator classes, and may also An operator family contains one or more operator classes, and can also
contain indexable operators and corresponding support functions that contain indexable operators and corresponding support functions that
belong to the family as a whole but not to any single class within the belong to the family as a whole but not to any single class within the
family. We say that such operators and functions are <quote>loose</> family. We say that such operators and functions are <quote>loose</>
...@@ -923,7 +923,7 @@ SELECT * FROM table WHERE integer_column &lt; 4; ...@@ -923,7 +923,7 @@ SELECT * FROM table WHERE integer_column &lt; 4;
Consider again the situation where we are storing in the index only Consider again the situation where we are storing in the index only
the bounding box of a complex object such as a polygon. In this the bounding box of a complex object such as a polygon. In this
case there's not much value in storing the whole polygon in the index case there's not much value in storing the whole polygon in the index
entry &mdash; we may as well store just a simpler object of type entry &mdash; we might as well store just a simpler object of type
<type>box</>. This situation is expressed by the <literal>STORAGE</> <type>box</>. This situation is expressed by the <literal>STORAGE</>
option in <command>CREATE OPERATOR CLASS</>: we'd write something like option in <command>CREATE OPERATOR CLASS</>: we'd write something like
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/xoper.sgml,v 1.38 2007/01/20 20:45:38 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/xoper.sgml,v 1.39 2007/01/31 20:56:20 momjian Exp $ -->
<sect1 id="xoper"> <sect1 id="xoper">
<title>User-Defined Operators</title> <title>User-Defined Operators</title>
...@@ -230,7 +230,7 @@ column OP constant ...@@ -230,7 +230,7 @@ column OP constant
This assists the optimizer by This assists the optimizer by
giving it some idea of how many rows will be eliminated by <literal>WHERE</> giving it some idea of how many rows will be eliminated by <literal>WHERE</>
clauses that have this form. (What happens if the constant is on clauses that have this form. (What happens if the constant is on
the left, you may be wondering? Well, that's one of the things that the left, you might be wondering? Well, that's one of the things that
<literal>COMMUTATOR</> is for...) <literal>COMMUTATOR</> is for...)
</para> </para>
...@@ -280,7 +280,7 @@ column OP constant ...@@ -280,7 +280,7 @@ column OP constant
<para> <para>
There are additional selectivity estimation functions designed for geometric There are additional selectivity estimation functions designed for geometric
operators in <filename>src/backend/utils/adt/geo_selfuncs.c</filename>: <function>areasel</function>, <function>positionsel</function>, operators in <filename>src/backend/utils/adt/geo_selfuncs.c</filename>: <function>areasel</function>, <function>positionsel</function>,
and <function>contsel</function>. At this writing these are just stubs, but you may want and <function>contsel</function>. At this writing these are just stubs, but you might want
to use them (or even better, improve them) anyway. to use them (or even better, improve them) anyway.
</para> </para>
</sect2> </sect2>
...@@ -354,7 +354,7 @@ table1.column1 OP table2.column2 ...@@ -354,7 +354,7 @@ table1.column1 OP table2.column2
<para> <para>
Care should be exercised when preparing a hash function, because there Care should be exercised when preparing a hash function, because there
are machine-dependent ways in which it might fail to do the right thing. are machine-dependent ways in which it might fail to do the right thing.
For example, if your data type is a structure in which there may be For example, if your data type is a structure in which there might be
uninteresting pad bits, you can't simply pass the whole structure to uninteresting pad bits, you can't simply pass the whole structure to
<function>hash_any</>. (Unless you write your other operators and <function>hash_any</>. (Unless you write your other operators and
functions to ensure that the unused bits are always zero, which is the functions to ensure that the unused bits are always zero, which is the
...@@ -380,7 +380,7 @@ table1.column1 OP table2.column2 ...@@ -380,7 +380,7 @@ table1.column1 OP table2.column2
strict, the strict, the
function must also be complete: that is, it should return true or function must also be complete: that is, it should return true or
false, never null, for any two nonnull inputs. If this rule is false, never null, for any two nonnull inputs. If this rule is
not followed, hash-optimization of <literal>IN</> operations may not followed, hash-optimization of <literal>IN</> operations might
generate wrong results. (Specifically, <literal>IN</> might return generate wrong results. (Specifically, <literal>IN</> might return
false where the correct answer according to the standard would be null; false where the correct answer according to the standard would be null;
or it might yield an error complaining that it wasn't prepared for a or it might yield an error complaining that it wasn't prepared for a
...@@ -431,7 +431,7 @@ table1.column1 OP table2.column2 ...@@ -431,7 +431,7 @@ table1.column1 OP table2.column2
A merge-joinable operator must have a commutator (itself if the two A merge-joinable operator must have a commutator (itself if the two
operand data types are the same, or a related equality operator operand data types are the same, or a related equality operator
if they are different) that appears in the same operator family. if they are different) that appears in the same operator family.
If this is not the case, planner errors may occur when the operator If this is not the case, planner errors might occur when the operator
is used. Also, it is a good idea (but not strictly required) for is used. Also, it is a good idea (but not strictly required) for
a btree operator family that supports multiple datatypes to provide a btree operator family that supports multiple datatypes to provide
equality operators for every combination of the datatypes; this equality operators for every combination of the datatypes; this
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/xplang.sgml,v 1.32 2006/11/20 17:42:16 neilc Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/xplang.sgml,v 1.33 2007/01/31 20:56:20 momjian Exp $ -->
<chapter id="xplang"> <chapter id="xplang">
<title id="xplang-title">Procedural Languages</title> <title id="xplang-title">Procedural Languages</title>
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
only necessary to execute <command>CREATE LANGUAGE</> only necessary to execute <command>CREATE LANGUAGE</>
<replaceable>language_name</> to install the language into the <replaceable>language_name</> to install the language into the
current database. Alternatively, the program <xref current database. Alternatively, the program <xref
linkend="app-createlang"> may be used to do this from the shell linkend="app-createlang"> can be used to do this from the shell
command line. For example, to install the language command line. For example, to install the language
<application>PL/pgSQL</application> into the database <application>PL/pgSQL</application> into the database
<literal>template1</>, use <literal>template1</>, use
...@@ -111,7 +111,7 @@ CREATE FUNCTION <replaceable>handler_function_name</replaceable>() ...@@ -111,7 +111,7 @@ CREATE FUNCTION <replaceable>handler_function_name</replaceable>()
<step performance="optional" id="xplang-install-cr3"> <step performance="optional" id="xplang-install-cr3">
<para> <para>
Optionally, the language handler may provide a <quote>validator</> Optionally, the language handler can provide a <quote>validator</>
function that checks a function definition for correctness without function that checks a function definition for correctness without
actually executing it. The validator function is called by actually executing it. The validator function is called by
<command>CREATE FUNCTION</> if it exists. If a validator function <command>CREATE FUNCTION</> if it exists. If a validator function
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/parse_func.c,v 1.191 2007/01/05 22:19:34 momjian Exp $ * $PostgreSQL: pgsql/src/backend/parser/parse_func.c,v 1.192 2007/01/31 20:56:20 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -213,7 +213,7 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs, ...@@ -213,7 +213,7 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs,
func_signature_string(funcname, nargs, func_signature_string(funcname, nargs,
actual_arg_types)), actual_arg_types)),
errhint("Could not choose a best candidate function. " errhint("Could not choose a best candidate function. "
"You may need to add explicit type casts."), "You might need to add explicit type casts."),
parser_errposition(pstate, location))); parser_errposition(pstate, location)));
else else
ereport(ERROR, ereport(ERROR,
...@@ -222,7 +222,7 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs, ...@@ -222,7 +222,7 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs,
func_signature_string(funcname, nargs, func_signature_string(funcname, nargs,
actual_arg_types)), actual_arg_types)),
errhint("No function matches the given name and argument types. " errhint("No function matches the given name and argument types. "
"You may need to add explicit type casts."), "You might need to add explicit type casts."),
parser_errposition(pstate, location))); parser_errposition(pstate, location)));
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/parse_oper.c,v 1.91 2007/01/05 22:19:34 momjian Exp $ * $PostgreSQL: pgsql/src/backend/parser/parse_oper.c,v 1.92 2007/01/31 20:56:20 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -771,7 +771,7 @@ op_error(ParseState *pstate, List *op, char oprkind, ...@@ -771,7 +771,7 @@ op_error(ParseState *pstate, List *op, char oprkind,
errmsg("operator is not unique: %s", errmsg("operator is not unique: %s",
op_signature_string(op, oprkind, arg1, arg2)), op_signature_string(op, oprkind, arg1, arg2)),
errhint("Could not choose a best candidate operator. " errhint("Could not choose a best candidate operator. "
"You may need to add explicit type casts."), "You might need to add explicit type casts."),
parser_errposition(pstate, location))); parser_errposition(pstate, location)));
else else
ereport(ERROR, ereport(ERROR,
...@@ -779,7 +779,7 @@ op_error(ParseState *pstate, List *op, char oprkind, ...@@ -779,7 +779,7 @@ op_error(ParseState *pstate, List *op, char oprkind,
errmsg("operator does not exist: %s", errmsg("operator does not exist: %s",
op_signature_string(op, oprkind, arg1, arg2)), op_signature_string(op, oprkind, arg1, arg2)),
errhint("No operator matches the given name and argument type(s). " errhint("No operator matches the given name and argument type(s). "
"You may need to add explicit type casts."), "You might need to add explicit type casts."),
parser_errposition(pstate, location))); parser_errposition(pstate, location)));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment