1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

More minor updates and copy-editing.

This commit is contained in:
Tom Lane
2005-01-04 03:58:16 +00:00
parent 248d92ddf4
commit cc093bc3ad
10 changed files with 322 additions and 274 deletions

View File

@ -1,5 +1,5 @@
<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.126 2004/12/28 23:17:38 tgl Exp $
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.127 2005/01/04 03:58:16 tgl Exp $
PostgreSQL documentation
-->
@ -53,7 +53,7 @@ PostgreSQL documentation
<term><option>--echo-all</></term>
<listitem>
<para>
Print all the lines to the screen as they are read. This is more
Print all input lines to standard output as they are read. This is more
useful for script processing rather than interactive mode. This is
equivalent to setting the variable <varname>ECHO</varname> to
<literal>all</literal>.
@ -85,7 +85,7 @@ PostgreSQL documentation
<replaceable class="parameter">command</replaceable> must be either
a command string that is completely parsable by the server (i.e.,
it contains no <application>psql</application> specific features),
or it is a single backslash command. Thus you cannot mix
or a single backslash command. Thus you cannot mix
<acronym>SQL</acronym> and <application>psql</application>
meta-commands. To achieve that, you could pipe the string into
<application>psql</application>, like this: <literal>echo "\x \\
@ -119,7 +119,8 @@ PostgreSQL documentation
<term><option>--echo-queries</></term>
<listitem>
<para>
Show all commands that are sent to the server. This is equivalent
Copy all SQL commands sent to the server to standard output as well.
This is equivalent
to setting the variable <varname>ECHO</varname> to
<literal>queries</literal>.
</para>
@ -132,8 +133,8 @@ PostgreSQL documentation
<listitem>
<para>
Echo the actual queries generated by <command>\d</command> and other backslash
commands. You can use this if you wish to include similar
functionality into your own programs. This is equivalent to
commands. You can use this to study <application>psql</application>'s
internal operations. This is equivalent to
setting the variable <varname>ECHO_HIDDEN</varname> from within
<application>psql</application>.
</para>
@ -214,7 +215,7 @@ PostgreSQL documentation
<term><option>--list</></term>
<listitem>
<para>
List all available databases, then exits. Other non-connection
List all available databases, then exit. Other non-connection
options are ignored. This is similar to the internal command
<command>\list</command>.
</para>
@ -326,8 +327,7 @@ PostgreSQL documentation
<listitem>
<para>
Turn off printing of column names and result row count footers,
etc. It is completely equivalent to the <command>\t</command>
meta-command.
etc. This is equivalent to the <command>\t</command> command.
</para>
</listitem>
</varlistentry>
@ -396,7 +396,7 @@ PostgreSQL documentation
<term><option>--version</></term>
<listitem>
<para>
Show the <application>psql</application> version.
Print the <application>psql</application> version and exit.
</para>
</listitem>
</varlistentry>
@ -406,7 +406,7 @@ PostgreSQL documentation
<term><option>--password</></term>
<listitem>
<para>
Requests that <application>psql</application> should prompt for a
Cause <application>psql</application> to prompt for a
password before connecting to a database. This will remain set for
the entire session, even if you change the database connection
with the meta-command <command>\connect</command>.
@ -418,7 +418,7 @@ PostgreSQL documentation
requests password authentication. Because this is currently based
on a hack, the automatic recognition might mysteriously fail,
hence this option to force a prompt. If no password prompt is
issued and the server requires password authentication the
issued and the server requires password authentication, the
connection attempt will fail.
</para>
</listitem>
@ -452,7 +452,7 @@ PostgreSQL documentation
<listitem>
<para>
Show help about <application>psql</application> command line
arguments.
arguments, and exit.
</para>
</listitem>
</varlistentry>
@ -544,8 +544,8 @@ testdb=>
Ordinarily, input lines are sent to the server when a
command-terminating semicolon is reached. An end of line does not
terminate a command. Thus commands can be spread over several lines for
clarity. If the command was sent and without error, the results of the command
are displayed on the screen.
clarity. If the command was sent and executed without error, the results
of the command are displayed on the screen.
</para>
<para>
@ -563,8 +563,8 @@ testdb=>
Anything you enter in <application>psql</application> that begins
with an unquoted backslash is a <application>psql</application>
meta-command that is processed by <application>psql</application>
itself. These commands are what makes
<application>psql</application> interesting for administration or
itself. These commands help make
<application>psql</application> more useful for administration or
scripting. Meta-commands are more commonly called slash or backslash
commands.
</para>
@ -637,7 +637,7 @@ testdb=>
If the current table output format is unaligned, it is switched to aligned.
If it is not unaligned, it is set to unaligned. This command is
kept for backwards compatibility. See <command>\pset</command> for a
general solution.
more general solution.
</para>
</listitem>
</varlistentry>
@ -831,6 +831,7 @@ testdb=>
<varlistentry>
<term><literal>\db [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<term><literal>\db+ [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<listitem>
<para>
@ -991,6 +992,7 @@ testdb=>
<varlistentry>
<term><literal>\dn [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<term><literal>\dn+ [ <replaceable class="parameter">pattern</replaceable> ]</literal></term>
<listitem>
<para>
@ -1088,7 +1090,8 @@ testdb=>
<application>psql</application> searches the environment
variables <envar>PSQL_EDITOR</envar>, <envar>EDITOR</envar>, and
<envar>VISUAL</envar> (in that order) for an editor to use. If
all of them are unset, <filename>/bin/vi</filename> is run.
all of them are unset, <filename>vi</filename> is used on Unix
systems, <filename>notepad.exe</filename> on Windows systems.
</para>
</tip>
</listitem>
@ -1153,9 +1156,9 @@ Tue Oct 26 21:40:57 CEST 1999
<listitem>
<para>
Sends the current query input buffer to the server and
optionally saves the output in <replaceable
optionally stores the query's output in <replaceable
class="parameter">filename</replaceable> or pipes the output
into a separate Unix shell to execute <replaceable
into a separate Unix shell executing <replaceable
class="parameter">command</replaceable>. A bare
<literal>\g</literal> is virtually equivalent to a semicolon. A
<literal>\g</literal> with argument is a <quote>one-shot</quote>
@ -1582,7 +1585,7 @@ lo_import 152801
<listitem>
<para>
This command is identical to <command>\echo</command> except
that all output will be written to the query output channel, as
that the output will be written to the query output channel, as
set by <command>\o</command>.
</para>
</listitem>
@ -1921,7 +1924,7 @@ bar
<listitem>
<para>
If set to <literal>all</literal>, all lines
entered or from a script are written to the standard output
entered from the keyboard or from a script are written to the standard output
before they are parsed or executed. To select this behavior on program
start-up, use the switch <option>-a</option>. If set to
<literal>queries</literal>,
@ -2307,11 +2310,12 @@ testdb=> <userinput>\set content '\'' `sed -e "s/'/\\\\\\'/g" < my_file.txt` '\'
disconnected from the database (which can happen if
<command>\connect</command> fails). In prompt 2 the sequence is
replaced by <literal>-</literal>, <literal>*</literal>, a single quote,
or a double quote, depending on whether
a double quote, or a dollar sign, depending on whether
<application>psql</application> expects more input because the
command wasn't terminated yet, because you are inside a
<literal>/* ... */</literal> comment, or because you are inside
a quote. In prompt 3 the sequence doesn't produce anything.
a quoted or dollar-escaped string. In prompt 3 the sequence doesn't
produce anything.
</para>
</listitem>
</varlistentry>
@ -2416,7 +2420,7 @@ testdb=> \set PROMPT1 '%[%033[1;33;40m%]%n@%/%R%[%033[0m%#%] '
<application>psql</application> starts up. Tab-completion is also
supported, although the completion logic makes no claim to be an
<acronym>SQL</acronym> parser. If for some reason you do not like the tab completion, you
can turn if off by putting this in a file named
can turn it off by putting this in a file named
<filename>.inputrc</filename> in your home directory:
<programlisting>
$if psql
@ -2625,8 +2629,8 @@ Field separator is "oo".
<programlisting>
testdb=> <userinput>CREATE TABLE my_table (</userinput>
testdb(> <userinput> first integer not null default 0,</userinput>
testdb(> <userinput> second text</userinput>
testdb-> <userinput>);</userinput>
testdb(> <userinput> second text)</userinput>
testdb-> <userinput>;</userinput>
CREATE TABLE
</programlisting>
Now look at the table definition again:
@ -2657,7 +2661,7 @@ peter@localhost testdb=> SELECT * FROM my_table;
(4 rows)
</programlisting>
You can make this table look differently by using the
You can display tables in different ways by using the
<command>\pset</command> command:
<programlisting>
peter@localhost testdb=> <userinput>\pset border 2</userinput>