Commit 0a8f6b79 authored by Tom Lane's avatar Tom Lane

Fix psql's \d and allied commands to work with all server versions back to 7.4.

Guillaume Lelarge, with some additional fixes by me.
parent 2c2aff6a
<!-- <!--
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.208 2008/06/11 10:48:16 heikki Exp $ $PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.209 2008/07/03 03:37:16 tgl Exp $
PostgreSQL documentation PostgreSQL documentation
--> -->
...@@ -407,7 +407,7 @@ PostgreSQL documentation ...@@ -407,7 +407,7 @@ PostgreSQL documentation
<listitem> <listitem>
<para> <para>
Force <application>psql</application> to prompt for a Force <application>psql</application> to prompt for a
password before connecting to a database. password before connecting to a database.
</para> </para>
<para> <para>
...@@ -459,7 +459,7 @@ PostgreSQL documentation ...@@ -459,7 +459,7 @@ PostgreSQL documentation
<option>-f</> option, adding this option wraps <option>-f</> option, adding this option wraps
<command>BEGIN</>/<command>COMMIT</> around the script to execute it <command>BEGIN</>/<command>COMMIT</> around the script to execute it
as a single transaction. This ensures that either all the commands as a single transaction. This ensures that either all the commands
complete successfully, or no changes are applied. complete successfully, or no changes are applied.
</para> </para>
<para> <para>
...@@ -542,8 +542,8 @@ PostgreSQL documentation ...@@ -542,8 +542,8 @@ PostgreSQL documentation
<para> <para>
An alternative way to specify connection parameters is in a An alternative way to specify connection parameters is in a
<parameter>conninfo</parameter> string, which is used instead of a <parameter>conninfo</parameter> string, which is used instead of a
database name. This mechanism give you very wide control over the database name. This mechanism give you very wide control over the
connection. For example: connection. For example:
<programlisting> <programlisting>
$ <userinput>psql "service=myservice sslmode=require"</userinput> $ <userinput>psql "service=myservice sslmode=require"</userinput>
...@@ -873,7 +873,7 @@ testdb=&gt; ...@@ -873,7 +873,7 @@ testdb=&gt;
Lists all available tablespaces. If <replaceable Lists all available tablespaces. If <replaceable
class="parameter">pattern</replaceable> class="parameter">pattern</replaceable>
is specified, only tablespaces whose names match the pattern are shown. is specified, only tablespaces whose names match the pattern are shown.
If <literal>+</literal> is appended to the command name, each object If <literal>+</literal> is appended to the command name, each object
is listed with its associated permissions. is listed with its associated permissions.
</para> </para>
</listitem> </listitem>
...@@ -1511,7 +1511,7 @@ lo_import 152801 ...@@ -1511,7 +1511,7 @@ lo_import 152801
<listitem> <listitem>
<para> <para>
Sets the output format to one of <literal>unaligned</literal>, Sets the output format to one of <literal>unaligned</literal>,
<literal>aligned</literal>, <literal>wrapped</literal>, <literal>aligned</literal>, <literal>wrapped</literal>,
<literal>html</literal>, <literal>html</literal>,
<literal>latex</literal>, or <literal>troff-ms</literal>. <literal>latex</literal>, or <literal>troff-ms</literal>.
Unique abbreviations are allowed. (That would mean one letter Unique abbreviations are allowed. (That would mean one letter
...@@ -2533,7 +2533,7 @@ testdb=&gt; <userinput>\set content '''' `sed -e "s/'/''/g" -e 's/\\/\\\\/g' &lt ...@@ -2533,7 +2533,7 @@ testdb=&gt; <userinput>\set content '''' `sed -e "s/'/''/g" -e 's/\\/\\\\/g' &lt
The full host name (with domain name) of the database server, The full host name (with domain name) of the database server,
or <literal>[local]</literal> if the connection is over a Unix or <literal>[local]</literal> if the connection is over a Unix
domain socket, or domain socket, or
<literal>[local:<replaceable>/dir/name</replaceable>]</literal>, <literal>[local:<replaceable>/dir/name</replaceable>]</literal>,
if the Unix domain socket is not at the compiled in default if the Unix domain socket is not at the compiled in default
location. location.
</para> </para>
...@@ -2857,28 +2857,24 @@ $endif ...@@ -2857,28 +2857,24 @@ $endif
<itemizedlist> <itemizedlist>
<listitem> <listitem>
<para> <para>
In an earlier life <application>psql</application> allowed the In an earlier life <application>psql</application> allowed the
first argument of a single-letter backslash command to start first argument of a single-letter backslash command to start
directly after the command, without intervening whitespace. For directly after the command, without intervening whitespace.
compatibility this is still supported to some extent, As of <productname>PostgreSQL</productname> 8.4 this is no
but we are not going to explain the details here as this use is longer allowed.
discouraged. If you get strange messages, keep this in mind.
For example:
<programlisting>
testdb=&gt; <userinput>\foo</userinput>
Field separator is "oo".
</programlisting>
which is perhaps not what one would expect.
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
<para> <para>
<application>psql</application> only works smoothly with servers <application>psql</application> is only guaranteed to work smoothly
of the same version. That does not mean other combinations will with servers of the same version. That does not mean other combinations
fail outright, but subtle and not-so-subtle problems might come will fail outright, but subtle and not-so-subtle problems might come
up. Backslash commands are particularly likely to fail if the up. Backslash commands are particularly likely to fail if the
server is of a different version. server is of a newer version than <application>psql</> itself. However,
backslash commands of the <literal>\d</> family should work with
servers of versions back to 7.4, though not necessarily with servers
newer than <application>psql</> itself.
</para> </para>
</listitem> </listitem>
......
This diff is collapsed.
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