Commit ba36c48e authored by Bruce Momjian's avatar Bruce Momjian

Proofreading adjustments for first two parts of documentation (Tutorial

and SQL).
parent 23a9ac61
<!-- $PostgreSQL: pgsql/doc/src/sgml/advanced.sgml,v 1.57 2009/02/04 21:30:41 alvherre Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/advanced.sgml,v 1.58 2009/04/27 16:27:35 momjian Exp $ -->
<chapter id="tutorial-advanced"> <chapter id="tutorial-advanced">
<title>Advanced Features</title> <title>Advanced Features</title>
...@@ -19,10 +19,10 @@ ...@@ -19,10 +19,10 @@
<para> <para>
This chapter will on occasion refer to examples found in <xref This chapter will on occasion refer to examples found in <xref
linkend="tutorial-sql"> to change or improve them, so it will be linkend="tutorial-sql"> to change or improve them, so it will be
of advantage if you have read that chapter. Some examples from good if you have read that chapter. Some examples from
this chapter can also be found in this chapter can also be found in
<filename>advanced.sql</filename> in the tutorial directory. This <filename>advanced.sql</filename> in the tutorial directory. This
file also contains some example data to load, which is not file also contains some sample data to load, which is not
repeated here. (Refer to <xref linkend="tutorial-sql-intro"> for repeated here. (Refer to <xref linkend="tutorial-sql-intro"> for
how to use the file.) how to use the file.)
</para> </para>
...@@ -173,7 +173,7 @@ UPDATE branches SET balance = balance + 100.00 ...@@ -173,7 +173,7 @@ UPDATE branches SET balance = balance + 100.00
</para> </para>
<para> <para>
The details of these commands are not important here; the important The details of these commands are not important; the important
point is that there are several separate updates involved to accomplish point is that there are several separate updates involved to accomplish
this rather simple operation. Our bank's officers will want to be this rather simple operation. Our bank's officers will want to be
assured that either all these updates happen, or none of them happen. assured that either all these updates happen, or none of them happen.
...@@ -307,7 +307,7 @@ COMMIT; ...@@ -307,7 +307,7 @@ COMMIT;
<para> <para>
This example is, of course, oversimplified, but there's a lot of control This example is, of course, oversimplified, but there's a lot of control
to be had over a transaction block through the use of savepoints. possible in a transaction block through the use of savepoints.
Moreover, <command>ROLLBACK TO</> is the only way to regain control of a Moreover, <command>ROLLBACK TO</> is the only way to regain control of a
transaction block that was put in aborted state by the transaction block that was put in aborted state by the
system due to an error, short of rolling it back completely and starting system due to an error, short of rolling it back completely and starting
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/arch-dev.sgml,v 2.31 2007/12/12 06:23:27 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/arch-dev.sgml,v 2.32 2009/04/27 16:27:35 momjian Exp $ -->
<chapter id="overview"> <chapter id="overview">
<title>Overview of PostgreSQL Internals</title> <title>Overview of PostgreSQL Internals</title>
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
One application of the rewrite system is in the realization of One application of the rewrite system is in the realization of
<firstterm>views</firstterm>. <firstterm>views</firstterm>.
Whenever a query against a view Whenever a query against a view
(i.e. a <firstterm>virtual table</firstterm>) is made, (i.e., a <firstterm>virtual table</firstterm>) is made,
the rewrite system rewrites the user's query to the rewrite system rewrites the user's query to
a query that accesses the <firstterm>base tables</firstterm> given in a query that accesses the <firstterm>base tables</firstterm> given in
the <firstterm>view definition</firstterm> instead. the <firstterm>view definition</firstterm> instead.
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
<para> <para>
Once a connection is established the client process can send a query Once a connection is established the client process can send a query
to the <firstterm>backend</firstterm> (server). The query is transmitted using plain text, to the <firstterm>backend</firstterm> (server). The query is transmitted using plain text,
i.e. there is no parsing done in the <firstterm>frontend</firstterm> (client). The i.e., there is no parsing done in the <firstterm>frontend</firstterm> (client). The
server parses the query, creates an <firstterm>execution plan</firstterm>, server parses the query, creates an <firstterm>execution plan</firstterm>,
executes the plan and returns the retrieved rows to the client executes the plan and returns the retrieved rows to the client
by transmitting them over the established connection. by transmitting them over the established connection.
...@@ -442,7 +442,7 @@ ...@@ -442,7 +442,7 @@
relations, a near-exhaustive search is conducted to find the best relations, a near-exhaustive search is conducted to find the best
join sequence. The planner preferentially considers joins between any join sequence. The planner preferentially considers joins between any
two relations for which there exist a corresponding join clause in the two relations for which there exist a corresponding join clause in the
<literal>WHERE</literal> qualification (i.e. for <literal>WHERE</literal> qualification (i.e., for
which a restriction like <literal>where rel1.attr1=rel2.attr2</literal> which a restriction like <literal>where rel1.attr1=rel2.attr2</literal>
exists). Join pairs with no join clause are considered only when there exists). Join pairs with no join clause are considered only when there
is no other choice, that is, a particular relation has no available is no other choice, that is, a particular relation has no available
......
This diff is collapsed.
<!-- $PostgreSQL: pgsql/doc/src/sgml/backup.sgml,v 2.124 2009/04/07 00:31:25 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/backup.sgml,v 2.125 2009/04/27 16:27:35 momjian Exp $ -->
<chapter id="backup"> <chapter id="backup">
<title>Backup and Restore</title> <title>Backup and Restore</title>
...@@ -1523,7 +1523,7 @@ archive_command = 'local_backup_script.sh' ...@@ -1523,7 +1523,7 @@ archive_command = 'local_backup_script.sh'
</para> </para>
<para> <para>
It should be noted that the log shipping is asynchronous, i.e. the WAL It should be noted that the log shipping is asynchronous, i.e., the WAL
records are shipped after transaction commit. As a result there is a records are shipped after transaction commit. As a result there is a
window for data loss should the primary server suffer a catastrophic window for data loss should the primary server suffer a catastrophic
failure: transactions not yet shipped will be lost. The length of the failure: transactions not yet shipped will be lost. The length of the
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.215 2009/04/23 00:23:45 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.216 2009/04/27 16:27:35 momjian Exp $ -->
<chapter Id="runtime-config"> <chapter Id="runtime-config">
<title>Server Configuration</title> <title>Server Configuration</title>
...@@ -1253,7 +1253,7 @@ SET ENABLE_SEQSCAN TO OFF; ...@@ -1253,7 +1253,7 @@ SET ENABLE_SEQSCAN TO OFF;
function, which some operating systems lack. If the function is not function, which some operating systems lack. If the function is not
present then setting this parameter to anything but zero will result present then setting this parameter to anything but zero will result
in an error. On some operating systems the function is present but in an error. On some operating systems the function is present but
does not actually do anything (e.g. Solaris). does not actually do anything (e.g., Solaris).
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
...@@ -4333,7 +4333,7 @@ SET XML OPTION { DOCUMENT | CONTENT }; ...@@ -4333,7 +4333,7 @@ SET XML OPTION { DOCUMENT | CONTENT };
If a dynamically loadable module needs to be opened and the If a dynamically loadable module needs to be opened and the
file name specified in the <command>CREATE FUNCTION</command> or file name specified in the <command>CREATE FUNCTION</command> or
<command>LOAD</command> command <command>LOAD</command> command
does not have a directory component (i.e. the does not have a directory component (i.e., the
name does not contain a slash), the system will search this name does not contain a slash), the system will search this
path for the required file. path for the required file.
</para> </para>
...@@ -4503,7 +4503,7 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir' ...@@ -4503,7 +4503,7 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
The shared lock table is created to track locks on The shared lock table is created to track locks on
<varname>max_locks_per_transaction</varname> * (<xref <varname>max_locks_per_transaction</varname> * (<xref
linkend="guc-max-connections"> + <xref linkend="guc-max-connections"> + <xref
linkend="guc-max-prepared-transactions">) objects (e.g. tables); linkend="guc-max-prepared-transactions">) objects (e.g., tables);
hence, no more than this many distinct objects can be locked at hence, no more than this many distinct objects can be locked at
any one time. This parameter controls the average number of object any one time. This parameter controls the average number of object
locks allocated for each transaction; individual transactions locks allocated for each transaction; individual transactions
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/contrib.sgml,v 1.12 2009/03/25 23:20:01 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/contrib.sgml,v 1.13 2009/04/27 16:27:35 momjian Exp $ -->
<appendix id="contrib"> <appendix id="contrib">
<title>Additional Supplied Modules</title> <title>Additional Supplied Modules</title>
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<para> <para>
When building from the source distribution, these modules are not built When building from the source distribution, these modules are not built
automatically. You can build and install all of them by running automatically. You can build and install all of them by running:
<screen> <screen>
<userinput>gmake</userinput> <userinput>gmake</userinput>
<userinput>gmake install</userinput> <userinput>gmake install</userinput>
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
or to build and install or to build and install
just one selected module, do the same in that module's subdirectory. just one selected module, do the same in that module's subdirectory.
Many of the modules have regression tests, which can be executed by Many of the modules have regression tests, which can be executed by
running running:
<screen> <screen>
<userinput>gmake installcheck</userinput> <userinput>gmake installcheck</userinput>
</screen> </screen>
......
This diff is collapsed.
This diff is collapsed.
<!-- $PostgreSQL: pgsql/doc/src/sgml/dml.sgml,v 1.17 2007/12/03 23:49:50 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/dml.sgml,v 1.18 2009/04/27 16:27:35 momjian Exp $ -->
<chapter id="dml"> <chapter id="dml">
<title>Data Manipulation</title> <title>Data Manipulation</title>
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
table data. We also introduce ways to effect automatic data changes table data. We also introduce ways to effect automatic data changes
when certain events occur: triggers and rewrite rules. The chapter when certain events occur: triggers and rewrite rules. The chapter
after this will finally explain how to extract your long-lost data after this will finally explain how to extract your long-lost data
back out of the database. from the database.
</para> </para>
<sect1 id="dml-insert"> <sect1 id="dml-insert">
...@@ -33,14 +33,14 @@ ...@@ -33,14 +33,14 @@
do before a database can be of much use is to insert data. Data is do before a database can be of much use is to insert data. Data is
conceptually inserted one row at a time. Of course you can also conceptually inserted one row at a time. Of course you can also
insert more than one row, but there is no way to insert less than insert more than one row, but there is no way to insert less than
one row at a time. Even if you know only some column values, a one row. Even if you know only some column values, a
complete row must be created. complete row must be created.
</para> </para>
<para> <para>
To create a new row, use the <xref linkend="sql-insert" To create a new row, use the <xref linkend="sql-insert"
endterm="sql-insert-title"> command. The command requires the endterm="sql-insert-title"> command. The command requires the
table name and a value for each of the columns of the table. For table name and column values. For
example, consider the products table from <xref linkend="ddl">: example, consider the products table from <xref linkend="ddl">:
<programlisting> <programlisting>
CREATE TABLE products ( CREATE TABLE products (
...@@ -60,7 +60,7 @@ INSERT INTO products VALUES (1, 'Cheese', 9.99); ...@@ -60,7 +60,7 @@ INSERT INTO products VALUES (1, 'Cheese', 9.99);
<para> <para>
The above syntax has the drawback that you need to know the order The above syntax has the drawback that you need to know the order
of the columns in the table. To avoid that you can also list the of the columns in the table. To avoid this you can also list the
columns explicitly. For example, both of the following commands columns explicitly. For example, both of the following commands
have the same effect as the one above: have the same effect as the one above:
<programlisting> <programlisting>
...@@ -137,15 +137,15 @@ INSERT INTO products (product_no, name, price) VALUES ...@@ -137,15 +137,15 @@ INSERT INTO products (product_no, name, price) VALUES
To perform an update, you need three pieces of information: To perform an update, you need three pieces of information:
<orderedlist spacing="compact"> <orderedlist spacing="compact">
<listitem> <listitem>
<para>The name of the table and column to update,</para> <para>The name of the table and column to update</para>
</listitem> </listitem>
<listitem> <listitem>
<para>The new value of the column,</para> <para>The new value of the column</para>
</listitem> </listitem>
<listitem> <listitem>
<para>Which row(s) to update.</para> <para>Which row(s) to update</para>
</listitem> </listitem>
</orderedlist> </orderedlist>
</para> </para>
...@@ -153,10 +153,10 @@ INSERT INTO products (product_no, name, price) VALUES ...@@ -153,10 +153,10 @@ INSERT INTO products (product_no, name, price) VALUES
<para> <para>
Recall from <xref linkend="ddl"> that SQL does not, in general, Recall from <xref linkend="ddl"> that SQL does not, in general,
provide a unique identifier for rows. Therefore it is not provide a unique identifier for rows. Therefore it is not
necessarily possible to directly specify which row to update. always possible to directly specify which row to update.
Instead, you specify which conditions a row must meet in order to Instead, you specify which conditions a row must meet in order to
be updated. Only if you have a primary key in the table (no matter be updated. Only if you have a primary key in the table (independent of
whether you declared it or not) can you reliably address individual rows, whether you declared it or not) can you reliably address individual rows
by choosing a condition that matches the primary key. by choosing a condition that matches the primary key.
Graphical database access tools rely on this fact to allow you to Graphical database access tools rely on this fact to allow you to
update rows individually. update rows individually.
...@@ -177,7 +177,7 @@ UPDATE products SET price = 10 WHERE price = 5; ...@@ -177,7 +177,7 @@ UPDATE products SET price = 10 WHERE price = 5;
<literal>UPDATE</literal> followed by the table name. As usual, <literal>UPDATE</literal> followed by the table name. As usual,
the table name can 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 equal 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.
For example, if you want to raise the price of all products by 10% For example, if you want to raise the price of all products by 10%
you could use: you could use:
...@@ -248,7 +248,10 @@ DELETE FROM products WHERE price = 10; ...@@ -248,7 +248,10 @@ DELETE FROM products WHERE price = 10;
<programlisting> <programlisting>
DELETE FROM products; DELETE FROM products;
</programlisting> </programlisting>
then all rows in the table will be deleted! Caveat programmer. then all rows in the table will be deleted! (<xref
linkend="sql-truncate" endterm="sql-truncate-title"> can also be used
to delete all rows.)
Caveat programmer.
</para> </para>
</sect1> </sect1>
</chapter> </chapter>
<!-- $PostgreSQL: pgsql/doc/src/sgml/docguide.sgml,v 1.74 2008/11/03 15:39:38 alvherre Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/docguide.sgml,v 1.75 2009/04/27 16:27:35 momjian Exp $ -->
<appendix id="docguide"> <appendix id="docguide">
<title>Documentation</title> <title>Documentation</title>
...@@ -358,7 +358,7 @@ CATALOG "dsssl/catalog" ...@@ -358,7 +358,7 @@ CATALOG "dsssl/catalog"
Create the directory Create the directory
<filename>/usr/local/share/sgml/docbook-4.2</filename> and change <filename>/usr/local/share/sgml/docbook-4.2</filename> and change
to it. (The exact location is irrelevant, but this one is to it. (The exact location is irrelevant, but this one is
reasonable within the layout we are following here.) reasonable within the layout we are following here.):
<screen> <screen>
<prompt>$ </prompt><userinput>mkdir /usr/local/share/sgml/docbook-4.2</userinput> <prompt>$ </prompt><userinput>mkdir /usr/local/share/sgml/docbook-4.2</userinput>
<prompt>$ </prompt><userinput>cd /usr/local/share/sgml/docbook-4.2</userinput> <prompt>$ </prompt><userinput>cd /usr/local/share/sgml/docbook-4.2</userinput>
...@@ -368,7 +368,7 @@ CATALOG "dsssl/catalog" ...@@ -368,7 +368,7 @@ CATALOG "dsssl/catalog"
<step> <step>
<para> <para>
Unpack the archive. Unpack the archive:
<screen> <screen>
<prompt>$ </prompt><userinput>unzip -a ...../docbook-4.2.zip</userinput> <prompt>$ </prompt><userinput>unzip -a ...../docbook-4.2.zip</userinput>
</screen> </screen>
...@@ -392,7 +392,7 @@ CATALOG "docbook-4.2/docbook.cat" ...@@ -392,7 +392,7 @@ CATALOG "docbook-4.2/docbook.cat"
<para> <para>
Download the <ulink url="http://www.oasis-open.org/cover/ISOEnts.zip"> Download the <ulink url="http://www.oasis-open.org/cover/ISOEnts.zip">
ISO 8879 character entities archive</ulink>, unpack it, and put the ISO 8879 character entities archive</ulink>, unpack it, and put the
files in the same directory you put the DocBook files in. files in the same directory you put the DocBook files in:
<screen> <screen>
<prompt>$ </prompt><userinput>cd /usr/local/share/sgml/docbook-4.2</userinput> <prompt>$ </prompt><userinput>cd /usr/local/share/sgml/docbook-4.2</userinput>
<prompt>$ </prompt><userinput>unzip ...../ISOEnts.zip</userinput> <prompt>$ </prompt><userinput>unzip ...../ISOEnts.zip</userinput>
...@@ -421,7 +421,7 @@ perl -pi -e 's/iso-(.*).gml/ISO\1/g' docbook.cat ...@@ -421,7 +421,7 @@ perl -pi -e 's/iso-(.*).gml/ISO\1/g' docbook.cat
To install the style sheets, unzip and untar the distribution and To install the style sheets, unzip and untar the distribution and
move it to a suitable place, for example move it to a suitable place, for example
<filename>/usr/local/share/sgml</filename>. (The archive will <filename>/usr/local/share/sgml</filename>. (The archive will
automatically create a subdirectory.) automatically create a subdirectory.):
<screen> <screen>
<prompt>$</prompt> <userinput>gunzip docbook-dsssl-1.<replaceable>xx</>.tar.gz</userinput> <prompt>$</prompt> <userinput>gunzip docbook-dsssl-1.<replaceable>xx</>.tar.gz</userinput>
<prompt>$</prompt> <userinput>tar -C /usr/local/share/sgml -xf docbook-dsssl-1.<replaceable>xx</>.tar</userinput> <prompt>$</prompt> <userinput>tar -C /usr/local/share/sgml -xf docbook-dsssl-1.<replaceable>xx</>.tar</userinput>
...@@ -652,7 +652,7 @@ gmake man.tar.gz D2MDIR=<replaceable>directory</replaceable> ...@@ -652,7 +652,7 @@ gmake man.tar.gz D2MDIR=<replaceable>directory</replaceable>
<screen> <screen>
<prompt>doc/src/sgml$ </prompt><userinput>gmake postgres-A4.pdf</userinput> <prompt>doc/src/sgml$ </prompt><userinput>gmake postgres-A4.pdf</userinput>
</screen> </screen>
or or:
<screen> <screen>
<prompt>doc/src/sgml$ </prompt><userinput>gmake postgres-US.pdf</userinput> <prompt>doc/src/sgml$ </prompt><userinput>gmake postgres-US.pdf</userinput>
</screen> </screen>
...@@ -738,7 +738,6 @@ save_size.pdfjadetex = 15000 ...@@ -738,7 +738,6 @@ save_size.pdfjadetex = 15000
following one. A utility, <command>fixrtf</command>, is following one. A utility, <command>fixrtf</command>, is
available in <filename>doc/src/sgml</filename> to accomplish available in <filename>doc/src/sgml</filename> to accomplish
these repairs: these repairs:
<screen> <screen>
<prompt>doc/src/sgml$ </prompt><userinput>./fixrtf --refentry postgres.rtf</userinput> <prompt>doc/src/sgml$ </prompt><userinput>./fixrtf --refentry postgres.rtf</userinput>
</screen> </screen>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/ecpg.sgml,v 1.87 2008/12/07 23:46:39 alvherre Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/ecpg.sgml,v 1.88 2009/04/27 16:27:35 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>
...@@ -750,7 +750,7 @@ EXEC SQL DEALLOCATE PREPARE <replaceable>name</replaceable>; ...@@ -750,7 +750,7 @@ EXEC SQL DEALLOCATE PREPARE <replaceable>name</replaceable>;
<para> <para>
The pgtypes library maps <productname>PostgreSQL</productname> database The pgtypes library maps <productname>PostgreSQL</productname> database
types to C equivalents that can be used in C programs. It also offers types to C equivalents that can be used in C programs. It also offers
functions to do basic calculations with those types within C, i.e. without functions to do basic calculations with those types within C, i.e., without
the help of the <productname>PostgreSQL</productname> server. See the the help of the <productname>PostgreSQL</productname> server. See the
following example: following example:
<programlisting><![CDATA[ <programlisting><![CDATA[
...@@ -1232,7 +1232,7 @@ date PGTYPESdate_from_asc(char *str, char **endptr); ...@@ -1232,7 +1232,7 @@ date PGTYPESdate_from_asc(char *str, char **endptr);
char *PGTYPESdate_to_asc(date dDate); char *PGTYPESdate_to_asc(date dDate);
</synopsis> </synopsis>
The function receives the date <literal>dDate</> as its only parameter. The function receives the date <literal>dDate</> as its only parameter.
It will output the date in the form <literal>1999-01-18</>, i.e. in the It will output the date in the form <literal>1999-01-18</>, i.e., in the
<literal>YYYY-MM-DD</> format. <literal>YYYY-MM-DD</> format.
</para> </para>
</listitem> </listitem>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
<!-- $PostgreSQL: pgsql/doc/src/sgml/high-availability.sgml,v 1.34 2008/11/19 04:46:37 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/high-availability.sgml,v 1.35 2009/04/27 16:27:35 momjian Exp $ -->
<chapter id="high-availability"> <chapter id="high-availability">
<title>High Availability, Load Balancing, and Replication</title> <title>High Availability, Load Balancing, and Replication</title>
...@@ -414,7 +414,7 @@ protocol to make nodes agree on a serializable transactional order. ...@@ -414,7 +414,7 @@ protocol to make nodes agree on a serializable transactional order.
<para> <para>
Data partitioning splits tables into data sets. Each set can Data partitioning splits tables into data sets. Each set can
be modified by only one server. For example, data can be be modified by only one server. For example, data can be
partitioned by offices, e.g. London and Paris, with a server partitioned by offices, e.g., London and Paris, with a server
in each office. If queries combining London and Paris data in each office. If queries combining London and Paris data
are necessary, an application can query both servers, or are necessary, an application can query both servers, or
master/slave replication can be used to keep a read-only copy master/slave replication can be used to keep a read-only copy
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/history.sgml,v 1.30 2007/10/30 23:06:06 petere Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/history.sgml,v 1.31 2009/04/27 16:27:35 momjian Exp $ -->
<sect1 id="history"> <sect1 id="history">
<title>A Brief History of <productname>PostgreSQL</productname></title> <title>A Brief History of <productname>PostgreSQL</productname></title>
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
The object-relational database management system now known as The object-relational database management system now known as
<productname>PostgreSQL</productname> is derived from the <productname>PostgreSQL</productname> is derived from the
<productname>POSTGRES</productname> package written at the <productname>POSTGRES</productname> package written at the
University of California at Berkeley. With over a decade of University of California at Berkeley. With over two decades of
development behind it, <productname>PostgreSQL</productname> is now development behind it, <productname>PostgreSQL</productname> is now
the most advanced open-source database available anywhere. the most advanced open-source database available anywhere.
</para> </para>
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
</indexterm> </indexterm>
<para> <para>
In 1994, Andrew Yu and Jolly Chen added a SQL language interpreter In 1994, Andrew Yu and Jolly Chen added an SQL language interpreter
to <productname>POSTGRES</productname>. Under a new name, to <productname>POSTGRES</productname>. Under a new name,
<productname>Postgres95</productname> was subsequently released to <productname>Postgres95</productname> was subsequently released to
the web to find its own way in the world as an open-source the web to find its own way in the world as an open-source
......
This diff is collapsed.
<!-- $PostgreSQL: pgsql/doc/src/sgml/info.sgml,v 1.26 2008/01/09 02:37:45 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/info.sgml,v 1.27 2009/04/27 16:27:35 momjian Exp $ -->
<sect1 id="resources"> <sect1 id="resources">
<title>Further Information</title> <title>Further Information</title>
...@@ -8,12 +8,17 @@ ...@@ -8,12 +8,17 @@
resources about <productname>PostgreSQL</productname>: resources about <productname>PostgreSQL</productname>:
<variablelist> <variablelist>
<varlistentry> <varlistentry>
<term>FAQs</term> <term>Wiki</term>
<listitem> <listitem>
<para> <para>
The FAQ list <indexterm><primary>FAQ</></> contains The <productname>PostgreSQL</productname> <ulink
continuously updated answers to frequently asked questions. url="http://wiki.postgresql.org">wiki</ulink> contains the project's <ulink
url="http://wiki.postgresql.org/wiki/Frequently_Asked_Questions">FAQ</>
(Frequently Asked Questions) list, <ulink
url="http://wiki.postgresql.org/wiki/Todo">TODO</> list, and
detailed information about many more topics.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/install-win32.sgml,v 1.51 2009/01/09 13:37:18 petere Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/install-win32.sgml,v 1.52 2009/04/27 16:27:35 momjian Exp $ -->
<chapter id="install-win32"> <chapter id="install-win32">
<title>Installation from Source Code on <productname>Windows</productname></title> <title>Installation from Source Code on <productname>Windows</productname></title>
...@@ -383,7 +383,7 @@ ...@@ -383,7 +383,7 @@
<para> <para>
To build the <application>libpq</application> client library using To build the <application>libpq</application> client library using
<productname>Visual Studio 7.1 or later</productname>, change into the <productname>Visual Studio 7.1 or later</productname>, change into the
<filename>src</filename> directory and type the command <filename>src</filename> directory and type the command:
<screen> <screen>
<userinput>nmake /f win32.mak</userinput> <userinput>nmake /f win32.mak</userinput>
</screen> </screen>
...@@ -392,7 +392,7 @@ ...@@ -392,7 +392,7 @@
To build a 64-bit version of the <application>libpq</application> To build a 64-bit version of the <application>libpq</application>
client library using <productname>Visual Studio 8.0 or client library using <productname>Visual Studio 8.0 or
later</productname>, change into the <filename>src</filename> later</productname>, change into the <filename>src</filename>
directory and type in the command directory and type in the command:
<screen> <screen>
<userinput>nmake /f win32.mak CPU=AMD64</userinput> <userinput>nmake /f win32.mak CPU=AMD64</userinput>
</screen> </screen>
...@@ -403,7 +403,7 @@ ...@@ -403,7 +403,7 @@
<para> <para>
To build the <application>libpq</application> client library using To build the <application>libpq</application> client library using
<productname>Borland C++</productname>, change into the <productname>Borland C++</productname>, change into the
<filename>src</filename> directory and type the command <filename>src</filename> directory and type the command:
<screen> <screen>
<userinput>make -N -DCFG=Release /f bcc32.mak</userinput> <userinput>make -N -DCFG=Release /f bcc32.mak</userinput>
</screen> </screen>
......
This diff is collapsed.
<!-- $PostgreSQL: pgsql/doc/src/sgml/intro.sgml,v 1.34 2009/01/27 12:40:14 petere Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/intro.sgml,v 1.35 2009/04/27 16:27:36 momjian Exp $ -->
<preface id="preface"> <preface id="preface">
<title>Preface</title> <title>Preface</title>
<para> <para>
This book is the official documentation of This book is the official documentation of
<productname>PostgreSQL</productname>. It is being written by the <productname>PostgreSQL</productname>. It has been written by the
<productname>PostgreSQL</productname> developers and other <productname>PostgreSQL</productname> developers and other
volunteers in parallel to the development of the volunteers in parallel to the development of the
<productname>PostgreSQL</productname> software. It describes all <productname>PostgreSQL</productname> software. It describes all
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
<para> <para>
<xref linkend="server-programming"> contains information for <xref linkend="server-programming"> contains information for
advanced users about the extensibility capabilities of the advanced users about the extensibility capabilities of the
server. Topics are, for instance, user-defined data types and server. Topics include user-defined data types and
functions. functions.
</para> </para>
</listitem> </listitem>
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
<para> <para>
And because of the liberal license, And because of the liberal license,
<productname>PostgreSQL</productname> can be used, modified, and <productname>PostgreSQL</productname> can be used, modified, and
distributed by everyone free of charge for any purpose, be it distributed by anyone free of charge for any purpose, be it
private, commercial, or academic. private, commercial, or academic.
</para> </para>
</sect1> </sect1>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.287 2009/04/24 14:10:41 mha Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/libpq.sgml,v 1.288 2009/04/27 16:27:36 momjian Exp $ -->
<chapter id="libpq"> <chapter id="libpq">
<title><application>libpq</application> - C Library</title> <title><application>libpq</application> - C Library</title>
...@@ -6633,7 +6633,7 @@ myEventProc(PGEventId evtId, void *evtInfo, void *passThrough) ...@@ -6633,7 +6633,7 @@ myEventProc(PGEventId evtId, void *evtInfo, void *passThrough)
#include &lt;libpq-fe.h&gt; #include &lt;libpq-fe.h&gt;
</programlisting> </programlisting>
If you failed to do that then you will normally get error messages If you failed to do that then you will normally get error messages
from your compiler similar to from your compiler similar to:
<screen> <screen>
foo.c: In function `main': foo.c: In function `main':
foo.c:34: `PGconn' undeclared (first use in this function) foo.c:34: `PGconn' undeclared (first use in this function)
...@@ -6679,7 +6679,7 @@ CPPFLAGS += -I/usr/local/pgsql/include ...@@ -6679,7 +6679,7 @@ CPPFLAGS += -I/usr/local/pgsql/include
<para> <para>
Failure to specify the correct option to the compiler will Failure to specify the correct option to the compiler will
result in an error message such as result in an error message such as:
<screen> <screen>
testlibpq.c:8:22: libpq-fe.h: No such file or directory testlibpq.c:8:22: libpq-fe.h: No such file or directory
</screen> </screen>
...@@ -6713,7 +6713,7 @@ cc -o testprog testprog1.o testprog2.o -L/usr/local/pgsql/lib -lpq ...@@ -6713,7 +6713,7 @@ cc -o testprog testprog1.o testprog2.o -L/usr/local/pgsql/lib -lpq
<para> <para>
Error messages that point to problems in this area could look like Error messages that point to problems in this area could look like
the following. the following:
<screen> <screen>
testlibpq.o: In function `main': testlibpq.o: In function `main':
testlibpq.o(.text+0x60): undefined reference to `PQsetdbLogin' testlibpq.o(.text+0x60): undefined reference to `PQsetdbLogin'
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/monitoring.sgml,v 1.68 2009/04/10 03:13:36 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/monitoring.sgml,v 1.69 2009/04/27 16:27:36 momjian Exp $ -->
<chapter id="monitoring"> <chapter id="monitoring">
<title>Monitoring Database Activity</title> <title>Monitoring Database Activity</title>
...@@ -929,7 +929,7 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re ...@@ -929,7 +929,7 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re
<function>read()</> calls issued for the table, index, or <function>read()</> calls issued for the table, index, or
database; the number of actual physical reads is usually database; the number of actual physical reads is usually
lower due to kernel-level buffering. The <literal>*_blks_read</> lower due to kernel-level buffering. The <literal>*_blks_read</>
statistics columns uses this subtraction, i.e. fetched minus hit. statistics columns uses this subtraction, i.e., fetched minus hit.
</para> </para>
</note> </note>
......
This diff is collapsed.
This diff is collapsed.
<!-- $PostgreSQL: pgsql/doc/src/sgml/pgbuffercache.sgml,v 2.3 2008/08/14 12:56:41 heikki Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/pgbuffercache.sgml,v 2.4 2009/04/27 16:27:36 momjian Exp $ -->
<sect1 id="pgbuffercache"> <sect1 id="pgbuffercache">
<title>pg_buffercache</title> <title>pg_buffercache</title>
...@@ -141,7 +141,8 @@ ...@@ -141,7 +141,8 @@
b.reldatabase IN (0, (SELECT oid FROM pg_database b.reldatabase IN (0, (SELECT oid FROM pg_database
WHERE datname = current_database())) WHERE datname = current_database()))
GROUP BY c.relname GROUP BY c.relname
ORDER BY 2 DESC LIMIT 10; ORDER BY 2 DESC
LIMIT 10;
relname | buffers relname | buffers
---------------------------------+--------- ---------------------------------+---------
tenk2 | 345 tenk2 | 345
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/postgres.sgml,v 1.86 2008/05/07 16:36:43 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/postgres.sgml,v 1.87 2009/04/27 16:27:36 momjian Exp $ -->
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.2//EN" [ <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.2//EN" [
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
chapters individually as they choose. The information in this chapters individually as they choose. The information in this
part is presented in a narrative fashion in topical units. part is presented in a narrative fashion in topical units.
Readers looking for a complete description of a particular command Readers looking for a complete description of a particular command
should look into <xref linkend="reference">. should see <xref linkend="reference">.
</para> </para>
<para> <para>
...@@ -127,14 +127,14 @@ ...@@ -127,14 +127,14 @@
self-contained and can be read individually as desired. The self-contained and can be read individually as desired. The
information in this part is presented in a narrative fashion in information in this part is presented in a narrative fashion in
topical units. Readers looking for a complete description of a topical units. Readers looking for a complete description of a
particular command should look into <xref linkend="reference">. particular command should see <xref linkend="reference">.
</para> </para>
<para> <para>
The first few chapters are written so that they can be understood The first few chapters are written so they can be understood
without prerequisite knowledge, so that new users who need to set without prerequisite knowledge, so new users who need to set
up their own server can begin their exploration with this part. up their own server can begin their exploration with this part.
The rest of this part is about tuning and management; that material The rest of this part is about tuning and management; the material
assumes that the reader is familiar with the general use of assumes that the reader is familiar with the general use of
the <productname>PostgreSQL</> database system. Readers are the <productname>PostgreSQL</> database system. Readers are
encouraged to look at <xref linkend="tutorial"> and <xref encouraged to look at <xref linkend="tutorial"> and <xref
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/problems.sgml,v 2.29 2009/01/06 17:27:06 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/problems.sgml,v 2.30 2009/04/27 16:27:36 momjian Exp $ -->
<sect1 id="bug-reporting"> <sect1 id="bug-reporting">
<title>Bug Reporting Guidelines</title> <title>Bug Reporting Guidelines</title>
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
file that can be run through the <application>psql</application> file that can be run through the <application>psql</application>
frontend that shows the problem. (Be sure to not have anything frontend that shows the problem. (Be sure to not have anything
in your <filename>~/.psqlrc</filename> start-up file.) An easy in your <filename>~/.psqlrc</filename> start-up file.) An easy
start at this file is to use <application>pg_dump</application> way to create this file is to use <application>pg_dump</application>
to dump out the table declarations and data needed to set the to dump out the table declarations and data needed to set the
scene, then add the problem query. You are encouraged to scene, then add the problem query. You are encouraged to
minimize the size of your example, but this is not absolutely minimize the size of your example, but this is not absolutely
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
C library, processor, memory information, and so on. In most C library, processor, memory information, and so on. In most
cases it is sufficient to report the vendor and version, but do cases it is sufficient to report the vendor and version, but do
not assume everyone knows what exactly <quote>Debian</quote> not assume everyone knows what exactly <quote>Debian</quote>
contains or that everyone runs on Pentiums. If you have contains or that everyone runs on i386s. If you have
installation problems then information about the toolchain on installation problems then information about the toolchain on
your machine (compiler, <application>make</application>, and so your machine (compiler, <application>make</application>, and so
on) is also necessary. on) is also necessary.
......
This diff is collapsed.
<!-- $PostgreSQL: pgsql/doc/src/sgml/query.sgml,v 1.51 2008/12/28 18:53:54 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/query.sgml,v 1.52 2009/04/27 16:27:36 momjian Exp $ -->
<chapter id="tutorial-sql"> <chapter id="tutorial-sql">
<title>The <acronym>SQL</acronym> Language</title> <title>The <acronym>SQL</acronym> Language</title>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
functions and types. (If you installed a pre-packaged version of functions and types. (If you installed a pre-packaged version of
<productname>PostgreSQL</productname> rather than building from source, <productname>PostgreSQL</productname> rather than building from source,
look for a directory named <filename>tutorial</> within the look for a directory named <filename>tutorial</> within the
<productname>PostgreSQL</productname> documentation. The <quote>make</> <productname>PostgreSQL</productname> distribution. The <quote>make</>
part should already have been done for you.) part should already have been done for you.)
Then, to start the tutorial, do the following: Then, to start the tutorial, do the following:
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
</screen> </screen>
The <literal>\i</literal> command reads in commands from the The <literal>\i</literal> command reads in commands from the
specified file. The <literal>-s</literal> option puts you in specified file. The <command>psql</command> <literal>-s</> option puts you in
single step mode which pauses before sending each statement to the single step mode which pauses before sending each statement to the
server. The commands used in this section are in the file server. The commands used in this section are in the file
<filename>basics.sql</filename>. <filename>basics.sql</filename>.
...@@ -165,7 +165,7 @@ CREATE TABLE weather ( ...@@ -165,7 +165,7 @@ CREATE TABLE weather (
and a rich set of geometric types. and a rich set of geometric types.
<productname>PostgreSQL</productname> can be customized with an <productname>PostgreSQL</productname> can be customized with an
arbitrary number of user-defined data types. Consequently, type arbitrary number of user-defined data types. Consequently, type
names are not syntactical key words, except where required to names are not special key words in the syntax except where required to
support special cases in the <acronym>SQL</acronym> standard. support special cases in the <acronym>SQL</acronym> standard.
</para> </para>
...@@ -421,7 +421,7 @@ SELECT DISTINCT city ...@@ -421,7 +421,7 @@ SELECT DISTINCT city
<literal>DISTINCT</literal> automatically orders the rows and <literal>DISTINCT</literal> automatically orders the rows and
so <literal>ORDER BY</literal> is unnecessary. But this is not so <literal>ORDER BY</literal> is unnecessary. But this is not
required by the SQL standard, and current required by the SQL standard, and current
<productname>PostgreSQL</productname> doesn't guarantee that <productname>PostgreSQL</productname> does not guarantee that
<literal>DISTINCT</literal> causes the rows to be ordered. <literal>DISTINCT</literal> causes the rows to be ordered.
</para> </para>
</footnote> </footnote>
...@@ -451,8 +451,8 @@ SELECT DISTINCT city ...@@ -451,8 +451,8 @@ SELECT DISTINCT city
<firstterm>join</firstterm> query. As an example, say you wish to <firstterm>join</firstterm> query. As an example, say you wish to
list all the weather records together with the location of the list all the weather records together with the location of the
associated city. To do that, we need to compare the city column of associated city. To do that, we need to compare the city column of
each row of the weather table with the name column of all rows in each row of the <literal>weather</> table with the name column of all rows in
the cities table, and select the pairs of rows where these values match. the <literal>cities</> table, and select the pairs of rows where these values match.
<note> <note>
<para> <para>
This is only a conceptual model. The join is usually performed This is only a conceptual model. The join is usually performed
...@@ -486,7 +486,7 @@ SELECT * ...@@ -486,7 +486,7 @@ SELECT *
There is no result row for the city of Hayward. This is There is no result row for the city of Hayward. This is
because there is no matching entry in the because there is no matching entry in the
<classname>cities</classname> table for Hayward, so the join <classname>cities</classname> table for Hayward, so the join
ignores the unmatched rows in the weather table. We will see ignores the unmatched rows in the <literal>weather</> table. We will see
shortly how this can be fixed. shortly how this can be fixed.
</para> </para>
</listitem> </listitem>
...@@ -494,9 +494,9 @@ SELECT * ...@@ -494,9 +494,9 @@ SELECT *
<listitem> <listitem>
<para> <para>
There are two columns containing the city name. This is There are two columns containing the city name. This is
correct because the lists of columns of the correct because the columns from the
<classname>weather</classname> and the <classname>weather</classname> and the
<classname>cities</classname> table are concatenated. In <classname>cities</classname> tables are concatenated. In
practice this is undesirable, though, so you will probably want practice this is undesirable, though, so you will probably want
to list the output columns explicitly rather than using to list the output columns explicitly rather than using
<literal>*</literal>: <literal>*</literal>:
...@@ -514,14 +514,14 @@ SELECT city, temp_lo, temp_hi, prcp, date, location ...@@ -514,14 +514,14 @@ SELECT city, temp_lo, temp_hi, prcp, date, location
<title>Exercise:</title> <title>Exercise:</title>
<para> <para>
Attempt to find out the semantics of this query when the Attempt to determine the semantics of this query when the
<literal>WHERE</literal> clause is omitted. <literal>WHERE</literal> clause is omitted.
</para> </para>
</formalpara> </formalpara>
<para> <para>
Since the columns all had different names, the parser Since the columns all had different names, the parser
automatically found out which table they belong to. If there automatically found which table they belong to. If there
were duplicate column names in the two tables you'd need to were duplicate column names in the two tables you'd need to
<firstterm>qualify</> the column names to show which one you <firstterm>qualify</> the column names to show which one you
meant, as in: meant, as in:
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/regress.sgml,v 1.62 2009/02/12 13:26:03 petere Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/regress.sgml,v 1.63 2009/04/27 16:27:36 momjian Exp $ -->
<chapter id="regress"> <chapter id="regress">
<title id="regress-title">Regression Tests</title> <title id="regress-title">Regression Tests</title>
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<para> <para>
To run the regression tests after building but before installation, To run the regression tests after building but before installation,
type type:
<screen> <screen>
gmake check gmake check
</screen> </screen>
...@@ -45,7 +45,7 @@ gmake check ...@@ -45,7 +45,7 @@ gmake check
<filename>src/test/regress</filename> and run the command there.) <filename>src/test/regress</filename> and run the command there.)
This will first build several auxiliary files, such as This will first build several auxiliary files, such as
some sample user-defined trigger functions, and then run the test driver some sample user-defined trigger functions, and then run the test driver
script. At the end you should see something like script. At the end you should see something like:
<screen> <screen>
<computeroutput> <computeroutput>
======================= =======================
...@@ -64,7 +64,7 @@ gmake check ...@@ -64,7 +64,7 @@ gmake check
If you already did the build as root, you do not have to start all If you already did the build as root, you do not have to start all
over. Instead, make the regression test directory writable by over. Instead, make the regression test directory writable by
some other user, log in as that user, and restart the tests. some other user, log in as that user, and restart the tests.
For example For example:
<screen> <screen>
<prompt>root# </prompt><userinput>chmod -R a+w src/test/regress</userinput> <prompt>root# </prompt><userinput>chmod -R a+w src/test/regress</userinput>
<prompt>root# </prompt><userinput>su - joeuser</userinput> <prompt>root# </prompt><userinput>su - joeuser</userinput>
...@@ -101,7 +101,7 @@ gmake check ...@@ -101,7 +101,7 @@ gmake check
make sure this limit is at least fifty or so, else you might 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:
<screen> <screen>
gmake MAX_CONNECTIONS=10 check gmake MAX_CONNECTIONS=10 check
</screen> </screen>
...@@ -111,11 +111,11 @@ gmake MAX_CONNECTIONS=10 check ...@@ -111,11 +111,11 @@ gmake MAX_CONNECTIONS=10 check
<para> <para>
To run the tests after installation<![%standalone-ignore;[ (see <xref linkend="installation">)]]>, To run the tests after installation<![%standalone-ignore;[ (see <xref linkend="installation">)]]>,
initialize a data area and start the initialize a data area and start the
server, <![%standalone-ignore;[as explained in <xref linkend="runtime">, ]]> then type server, <![%standalone-ignore;[as explained in <xref linkend="runtime">, ]]> then type:
<screen> <screen>
gmake installcheck gmake installcheck
</screen> </screen>
or for a parallel test or for a parallel test:
<screen> <screen>
gmake installcheck-parallel gmake installcheck-parallel
</screen> </screen>
...@@ -130,14 +130,14 @@ gmake installcheck-parallel ...@@ -130,14 +130,14 @@ gmake installcheck-parallel
At present, these tests can be used only against an already-installed At present, these tests can be used only against an already-installed
server. To run the tests for all procedural languages that have been server. To run the tests for all procedural languages that have been
built and installed, change to the <filename>src/pl</> directory of the built and installed, change to the <filename>src/pl</> directory of the
build tree and type build tree and type:
<screen> <screen>
gmake installcheck gmake installcheck
</screen> </screen>
You can also do this in any of the subdirectories of <filename>src/pl</> You can also do this in any of the subdirectories of <filename>src/pl</>
to run tests for just one procedural language. To run the tests for all to run tests for just one procedural language. To run the tests for all
<filename>contrib</> modules that have them, change to the <filename>contrib</> modules that have them, change to the
<filename>contrib</> directory of the build tree and type <filename>contrib</> directory of the build tree and type:
<screen> <screen>
gmake installcheck gmake installcheck
</screen> </screen>
...@@ -479,7 +479,7 @@ gmake coverage-html ...@@ -479,7 +479,7 @@ gmake coverage-html
</para> </para>
<para> <para>
To reset the execution counts between test runs, run To reset the execution counts between test runs, run:
<screen> <screen>
gmake coverage-clean gmake coverage-clean
</screen> </screen>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/rowtypes.sgml,v 2.9 2007/02/01 00:28:18 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/rowtypes.sgml,v 2.10 2009/04/27 16:27:36 momjian Exp $ -->
<sect1 id="rowtypes"> <sect1 id="rowtypes">
<title>Composite Types</title> <title>Composite Types</title>
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
</indexterm> </indexterm>
<para> <para>
A <firstterm>composite type</> describes the structure of a row or record; A <firstterm>composite type</> represents the structure of a row or record;
it is in essence just a list of field names and their data types. it is essentially just a list of field names and their data types.
<productname>PostgreSQL</productname> allows values of composite types to be <productname>PostgreSQL</productname> allows composite types to be
used in many of the same ways that simple types can be used. For example, a used in many of the same ways that simple types can be used. For example, a
column of a table can be declared to be of a composite type. column of a table can be declared to be of a composite type.
</para> </para>
...@@ -39,9 +39,9 @@ CREATE TYPE inventory_item AS ( ...@@ -39,9 +39,9 @@ CREATE TYPE inventory_item AS (
The syntax is comparable to <command>CREATE TABLE</>, except that only The syntax is comparable to <command>CREATE TABLE</>, except that only
field names and types can be specified; no constraints (such as <literal>NOT field names and types can be specified; no constraints (such as <literal>NOT
NULL</>) can presently be included. Note that the <literal>AS</> keyword NULL</>) can presently be included. Note that the <literal>AS</> keyword
is essential; without it, the system will think a quite different kind is essential; without it, the system will think a different kind
of <command>CREATE TYPE</> command is meant, and you'll get odd syntax of <command>CREATE TYPE</> command is meant, and you will get odd syntax
errors. error.
</para> </para>
<para> <para>
...@@ -68,8 +68,8 @@ SELECT price_extension(item, 10) FROM on_hand; ...@@ -68,8 +68,8 @@ SELECT price_extension(item, 10) FROM on_hand;
</para> </para>
<para> <para>
Whenever you create a table, a composite type is also automatically Whenever you create a table, a composite type is automatically
created, with the same name as the table, to represent the table's created also, with the same name as the table, to represent the table's
row type. For example, had we said: row type. For example, had we said:
<programlisting> <programlisting>
CREATE TABLE inventory_item ( CREATE TABLE inventory_item (
...@@ -135,7 +135,7 @@ CREATE TABLE inventory_item ( ...@@ -135,7 +135,7 @@ CREATE TABLE inventory_item (
<para> <para>
The <literal>ROW</literal> expression syntax can 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
method above: method above:
<programlisting> <programlisting>
...@@ -169,7 +169,8 @@ SELECT item.name FROM on_hand WHERE item.price &gt; 9.99; ...@@ -169,7 +169,8 @@ SELECT item.name FROM on_hand WHERE item.price &gt; 9.99;
</programlisting> </programlisting>
This will not work since the name <literal>item</> is taken to be a table This will not work since the name <literal>item</> is taken to be a table
name, not a field name, per SQL syntax rules. You must write it like this: name, not a column name of <literal>on_hand</>, per SQL syntax rules.
You must write it like this:
<programlisting> <programlisting>
SELECT (item).name FROM on_hand WHERE (item).price &gt; 9.99; SELECT (item).name FROM on_hand WHERE (item).price &gt; 9.99;
...@@ -195,7 +196,7 @@ SELECT (on_hand.item).name FROM on_hand WHERE (on_hand.item).price &gt; 9.99; ...@@ -195,7 +196,7 @@ SELECT (on_hand.item).name FROM on_hand WHERE (on_hand.item).price &gt; 9.99;
SELECT (my_func(...)).field FROM ... SELECT (my_func(...)).field FROM ...
</programlisting> </programlisting>
Without the extra parentheses, this will provoke a syntax error. Without the extra parentheses, this will generate a syntax error.
</para> </para>
</sect2> </sect2>
...@@ -249,7 +250,7 @@ INSERT INTO mytab (complex_col.r, complex_col.i) VALUES(1.1, 2.2); ...@@ -249,7 +250,7 @@ INSERT INTO mytab (complex_col.r, complex_col.i) VALUES(1.1, 2.2);
The external text representation of a composite value consists of items that The external text representation of a composite value consists of items that
are interpreted according to the I/O conversion rules for the individual are interpreted according to the I/O conversion rules for the individual
field types, plus decoration that indicates the composite structure. field types, plus decoration that indicates the composite structure.
The decoration consists of parentheses (<literal>(</> and <literal>)</>) The decoration consists of parentheses
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 might or might not be parentheses it is considered part of the field value, and might or might not be
...@@ -263,7 +264,7 @@ INSERT INTO mytab (complex_col.r, complex_col.i) VALUES(1.1, 2.2); ...@@ -263,7 +264,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 can write double As shown previously, when writing a composite value you can use 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
...@@ -272,7 +273,8 @@ INSERT INTO mytab (complex_col.r, complex_col.i) VALUES(1.1, 2.2); ...@@ -272,7 +273,8 @@ INSERT INTO mytab (complex_col.r, complex_col.i) VALUES(1.1, 2.2);
precede it with a backslash. (Also, a pair of double quotes within a precede it with a backslash. (Also, a pair of double quotes within a
double-quoted field value is taken to represent a double quote character, double-quoted field value is taken to represent a double quote character,
analogously to the rules for single quotes in SQL literal strings.) analogously to the rules for single quotes in SQL literal strings.)
Alternatively, you can use backslash-escaping to protect all data characters Alternatively, you can avoid quoting and use backslash-escaping to
protect all data characters
that would otherwise be taken as composite syntax. that would otherwise be taken as composite syntax.
</para> </para>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.427 2009/04/24 20:46:16 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.428 2009/04/27 16:27:36 momjian Exp $ -->
<chapter Id="runtime"> <chapter Id="runtime">
<title>Server Setup and Operation</title> <title>Server Setup and Operation</title>
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
linkend="app-initdb">,<indexterm><primary>initdb</></> which is linkend="app-initdb">,<indexterm><primary>initdb</></> which is
installed with <productname>PostgreSQL</productname>. The desired installed with <productname>PostgreSQL</productname>. The desired
file system location of your database cluster is indicated by the file system location of your database cluster is indicated by the
<option>-D</option> option, for example <option>-D</option> option, for example:
<screen> <screen>
<prompt>$</> <userinput>initdb -D /usr/local/pgsql/data</userinput> <prompt>$</> <userinput>initdb -D /usr/local/pgsql/data</userinput>
</screen> </screen>
...@@ -382,7 +382,7 @@ FATAL: could not create TCP/IP listen socket ...@@ -382,7 +382,7 @@ FATAL: could not create TCP/IP listen socket
</para> </para>
<para> <para>
A message like A message like:
<screen> <screen>
FATAL: could not create shared memory segment: Invalid argument FATAL: could not create shared memory segment: Invalid argument
DETAIL: Failed system call was shmget(key=5440001, size=4011376640, 03600). DETAIL: Failed system call was shmget(key=5440001, size=4011376640, 03600).
...@@ -401,7 +401,7 @@ DETAIL: Failed system call was shmget(key=5440001, size=4011376640, 03600). ...@@ -401,7 +401,7 @@ DETAIL: Failed system call was shmget(key=5440001, size=4011376640, 03600).
</para> </para>
<para> <para>
An error like An error like:
<screen> <screen>
FATAL: could not create semaphores: No space left on device FATAL: could not create semaphores: No space left on device
DETAIL: Failed system call was semget(5440126, 17, 03600). DETAIL: Failed system call was semget(5440126, 17, 03600).
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/sources.sgml,v 2.32 2008/10/27 19:37:21 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/sources.sgml,v 2.33 2009/04/27 16:27:36 momjian Exp $ -->
<chapter id="source"> <chapter id="source">
<title>PostgreSQL Coding Conventions</title> <title>PostgreSQL Coding Conventions</title>
...@@ -661,10 +661,10 @@ BETTER: unrecognized node type: 42 ...@@ -661,10 +661,10 @@ BETTER: unrecognized node type: 42
<formalpara> <formalpara>
<title>May vs. Can vs. Might</title> <title>May vs. Can vs. Might</title>
<para> <para>
<quote>May</quote> suggests permission (e.g. "You may borrow my rake."), <quote>May</quote> suggests permission (e.g., "You may borrow my rake."),
and has little use in documentation or error messages. and has little use in documentation or error messages.
<quote>Can</quote> suggests ability (e.g. "I can lift that log."), <quote>Can</quote> suggests ability (e.g., "I can lift that log."),
and <quote>might</quote> suggests possibility (e.g. "It might rain and <quote>might</quote> suggests possibility (e.g., "It might rain
today."). Using the proper word clarifies meaning and assists today."). Using the proper word clarifies meaning and assists
translation. translation.
</para> </para>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/sql.sgml,v 1.47 2008/02/15 22:17:06 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/sql.sgml,v 1.48 2009/04/27 16:27:36 momjian Exp $ -->
<chapter id="sql-intro"> <chapter id="sql-intro">
<title>SQL</title> <title>SQL</title>
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
as <firstterm><acronym>SQL3</acronym></firstterm> as <firstterm><acronym>SQL3</acronym></firstterm>
is under development. It is planned to make <acronym>SQL</acronym> is under development. It is planned to make <acronym>SQL</acronym>
a Turing-complete a Turing-complete
language, i.e. all computable queries (e.g. recursive queries) will be language, i.e., all computable queries (e.g., recursive queries) will be
possible. This has now been completed as SQL:2003. possible. This has now been completed as SQL:2003.
</para> </para>
...@@ -761,7 +761,7 @@ x(A) &mid; F(x) ...@@ -761,7 +761,7 @@ x(A) &mid; F(x)
<para> <para>
The relational algebra and the relational calculus have the same The relational algebra and the relational calculus have the same
<firstterm>expressive power</firstterm>; i.e. all queries that <firstterm>expressive power</firstterm>; i.e., all queries that
can be formulated using relational algebra can also be formulated can be formulated using relational algebra can also be formulated
using the relational calculus and vice versa. using the relational calculus and vice versa.
This was first proved by E. F. Codd in This was first proved by E. F. Codd in
...@@ -811,7 +811,7 @@ x(A) &mid; F(x) ...@@ -811,7 +811,7 @@ x(A) &mid; F(x)
<para> <para>
Arithmetic capability: In <acronym>SQL</acronym> it is possible Arithmetic capability: In <acronym>SQL</acronym> it is possible
to involve to involve
arithmetic operations as well as comparisons, e.g. arithmetic operations as well as comparisons, e.g.:
<programlisting> <programlisting>
A &lt; B + 3. A &lt; B + 3.
...@@ -1027,7 +1027,7 @@ SELECT S.SNAME, P.PNAME ...@@ -1027,7 +1027,7 @@ SELECT S.SNAME, P.PNAME
SUPPLIER &times; PART &times; SELLS SUPPLIER &times; PART &times; SELLS
is derived. Now only those tuples satisfying the is derived. Now only those tuples satisfying the
conditions given in the WHERE clause are selected (i.e. the common conditions given in the WHERE clause are selected (i.e., the common
named attributes have to be equal). Finally we project out all named attributes have to be equal). Finally we project out all
columns but S.SNAME and P.PNAME. columns but S.SNAME and P.PNAME.
</para> </para>
...@@ -1312,7 +1312,7 @@ SELECT COUNT(PNO) ...@@ -1312,7 +1312,7 @@ SELECT COUNT(PNO)
<acronym>SQL</acronym> allows one to partition the tuples of a table <acronym>SQL</acronym> allows one to partition the tuples of a table
into groups. Then the into groups. Then the
aggregate functions described above can be applied to the groups &mdash; aggregate functions described above can be applied to the groups &mdash;
i.e. the value of the aggregate function is no longer calculated over i.e., the value of the aggregate function is no longer calculated over
all the values of the specified column but over all values of a all the values of the specified column but over all values of a
group. Thus the aggregate function is evaluated separately for every group. Thus the aggregate function is evaluated separately for every
group. group.
...@@ -1517,7 +1517,7 @@ SELECT * ...@@ -1517,7 +1517,7 @@ SELECT *
<para> <para>
If we want to know all suppliers that do not sell any part If we want to know all suppliers that do not sell any part
(e.g. to be able to remove these suppliers from the database) we use: (e.g., to be able to remove these suppliers from the database) we use:
<programlisting> <programlisting>
SELECT * SELECT *
...@@ -1533,7 +1533,7 @@ SELECT * ...@@ -1533,7 +1533,7 @@ SELECT *
sells at least one part. Note that we use S.SNO from the outer sells at least one part. Note that we use S.SNO from the outer
<command>SELECT</command> within the WHERE clause of the inner <command>SELECT</command> within the WHERE clause of the inner
<command>SELECT</command>. Here the subquery must be evaluated <command>SELECT</command>. Here the subquery must be evaluated
afresh for each tuple from the outer query, i.e. the value for afresh for each tuple from the outer query, i.e., the value for
S.SNO is always taken from the current tuple of the outer S.SNO is always taken from the current tuple of the outer
<command>SELECT</command>. <command>SELECT</command>.
</para> </para>
...@@ -1811,7 +1811,7 @@ CREATE INDEX I ON SUPPLIER (SNAME); ...@@ -1811,7 +1811,7 @@ CREATE INDEX I ON SUPPLIER (SNAME);
</para> </para>
<para> <para>
The created index is maintained automatically, i.e. whenever a new The created index is maintained automatically, i.e., whenever a new
tuple is inserted into the relation SUPPLIER the index I is tuple is inserted into the relation SUPPLIER the index I is
adapted. Note that the only changes a user can perceive when an adapted. Note that the only changes a user can perceive when an
index is present are increased speed for <command>SELECT</command> index is present are increased speed for <command>SELECT</command>
...@@ -1826,7 +1826,7 @@ CREATE INDEX I ON SUPPLIER (SNAME); ...@@ -1826,7 +1826,7 @@ CREATE INDEX I ON SUPPLIER (SNAME);
<para> <para>
A view can 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
as if it does. By contrast, when we talk of a as if it does. By contrast, when we talk of a
...@@ -1838,7 +1838,7 @@ CREATE INDEX I ON SUPPLIER (SNAME); ...@@ -1838,7 +1838,7 @@ CREATE INDEX I ON SUPPLIER (SNAME);
<para> <para>
Views do not have their own, physically separate, distinguishable Views do not have their own, physically separate, distinguishable
stored data. Instead, the system stores the definition of the stored data. Instead, the system stores the definition of the
view (i.e. the rules about how to access physically stored base view (i.e., the rules about how to access physically stored base
tables in order to materialize the view) somewhere in the system tables in order to materialize the view) somewhere in the system
catalogs (see catalogs (see
<xref linkend="tutorial-catalogs-title" endterm="tutorial-catalogs-title">). For a <xref linkend="tutorial-catalogs-title" endterm="tutorial-catalogs-title">). For a
...@@ -2082,7 +2082,7 @@ DELETE FROM SUPPLIER ...@@ -2082,7 +2082,7 @@ DELETE FROM SUPPLIER
<para> <para>
In this section we will sketch how <acronym>SQL</acronym> can be In this section we will sketch how <acronym>SQL</acronym> can be
embedded into a host language (e.g. <literal>C</literal>). embedded into a host language (e.g., <literal>C</literal>).
There are two main reasons why we want to use <acronym>SQL</acronym> There are two main reasons why we want to use <acronym>SQL</acronym>
from a host language: from a host language:
...@@ -2090,7 +2090,7 @@ DELETE FROM SUPPLIER ...@@ -2090,7 +2090,7 @@ DELETE FROM SUPPLIER
<listitem> <listitem>
<para> <para>
There are queries that cannot be formulated using pure <acronym>SQL</acronym> There are queries that cannot be formulated using pure <acronym>SQL</acronym>
(i.e. recursive queries). To be able to perform such queries we need a (i.e., recursive queries). To be able to perform such queries we need a
host language with a greater expressive power than host language with a greater expressive power than
<acronym>SQL</acronym>. <acronym>SQL</acronym>.
</para> </para>
...@@ -2099,7 +2099,7 @@ DELETE FROM SUPPLIER ...@@ -2099,7 +2099,7 @@ DELETE FROM SUPPLIER
<listitem> <listitem>
<para> <para>
We simply want to access a database from some application that We simply want to access a database from some application that
is written in the host language (e.g. a ticket reservation system is written in the host language (e.g., a ticket reservation system
with a graphical user interface is written in C and the information with a graphical user interface is written in C and the information
about which tickets are still left is stored in a database that can be about which tickets are still left is stored in a database that can be
accessed using embedded <acronym>SQL</acronym>). accessed using embedded <acronym>SQL</acronym>).
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/start.sgml,v 1.48 2009/01/06 03:05:23 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/start.sgml,v 1.49 2009/04/27 16:27:36 momjian Exp $ -->
<chapter id="tutorial-start"> <chapter id="tutorial-start">
<title>Getting Started</title> <title>Getting Started</title>
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
<para> <para>
A server process, which manages the database files, accepts A server process, which manages the database files, accepts
connections to the database from client applications, and connections to the database from client applications, and
performs actions on the database on behalf of the clients. The performs database actions on the behalf of the clients. The
database server program is called database server program is called
<filename>postgres</filename>. <filename>postgres</filename>.
<indexterm><primary>postgres</primary></indexterm> <indexterm><primary>postgres</primary></indexterm>
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
<para> <para>
The <productname>PostgreSQL</productname> server can handle The <productname>PostgreSQL</productname> server can handle
multiple concurrent connections from clients. For that purpose it multiple concurrent connections from clients. To achieve this it
starts (<quote>forks</quote>) a new process for each connection. starts (<quote>forks</quote>) a new process for each connection.
From that point on, the client and the new server process From that point on, the client and the new server process
communicate without intervention by the original communicate without intervention by the original
...@@ -159,25 +159,26 @@ ...@@ -159,25 +159,26 @@
</para> </para>
<para> <para>
If you see a message similar to If you see a message similar to:
<screen> <screen>
createdb: command not found createdb: command not found
</screen> </screen>
then <productname>PostgreSQL</> was not installed properly. Either it was not then <productname>PostgreSQL</> was not installed properly. Either it was not
installed at all or the search path was not set correctly. Try installed at all or your shell's search path was not set correctly. Try
calling the command with an absolute path instead: calling the command with an absolute path instead:
<screen> <screen>
<prompt>$</prompt> <userinput>/usr/local/pgsql/bin/createdb mydb</userinput> <prompt>$</prompt> <userinput>/usr/local/pgsql/bin/createdb mydb</userinput>
</screen> </screen>
The path at your site might be different. Contact your site The path at your site might be different. Contact your site
administrator or check back in the installation instructions to administrator or check the installation instructions to
correct the situation. correct the situation.
</para> </para>
<para> <para>
Another response could be this: Another response could be this:
<screen> <screen>
createdb: could not connect to database postgres: could not connect to server: No such file or directory createdb: could not connect to database postgres: could not connect
to server: No such file or directory
Is the server running locally and accepting Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"? connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
</screen> </screen>
...@@ -246,7 +247,7 @@ createdb: database creation failed: ERROR: permission denied to create database ...@@ -246,7 +247,7 @@ createdb: database creation failed: ERROR: permission denied to create database
length. A convenient choice is to create a database with the same length. A convenient choice is to create a database with the same
name as your current user name. Many tools assume that database name as your current user name. Many tools assume that database
name as the default, so it can save you some typing. To create name as the default, so it can save you some typing. To create
that database, simply type that database, simply type:
<screen> <screen>
<prompt>$</prompt> <userinput>createdb</userinput> <prompt>$</prompt> <userinput>createdb</userinput>
</screen> </screen>
...@@ -299,7 +300,7 @@ createdb: database creation failed: ERROR: permission denied to create database ...@@ -299,7 +300,7 @@ createdb: database creation failed: ERROR: permission denied to create database
<para> <para>
Using an existing graphical frontend tool like Using an existing graphical frontend tool like
<application>pgAdmin</application> or an office suite with <application>pgAdmin</application> or an office suite with
<acronym>ODBC</acronym> support to create and manipulate a <acronym>ODBC</> or <acronym>JDBC</> support to create and manipulate a
database. These possibilities are not covered in this database. These possibilities are not covered in this
tutorial. tutorial.
</para> </para>
...@@ -314,15 +315,15 @@ createdb: database creation failed: ERROR: permission denied to create database ...@@ -314,15 +315,15 @@ createdb: database creation failed: ERROR: permission denied to create database
</listitem> </listitem>
</itemizedlist> </itemizedlist>
You probably want to start up <command>psql</command>, to try out You probably want to start up <command>psql</command> to try
the examples in this tutorial. It can be activated for the the examples in this tutorial. It can be activated for the
<literal>mydb</literal> database by typing the command: <literal>mydb</literal> database by typing the command:
<screen> <screen>
<prompt>$</prompt> <userinput>psql mydb</userinput> <prompt>$</prompt> <userinput>psql mydb</userinput>
</screen> </screen>
If you leave off the database name then it will default to your If you do not supply the database name then it will default to your
user account name. You already discovered this scheme in the user account name. You already discovered this scheme in the
previous section. previous section using <command>createdb</command>.
</para> </para>
<para> <para>
...@@ -335,15 +336,15 @@ Type "help" for help. ...@@ -335,15 +336,15 @@ Type "help" for help.
mydb=&gt; mydb=&gt;
</screen> </screen>
<indexterm><primary>superuser</primary></indexterm> <indexterm><primary>superuser</primary></indexterm>
The last line could also be The last line could also be:
<screen> <screen>
mydb=# mydb=#
</screen> </screen>
That would mean you are a database superuser, which is most likely That would mean you are a database superuser, which is most likely
the case if you installed <productname>PostgreSQL</productname> the case if you installed <productname>PostgreSQL</productname>
yourself. Being a superuser means that you are not subject to yourself. Being a superuser means that you are not subject to
access controls. For the purposes of this tutorial that is not of access controls. For the purposes of this tutorial that is not
importance. important.
</para> </para>
<para> <para>
...@@ -395,7 +396,7 @@ mydb=# ...@@ -395,7 +396,7 @@ mydb=#
</para> </para>
<para> <para>
To get out of <command>psql</command>, type To get out of <command>psql</command>, type:
<screen> <screen>
<prompt>mydb=&gt;</prompt> <userinput>\q</userinput> <prompt>mydb=&gt;</prompt> <userinput>\q</userinput>
</screen> </screen>
...@@ -407,7 +408,7 @@ mydb=# ...@@ -407,7 +408,7 @@ mydb=#
installed correctly you can also type <literal>man psql</literal> installed correctly you can also type <literal>man psql</literal>
at the operating system shell prompt to see the documentation. In at the operating system shell prompt to see the documentation. In
this tutorial we will not use these features explicitly, but you this tutorial we will not use these features explicitly, but you
can use them yourself when you see fit. can use them yourself when it is helpful.
</para> </para>
</sect1> </sect1>
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/syntax.sgml,v 1.130 2009/02/04 21:30:41 alvherre Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/syntax.sgml,v 1.131 2009/04/27 16:27:36 momjian Exp $ -->
<chapter id="sql-syntax"> <chapter id="sql-syntax">
<title>SQL Syntax</title> <title>SQL Syntax</title>
...@@ -11,12 +11,12 @@ ...@@ -11,12 +11,12 @@
<para> <para>
This chapter describes the syntax of SQL. It forms the foundation This chapter describes the syntax of SQL. It forms the foundation
for understanding the following chapters which will go into detail for understanding the following chapters which will go into detail
about how the SQL commands are applied to define and modify data. about how SQL commands are applied to define and modify data.
</para> </para>
<para> <para>
We also advise users who are already familiar with SQL to read this We also advise users who are already familiar with SQL to read this
chapter carefully because there are several rules and concepts that chapter carefully because it contains several rules and concepts that
are implemented inconsistently among SQL databases or that are are implemented inconsistently among SQL databases or that are
specific to <productname>PostgreSQL</productname>. specific to <productname>PostgreSQL</productname>.
</para> </para>
...@@ -293,7 +293,7 @@ U&amp;"d!0061t!+000061" UESCAPE '!' ...@@ -293,7 +293,7 @@ U&amp;"d!0061t!+000061" UESCAPE '!'
bounded by single quotes (<literal>'</literal>), for example bounded by single quotes (<literal>'</literal>), for example
<literal>'This is a string'</literal>. To include <literal>'This is a string'</literal>. To include
a single-quote character within a string constant, a single-quote character within a string constant,
write two adjacent single quotes, e.g. write two adjacent single quotes, e.g.,
<literal>'Dianne''s horse'</literal>. <literal>'Dianne''s horse'</literal>.
Note that this is <emphasis>not</> the same as a double-quote Note that this is <emphasis>not</> the same as a double-quote
character (<literal>"</>). <!-- font-lock sanity: " --> character (<literal>"</>). <!-- font-lock sanity: " -->
...@@ -337,7 +337,7 @@ SELECT 'foo' 'bar'; ...@@ -337,7 +337,7 @@ SELECT 'foo' 'bar';
string constants, which are an extension to the SQL standard. string constants, which are an extension to the SQL standard.
An escape string constant is specified by writing the letter An escape string constant is specified by writing the letter
<literal>E</literal> (upper or lower case) just before the opening single <literal>E</literal> (upper or lower case) just before the opening single
quote, e.g. <literal>E'foo'</>. (When continuing an escape string quote, e.g., <literal>E'foo'</>. (When continuing an escape string
constant across lines, write <literal>E</> only before the first opening constant across lines, write <literal>E</> only before the first opening
quote.) quote.)
Within an escape string, a backslash character (<literal>\</>) begins a Within an escape string, a backslash character (<literal>\</>) begins a
...@@ -422,14 +422,14 @@ SELECT 'foo' 'bar'; ...@@ -422,14 +422,14 @@ SELECT 'foo' 'bar';
<xref linkend="guc-standard-conforming-strings"> is <literal>off</>, <xref linkend="guc-standard-conforming-strings"> is <literal>off</>,
then <productname>PostgreSQL</productname> recognizes backslash escapes then <productname>PostgreSQL</productname> recognizes backslash escapes
in both regular and escape string constants. This is for backward in both regular and escape string constants. This is for backward
compatibility with the historical behavior, in which backslash escapes compatibility with the historical behavior, where backslash escapes
were always recognized. were always recognized.
Although <varname>standard_conforming_strings</> currently defaults to Although <varname>standard_conforming_strings</> currently defaults to
<literal>off</>, the default will change to <literal>on</> in a future <literal>off</>, the default will change to <literal>on</> in a future
release for improved standards compliance. Applications are therefore release for improved standards compliance. Applications are therefore
encouraged to migrate away from using backslash escapes. If you need encouraged to migrate away from using backslash escapes. If you need
to use a backslash escape to represent a special character, write the to use a backslash escape to represent a special character, write the
constant with an <literal>E</> to be sure it will be handled the same string constant with an <literal>E</> to be sure it will be handled the same
way in future releases. way in future releases.
</para> </para>
...@@ -442,7 +442,7 @@ SELECT 'foo' 'bar'; ...@@ -442,7 +442,7 @@ SELECT 'foo' 'bar';
</caution> </caution>
<para> <para>
The character with the code zero cannot be in a string constant. The zero-byte (null byte) character cannot be in a string constant.
</para> </para>
</sect3> </sect3>
...@@ -896,7 +896,7 @@ CAST ( '<replaceable>string</replaceable>' AS <replaceable>type</replaceable> ) ...@@ -896,7 +896,7 @@ CAST ( '<replaceable>string</replaceable>' AS <replaceable>type</replaceable> )
</indexterm> </indexterm>
<para> <para>
A comment is an arbitrary sequence of characters beginning with A comment is a sequence of characters beginning with
double dashes and extending to the end of the line, e.g.: double dashes and extending to the end of the line, e.g.:
<programlisting> <programlisting>
-- This is a standard SQL comment -- This is a standard SQL comment
...@@ -918,8 +918,8 @@ CAST ( '<replaceable>string</replaceable>' AS <replaceable>type</replaceable> ) ...@@ -918,8 +918,8 @@ CAST ( '<replaceable>string</replaceable>' AS <replaceable>type</replaceable> )
</para> </para>
<para> <para>
A comment is removed from the input stream before further syntax Comment are removed from the input stream before further syntax
analysis and is effectively replaced by whitespace. analysis and are effectively replaced by whitespace.
</para> </para>
</sect2> </sect2>
...@@ -1112,7 +1112,7 @@ SELECT 3 OPERATOR(pg_catalog.+) 4; ...@@ -1112,7 +1112,7 @@ SELECT 3 OPERATOR(pg_catalog.+) 4;
</programlisting> </programlisting>
the <literal>OPERATOR</> construct is taken to have the default precedence the <literal>OPERATOR</> construct is taken to have the default precedence
shown in <xref linkend="sql-precedence-table"> for <quote>any other</> operator. This is true no matter shown in <xref linkend="sql-precedence-table"> for <quote>any other</> operator. This is true no matter
which specific operator name appears inside <literal>OPERATOR()</>. which specific operator appears inside <literal>OPERATOR()</>.
</para> </para>
</sect2> </sect2>
</sect1> </sect1>
...@@ -1154,80 +1154,80 @@ SELECT 3 OPERATOR(pg_catalog.+) 4; ...@@ -1154,80 +1154,80 @@ SELECT 3 OPERATOR(pg_catalog.+) 4;
<itemizedlist> <itemizedlist>
<listitem> <listitem>
<para> <para>
A constant or literal value. A constant or literal value
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
A column reference. A column reference
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
A positional parameter reference, in the body of a function definition A positional parameter reference, in the body of a function definition
or prepared statement. or prepared statement
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
A subscripted expression. A subscripted expression
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
A field selection expression. A field selection expression
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
An operator invocation. An operator invocation
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
A function call. A function call
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
An aggregate expression. An aggregate expression
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
A window function call. A window function call
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
A type cast. A type cast
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
A scalar subquery. A scalar subquery
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
An array constructor. An array constructor
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
A row constructor. A row constructor
</para> </para>
</listitem> </listitem>
...@@ -1264,7 +1264,7 @@ SELECT 3 OPERATOR(pg_catalog.+) 4; ...@@ -1264,7 +1264,7 @@ SELECT 3 OPERATOR(pg_catalog.+) 4;
</indexterm> </indexterm>
<para> <para>
A column can be referenced in the form A column can be referenced in the form:
<synopsis> <synopsis>
<replaceable>correlation</replaceable>.<replaceable>columnname</replaceable> <replaceable>correlation</replaceable>.<replaceable>columnname</replaceable>
</synopsis> </synopsis>
...@@ -1426,7 +1426,7 @@ $1.somecolumn ...@@ -1426,7 +1426,7 @@ $1.somecolumn
where the <replaceable>operator</replaceable> token follows the syntax where the <replaceable>operator</replaceable> token follows the syntax
rules of <xref linkend="sql-syntax-operators">, or is one of the rules of <xref linkend="sql-syntax-operators">, or is one of the
key words <token>AND</token>, <token>OR</token>, and key words <token>AND</token>, <token>OR</token>, and
<token>NOT</token>, or is a qualified operator name in the form <token>NOT</token>, or is a qualified operator name in the form:
<synopsis> <synopsis>
<literal>OPERATOR(</><replaceable>schema</><literal>.</><replaceable>operatorname</><literal>)</> <literal>OPERATOR(</><replaceable>schema</><literal>.</><replaceable>operatorname</><literal>)</>
</synopsis> </synopsis>
...@@ -1714,7 +1714,7 @@ CAST ( <replaceable>expression</replaceable> AS <replaceable>type</replaceable> ...@@ -1714,7 +1714,7 @@ CAST ( <replaceable>expression</replaceable> AS <replaceable>type</replaceable>
casts that are marked <quote>OK to apply implicitly</> casts that are marked <quote>OK to apply implicitly</>
in the system catalogs. Other casts must be invoked with in the system catalogs. Other casts must be invoked with
explicit casting syntax. This restriction is intended to prevent explicit casting syntax. This restriction is intended to prevent
surprising conversions from being applied silently. surprising conversions from being silently applied.
</para> </para>
<para> <para>
...@@ -1730,7 +1730,7 @@ CAST ( <replaceable>expression</replaceable> AS <replaceable>type</replaceable> ...@@ -1730,7 +1730,7 @@ CAST ( <replaceable>expression</replaceable> AS <replaceable>type</replaceable>
<literal>timestamp</> can only be used in this fashion if they are <literal>timestamp</> can only be used in this fashion if they are
double-quoted, because of syntactic conflicts. Therefore, the use of double-quoted, because of syntactic conflicts. Therefore, the use of
the function-like cast syntax leads to inconsistencies and should the function-like cast syntax leads to inconsistencies and should
probably be avoided in new applications. probably be avoided.
</para> </para>
<note> <note>
...@@ -1794,7 +1794,7 @@ SELECT name, (SELECT max(pop) FROM cities WHERE cities.state = states.name) ...@@ -1794,7 +1794,7 @@ SELECT name, (SELECT max(pop) FROM cities WHERE cities.state = states.name)
<para> <para>
An array constructor is an expression that builds an An array constructor is an expression that builds an
array value from values for its member elements. A simple array array using values for its member elements. A simple array
constructor constructor
consists of the key word <literal>ARRAY</literal>, a left square bracket consists of the key word <literal>ARRAY</literal>, a left square bracket
<literal>[</>, a list of expressions (separated by commas) for the <literal>[</>, a list of expressions (separated by commas) for the
...@@ -1925,8 +1925,8 @@ SELECT ARRAY(SELECT oid FROM pg_proc WHERE proname LIKE 'bytea%'); ...@@ -1925,8 +1925,8 @@ SELECT ARRAY(SELECT oid FROM pg_proc WHERE proname LIKE 'bytea%');
</indexterm> </indexterm>
<para> <para>
A row constructor is an expression that builds a row value (also A row constructor is an expression that builds a row (also
called a composite value) from values called a composite value) using values
for its member fields. A row constructor consists of the key word for its member fields. A row constructor consists of the key word
<literal>ROW</literal>, a left parenthesis, zero or more <literal>ROW</literal>, a left parenthesis, zero or more
expressions (separated by commas) for the row field values, and finally expressions (separated by commas) for the row field values, and finally
......
This diff is collapsed.
This diff is collapsed.
<!-- $PostgreSQL: pgsql/doc/src/sgml/xfunc.sgml,v 1.136 2008/12/18 18:20:33 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/xfunc.sgml,v 1.137 2009/04/27 16:27:36 momjian Exp $ -->
<sect1 id="xfunc"> <sect1 id="xfunc">
<title>User-Defined Functions</title> <title>User-Defined Functions</title>
...@@ -2866,7 +2866,7 @@ typedef struct ...@@ -2866,7 +2866,7 @@ typedef struct
/* /*
* OPTIONAL pointer to struct containing tuple description * OPTIONAL pointer to struct containing tuple description
* *
* tuple_desc is for use when returning tuples (i.e. composite data types) * tuple_desc is for use when returning tuples (i.e., composite data types)
* and is only needed if you are going to build the tuples with * and is only needed if you are going to build the tuples with
* heap_form_tuple() rather than with BuildTupleFromCStrings(). Note that * heap_form_tuple() rather than with BuildTupleFromCStrings(). Note that
* the TupleDesc pointer stored here should usually have been run through * the TupleDesc pointer stored here should usually have been run through
......
<!-- $PostgreSQL: pgsql/doc/src/sgml/xml2.sgml,v 1.5 2008/05/08 16:49:37 tgl Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/xml2.sgml,v 1.6 2009/04/27 16:27:36 momjian Exp $ -->
<sect1 id="xml2"> <sect1 id="xml2">
<title>xml2</title> <title>xml2</title>
...@@ -173,7 +173,7 @@ ...@@ -173,7 +173,7 @@
<entry> <entry>
<para> <para>
the name of the <quote>key</> field &mdash; this is just a field to be used as the name of the <quote>key</> field &mdash; this is just a field to be used as
the first column of the output table, i.e. it identifies the record from the first column of the output table, i.e., it identifies the record from
which each output row came (see note below about multiple values) which each output row came (see note below about multiple values)
</para> </para>
</entry> </entry>
......
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