11<!--
2- $Header: /cvsroot/pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.28 2000/03/11 13:56:23 petere Exp $
2+ $Header: /cvsroot/pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.29 2000/03/21 01:52:12 momjian Exp $
33Postgres documentation
44-->
55
@@ -70,16 +70,19 @@ Postgres documentation
7070 told about those parameters via command line options, namely <option>-d</option>,
7171 <option>-h</option>, <option>-p</option>, and <option>-U</option> respectively.
7272 If an argument is found that does not belong to any option it will be interpreted
73- as database name as well. Not all these options are required, defaults do apply.
74- If you omit the host name psql will connect via domain sockets to a server on the
73+ as the database name (or the user name, if the database name is also
74+ given). Not all these options are required, defaults do apply.
75+ If you omit the host name psql will connect via a UNIX domain socket
76+ to a server on the
7577 local host. The default port number is compile-time determined. Since the database
76- server uses the same default, chances are you don't have to specify the port in most
77- settings. The default user name is your Unix username, the same with the database.
78+ server uses the same default, you will not have to specify the port in most
79+ cases. The default user name is your Unix username, as is the default
80+ database name.
7881 Note that you can't just connect to any database under any username. Your database
7982 administrator should have informed you about your access rights. To save you some typing
8083 you can also set the environment variables <envar>PGDATABASE</envar>,
81- <envar>PGHOST</envar>, <envar>PGPORT</envar>, <envar>PGUSER</envar>,
82- respectively to appropriate values.
84+ <envar>PGHOST</envar>, <envar>PGPORT</envar> and <envar>PGUSER</envar>
85+ to appropriate values.
8386 </para>
8487
8588 <para>
@@ -98,8 +101,8 @@ Postgres documentation
98101
99102 <para>
100103 In normal operation, <application>psql</application> provides a prompt with
101- the name of the databasethat <application>psql</application> is currently
102- connected to followed by the string "=>". For example,
104+ the name of the databaseto which <application>psql</application> is currently
105+ connected, followed by the string "=>". For example,
103106<programlisting>
104107$ <userinput>psql testdb</userinput>
105108Welcome to psql, the PostgreSQL interactive terminal.
@@ -118,7 +121,7 @@ testdb=>
118121 At the prompt, the user may type in <acronym>SQL</acronym> queries.
119122 Ordinarily, input lines are sent to the backend when a query-terminating
120123 semicolon is reached. An end of line does not terminate a query! Thus queries
121- can be spread overserveral lines for clarity. If the query was sent and without
124+ can be spread overseveral lines for clarity. If the query was sent and without
122125 error, the query results are displayed on the screen.
123126 </para>
124127
@@ -141,7 +144,7 @@ testdb=>
141144 <para>
142145 Anything you enter in <application>psql</application> that begins with an
143146 unquoted backslash is a <application>psql</application> meta-command that is
144- processes by <application>psql</application> itself.
147+ processed by <application>psql</application> itself.
145148 These commands are what makes
146149 <application>psql</application> interesting for administration or scripting.
147150 Meta-commands are more commonly called slash or backslash commands.
@@ -156,7 +159,7 @@ testdb=>
156159
157160 <para>
158161 To include whitespace into an argument you must quote it with a single
159- quote. To include a single quote into such an argument,preceed it by
162+ quote. To include a single quote into such an argument,precede it by
160163 a backslash. Anything contained in single quotes is furthermore subject to
161164 C-like substitutions for <literal>\n</literal> (new line), <literal>\t</literal>
162165 (tab), <literal>\</literal><replaceable>digits</replaceable>,
@@ -271,17 +274,17 @@ testdb=>
271274 <para>
272275 Performs a frontend (client) copy. This is an operation that runs an
273276<acronym>SQL</acronym> <xref linkend="SQL-COPY" endterm="SQL-COPY-title"> command,
274- but instead of the backend reading or writing the specified file, and
277+ but instead of the backend's reading or writing the specified file, and
275278 consequently requiring backend access and special user privilege,
276279as well as being bound to the file system accessible by the backend,
277280 <application>psql</application> reads or writes the
278- file and routes the datato or from the backendonto the local file system.
281+ file and routes the databetween the backendand the local file system.
279282</para>
280283
281284<para>
282- The syntax of the command isin analogy to the <acronym>SQL</acronym>
283- <command>COPY</command> command, see its description for the details.
284- Note that because of this, special parsing rules apply to the
285+ The syntax of the command issimilar to that of the <acronym>SQL</acronym>
286+ <command>COPY</command> command ( see its description for the details) .
287+ Note that, because of this, special parsing rules apply to the
285288<command>\copy</command> command. In particular, the variable
286289substitution rules and backslash escapes do not apply.
287290</para>
@@ -298,10 +301,10 @@ testdb=>
298301 <note>
299302 <para>
300303 Note the difference in interpretation of <literal>stdin</literal> and <literal>stdout</literal>
301- between frontend and backend copies:In a frontend copy these always refer
304+ between frontend and backend copies:in a frontend copy these always refer
302305 to <application>psql</application>'s input and output stream. On a backend
303- copy <literal>stdin</literal> comes fromwhereever the <command>COPY</command>
304- itself came from (for example, a scriptran with the <option>-f</option>) option,
306+ copy <literal>stdin</literal> comes fromwherever the <command>COPY</command>
307+ itself came from (for example, a scriptrun with the <option>-f</option> option) ,
305308 and <literal>stdout</literal> refers to the query output stream (see
306309 <command>\o</command> meta-command below).
307310 </para>
@@ -483,7 +486,7 @@ testdb=>
483486 <listitem>
484487 <para>
485488 If <replaceable class="parameter">filename</replaceable> is specified,
486- the file is edited and after the editorexit its content is copied
489+ the file is edited; after the editorexits, its content is copied
487490 back to the query buffer. If no argument is given, the current query
488491 buffer is copied to a temporary file which is then edited in the same
489492 fashion.
@@ -840,7 +843,7 @@ lo_import 152801
840843 </para>
841844
842845 <para>
843- Expanded mode issupport by all four output modes.
846+ Expanded mode issupported by all four output modes.
844847 </para>
845848 </listitem>
846849 </varlistentry>
@@ -913,7 +916,7 @@ lo_import 152801
913916 <term><literal>tableattr</literal> (or <literal>T</literal>) [ <replaceable class="parameter">text</replaceable> ]</term>
914917 <listitem>
915918 <para>
916- Allows you to specify any attributes to beplaces inside the <acronym>HTML</acronym>
919+ Allows you to specify any attributes to beplaced inside the <acronym>HTML</acronym>
917920 <sgmltag>table</sgmltag> tag. This could for example be
918921 <literal>cellpadding</literal> or <literal>bgcolor</literal>. Note that you
919922 probably don't want to specify <literal>border</literal> here, as
@@ -1014,9 +1017,9 @@ lo_import 152801
10141017<note>
10151018<para>
10161019As of <application>psql</application> version 7.0 it is no longer
1017- necessary, in fact, to save the command history as that will be done
1018- automatically on program termination. The history is then
1019- alsoautomatically loaded every time <application>psql</application>
1020+ necessary to save the command history, since that will be done
1021+ automatically on program termination. The history is
1022+ also loaded automatically every time <application>psql</application>
10201023starts up.
10211024</para>
10221025</note>
@@ -1032,7 +1035,7 @@ lo_import 152801
10321035Sets the internal variable <replaceable class="parameter">name</replaceable>
10331036to <replaceable class="parameter">value</replaceable> or, if more than one
10341037 value is given, to the concatenation of all of them. If no second argument
1035- is given, the variable is just set withnot value. To unset a variable, use
1038+ is given, the variable is just set withno value. To unset a variable, use
10361039 the <command>\unset</command> command.
10371040</para>
10381041
@@ -1042,8 +1045,8 @@ lo_import 152801
10421045</para>
10431046
10441047<para>
1045- Although you are welcome to set any variable to anything you want to ,
1046- <application>psql</application> treats several variables special.
1048+ Although you are welcome to set any variable to anything you want,
1049+ <application>psql</application> treats several variablesas special.
10471050They are documented in the section about variables.
10481051</para>
10491052
@@ -1237,8 +1240,8 @@ Access permissions for database "test"
12371240 that is completely parseable by the backend (i.e., it contains no <application>psql</application>
12381241 specific features), or it is a single backslash command. Thus
12391242 you cannot mix <acronym>SQL</acronym> and <application>psql</application>
1240- meta-commands. To achievethis you could pipe the string into
1241- <application>psql</application>, likeso :
1243+ meta-commands. To achievethat, you could pipe the string into
1244+ <application>psql</application>, likethis :
12421245 <literal>echo "\x \\ select * from foo;" | psql</literal>.
12431246 </para>
12441247 </listitem>
@@ -1273,7 +1276,7 @@ Access permissions for database "test"
12731276 <term>-E, --echo-hidden</term>
12741277 <listitem>
12751278 <para>
1276- Echos the actual queries generated by \d and other backslash commands.
1279+ Echoes the actual queries generated by \d and other backslash commands.
12771280 You can use this if you wish to include similar functionality into
12781281 your own programs. This is equivalent to setting the variable
12791282 <envar>ECHO_HIDDEN</envar> from within <application>psql</application>.
@@ -1431,15 +1434,15 @@ Access permissions for database "test"
14311434 <term>-S, --single-line</term>
14321435 <listitem>
14331436 <para>
1434- Runs in single-line mode where a newline terminates a query,like a semicolonwould do .
1437+ Runs in single-line mode where a newline terminates a query,as a semicolondoes .
14351438 </para>
14361439
14371440 <note>
14381441 <para>
14391442 This mode is provided for those who insist on it, but you are not necessarily
14401443 encouraged to use it. In particular, if you mix <acronym>SQL</acronym> and
14411444 meta-commands on a line the order of execution might not always be clear to
1442- theunexperienced user.
1445+ theinexperienced user.
14431446 </para>
14441447 </note>
14451448 </listitem>
@@ -1451,7 +1454,7 @@ Access permissions for database "test"
14511454 <listitem>
14521455 <para>
14531456 Turn off printing of column names and result row count footers, etc.
1454- It is completely equivalent to the <command>\t</command>.
1457+ It is completely equivalent to the <command>\t</command> meta-command .
14551458 </para>
14561459 </listitem>
14571460 </varlistentry>
@@ -1505,7 +1508,7 @@ Access permissions for database "test"
15051508 Note that you must separate name and value, if any, by an equal sign on the command
15061509 line. To unset a variable, leave off the equal sign. These assignments are done
15071510 during a very early state of startup, so variables reserved for internal purposes
1508- might get overwrittenagain .
1511+ might get overwrittenlater .
15091512 </para>
15101513 </listitem>
15111514 </varlistentry>
@@ -1771,16 +1774,16 @@ bar
17711774 interface to specially store data that does not fit into one tuple,
17721775 all the operations must be contained in a transaction block. (See the
17731776 documentation of the large object interface for more information.) Since
1774- <application>psql</application> has no way tokeep track if you already
1777+ <application>psql</application> has no way totell if you already
17751778 have a transaction in progress when you call one of its internal
17761779 commands <command>\lo_export</command>, <command>\lo_import</command>,
17771780 <command>\lo_unlink</command> it must take some arbitrary action. This
17781781 action could either be to roll back any transaction that might already
17791782 be in progress, or to commit any such transaction, or to do nothing at
1780- all. In thelatter case you must provideyou own
1783+ all. In thelast case you must provideyour own
17811784 <command>BEGIN TRANSACTION</command>/<command>COMMIT</command> block or
17821785 the results will be unpredictable (usually resulting in the desired
1783- action not being performed in any case).
1786+ action's not being performed in any case).
17841787</para>
17851788
17861789<para>
@@ -1800,7 +1803,7 @@ bar
18001803<para>
18011804By default, if non-interactive scripts encounter an error, such as a
18021805malformed <acronym>SQL</acronym> query or internal meta-command,
1803- processing continues. Thisis has been the traditional behaviour of
1806+ processing continues. This has been the traditional behaviour of
18041807 <application>psql</application> but it is sometimes not desirable. If this variable
18051808is set, script processing will immediately terminate. If the script was
18061809called from another script it will terminate in the same fashion.
@@ -1816,7 +1819,7 @@ bar
18161819 <term><envar>PORT</envar></term>
18171820<listitem>
18181821<para>
1819- The database server port you are currently connected to . This is seteverytime
1822+ The database server portto which you are currently connected. This is setevery time
18201823 you connect to a database (including program startup), but can be unset.
18211824</para>
18221825</listitem>
@@ -1848,7 +1851,7 @@ bar
18481851 <term><envar>SINGLELINE</envar></term>
18491852<listitem>
18501853<para>
1851- This variable is setbe the command lineoptions <option>-S</option>. You
1854+ This variable is setby the command lineoption <option>-S</option>. You
18521855can unset or reset it at run time.
18531856</para>
18541857</listitem>
@@ -1867,7 +1870,7 @@ bar
18671870 <term><envar>USER</envar></term>
18681871<listitem>
18691872<para>
1870- The database user you are currently connected as. This is seteverytime
1873+ The database user you are currently connected as. This is setevery time
18711874 you connect to a database (including program startup), but can be unset.
18721875</para>
18731876</listitem>
@@ -1972,7 +1975,7 @@ testdb=> <userinput>\set content `sed -e "s/'/\\\\\\'/g" < my_file.txt`</userinp
19721975
19731976 <varlistentry>
19741977 <term><literal>%m</literal></term>
1975- <listitem><para>The hostname of the database server truncated after the
1978+ <listitem><para>The hostname of the database server, truncated after the
19761979 first dot.</para></listitem>
19771980 </varlistentry>
19781981