Commit 9e292e3e authored by Bruce Momjian's avatar Bruce Momjian

More fixes for => and ->, use proper ampersand markups.

parent 2d16f7c4
<!-- <!--
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.130 2005/01/14 00:24:23 momjian Exp $ $PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.131 2005/01/22 22:31:52 momjian Exp $
PostgreSQL documentation PostgreSQL documentation
--> -->
...@@ -536,7 +536,7 @@ Type: \copyright for distribution terms ...@@ -536,7 +536,7 @@ Type: \copyright for distribution terms
\g or terminate with semicolon to execute query \g or terminate with semicolon to execute query
\q to quit \q to quit
testdb=> testdb=&gt;
</programlisting> </programlisting>
</para> </para>
...@@ -881,7 +881,7 @@ testdb=> ...@@ -881,7 +881,7 @@ testdb=>
types, relations (tables, views, indexes, sequences, large types, relations (tables, views, indexes, sequences, large
objects), rules, and triggers.) For example: objects), rules, and triggers.) For example:
<programlisting> <programlisting>
=> <userinput>\dd version</userinput> =&gt; <userinput>\dd version</userinput>
Object descriptions Object descriptions
Schema | Name | Object | Description Schema | Name | Object | Description
------------+---------+----------+--------------------------- ------------+---------+----------+---------------------------
...@@ -1107,7 +1107,7 @@ testdb=> ...@@ -1107,7 +1107,7 @@ testdb=>
space and followed by a newline. This can be useful to space and followed by a newline. This can be useful to
intersperse information in the output of scripts. For example: intersperse information in the output of scripts. For example:
<programlisting> <programlisting>
=> <userinput>\echo `date`</userinput> =&gt; <userinput>\echo `date`</userinput>
Tue Oct 26 21:40:57 CEST 1999 Tue Oct 26 21:40:57 CEST 1999
</programlisting> </programlisting>
If the first argument is an unquoted <literal>-n</literal> the trailing If the first argument is an unquoted <literal>-n</literal> the trailing
...@@ -1271,7 +1271,7 @@ Tue Oct 26 21:40:57 CEST 1999 ...@@ -1271,7 +1271,7 @@ Tue Oct 26 21:40:57 CEST 1999
large object. Optionally, it associates the given large object. Optionally, it associates the given
comment with the object. Example: comment with the object. Example:
<programlisting> <programlisting>
foo=> <userinput>\lo_import '/home/peter/pictures/photo.xcf' 'a picture of me'</userinput> foo=&gt; <userinput>\lo_import '/home/peter/pictures/photo.xcf' 'a picture of me'</userinput>
lo_import 152801 lo_import 152801
</programlisting> </programlisting>
The response indicates that the large object received object ID The response indicates that the large object received object ID
...@@ -1817,14 +1817,14 @@ lo_import 152801 ...@@ -1817,14 +1817,14 @@ lo_import 152801
<application>psql</application> meta-command <application>psql</application> meta-command
<command>\set</command>: <command>\set</command>:
<programlisting> <programlisting>
testdb=> <userinput>\set foo bar</userinput> testdb=&gt; <userinput>\set foo bar</userinput>
</programlisting> </programlisting>
sets the variable <literal>foo</literal> to the value sets the variable <literal>foo</literal> to the value
<literal>bar</literal>. To retrieve the content of the variable, precede <literal>bar</literal>. To retrieve the content of the variable, precede
the name with a colon and use it as the argument of any slash the name with a colon and use it as the argument of any slash
command: command:
<programlisting> <programlisting>
testdb=> <userinput>\echo :foo</userinput> testdb=&gt; <userinput>\echo :foo</userinput>
bar bar
</programlisting> </programlisting>
</para> </para>
...@@ -2154,8 +2154,8 @@ bar ...@@ -2154,8 +2154,8 @@ bar
this is again to prepend the variable name with a colon this is again to prepend the variable name with a colon
(<literal>:</literal>). (<literal>:</literal>).
<programlisting> <programlisting>
testdb=> <userinput>\set foo 'my_table'</userinput> testdb=&gt; <userinput>\set foo 'my_table'</userinput>
testdb=> <userinput>SELECT * FROM :foo;</userinput> testdb=&gt; <userinput>SELECT * FROM :foo;</userinput>
</programlisting> </programlisting>
would then query the table <literal>my_table</literal>. The value of would then query the table <literal>my_table</literal>. The value of
the variable is copied literally, so it can even contain unbalanced the variable is copied literally, so it can even contain unbalanced
...@@ -2171,15 +2171,15 @@ testdb=> <userinput>SELECT * FROM :foo;</userinput> ...@@ -2171,15 +2171,15 @@ testdb=> <userinput>SELECT * FROM :foo;</userinput>
copy the contents of a file into a table column. First load the file into a copy the contents of a file into a table column. First load the file into a
variable and then proceed as above. variable and then proceed as above.
<programlisting> <programlisting>
testdb=> <userinput>\set content '\'' `cat my_file.txt` '\''</userinput> testdb=&gt; <userinput>\set content '\'' `cat my_file.txt` '\''</userinput>
testdb=> <userinput>INSERT INTO my_table VALUES (:content);</userinput> testdb=&gt; <userinput>INSERT INTO my_table VALUES (:content);</userinput>
</programlisting> </programlisting>
One possible problem with this approach is that <filename>my_file.txt</filename> One possible problem with this approach is that <filename>my_file.txt</filename>
might contain single quotes. These need to be escaped so that might contain single quotes. These need to be escaped so that
they don't cause a syntax error when the second line is processed. This they don't cause a syntax error when the second line is processed. This
could be done with the program <command>sed</command>: could be done with the program <command>sed</command>:
<programlisting> <programlisting>
testdb=> <userinput>\set content '\'' `sed -e "s/'/\\\\\\'/g" < my_file.txt` '\''</userinput> testdb=&gt; <userinput>\set content '\'' `sed -e "s/'/\\\\\\'/g" < my_file.txt` '\''</userinput>
</programlisting> </programlisting>
Observe the correct number of backslashes (6)! It works Observe the correct number of backslashes (6)! It works
this way: After <application>psql</application> has parsed this this way: After <application>psql</application> has parsed this
...@@ -2384,7 +2384,7 @@ testdb=> <userinput>\set content '\'' `sed -e "s/'/\\\\\\'/g" < my_file.txt` '\' ...@@ -2384,7 +2384,7 @@ testdb=> <userinput>\set content '\'' `sed -e "s/'/\\\\\\'/g" < my_file.txt` '\'
<literal>%]</literal>. Multiple pairs of these may occur within <literal>%]</literal>. Multiple pairs of these may occur within
the prompt. For example, the prompt. For example,
<programlisting> <programlisting>
testdb=> \set PROMPT1 '%[%033[1;33;40m%]%n@%/%R%[%033[0m%#%] ' testdb=&gt; \set PROMPT1 '%[%033[1;33;40m%]%n@%/%R%[%033[0m%#%] '
</programlisting> </programlisting>
results in a boldfaced (<literal>1;</literal>) yellow-on-black results in a boldfaced (<literal>1;</literal>) yellow-on-black
(<literal>33;40</literal>) prompt on VT100-compatible, color-capable (<literal>33;40</literal>) prompt on VT100-compatible, color-capable
...@@ -2569,7 +2569,7 @@ $endif ...@@ -2569,7 +2569,7 @@ $endif
discouraged. If you get strange messages, keep this in mind. discouraged. If you get strange messages, keep this in mind.
For example For example
<programlisting> <programlisting>
testdb=> <userinput>\foo</userinput> testdb=&gt; <userinput>\foo</userinput>
Field separator is "oo". Field separator is "oo".
</programlisting> </programlisting>
which is perhaps not what one would expect. which is perhaps not what one would expect.
...@@ -2631,15 +2631,15 @@ Field separator is "oo". ...@@ -2631,15 +2631,15 @@ Field separator is "oo".
The first example shows how to spread a command over several lines of The first example shows how to spread a command over several lines of
input. Notice the changing prompt: input. Notice the changing prompt:
<programlisting> <programlisting>
testdb=> <userinput>CREATE TABLE my_table (</userinput> testdb=&gt; <userinput>CREATE TABLE my_table (</userinput>
testdb(> <userinput> first integer not null default 0,</userinput> testdb(> <userinput> first integer not null default 0,</userinput>
testdb(> <userinput> second text)</userinput> testdb(> <userinput> second text)</userinput>
testdb-> <userinput>;</userinput> testdb-&gt; <userinput>;</userinput>
CREATE TABLE CREATE TABLE
</programlisting> </programlisting>
Now look at the table definition again: Now look at the table definition again:
<programlisting> <programlisting>
testdb=> <userinput>\d my_table</userinput> testdb=&gt; <userinput>\d my_table</userinput>
Table "my_table" Table "my_table"
Attribute | Type | Modifier Attribute | Type | Modifier
-----------+---------+-------------------- -----------+---------+--------------------
...@@ -2649,13 +2649,13 @@ testdb=> <userinput>\d my_table</userinput> ...@@ -2649,13 +2649,13 @@ testdb=> <userinput>\d my_table</userinput>
</programlisting> </programlisting>
Now we change the prompt to something more interesting: Now we change the prompt to something more interesting:
<programlisting> <programlisting>
testdb=> <userinput>\set PROMPT1 '%n@%m %~%R%# '</userinput> testdb=&gt; <userinput>\set PROMPT1 '%n@%m %~%R%# '</userinput>
peter@localhost testdb=> peter@localhost testdb=&gt;
</programlisting> </programlisting>
Let's assume you have filled the table with data and want to take a Let's assume you have filled the table with data and want to take a
look at it: look at it:
<programlisting> <programlisting>
peter@localhost testdb=> SELECT * FROM my_table; peter@localhost testdb=&gt; SELECT * FROM my_table;
first | second first | second
-------+-------- -------+--------
1 | one 1 | one
...@@ -2668,9 +2668,9 @@ peter@localhost testdb=> SELECT * FROM my_table; ...@@ -2668,9 +2668,9 @@ peter@localhost testdb=> SELECT * FROM my_table;
You can display tables in different ways by using the You can display tables in different ways by using the
<command>\pset</command> command: <command>\pset</command> command:
<programlisting> <programlisting>
peter@localhost testdb=> <userinput>\pset border 2</userinput> peter@localhost testdb=&gt; <userinput>\pset border 2</userinput>
Border style is 2. Border style is 2.
peter@localhost testdb=> <userinput>SELECT * FROM my_table;</userinput> peter@localhost testdb=&gt; <userinput>SELECT * FROM my_table;</userinput>
+-------+--------+ +-------+--------+
| first | second | | first | second |
+-------+--------+ +-------+--------+
...@@ -2681,9 +2681,9 @@ peter@localhost testdb=> <userinput>SELECT * FROM my_table;</userinput> ...@@ -2681,9 +2681,9 @@ peter@localhost testdb=> <userinput>SELECT * FROM my_table;</userinput>
+-------+--------+ +-------+--------+
(4 rows) (4 rows)
peter@localhost testdb=> <userinput>\pset border 0</userinput> peter@localhost testdb=&gt; <userinput>\pset border 0</userinput>
Border style is 0. Border style is 0.
peter@localhost testdb=> <userinput>SELECT * FROM my_table;</userinput> peter@localhost testdb=&gt; <userinput>SELECT * FROM my_table;</userinput>
first second first second
----- ------ ----- ------
1 one 1 one
...@@ -2692,15 +2692,15 @@ first second ...@@ -2692,15 +2692,15 @@ first second
4 four 4 four
(4 rows) (4 rows)
peter@localhost testdb=> <userinput>\pset border 1</userinput> peter@localhost testdb=&gt; <userinput>\pset border 1</userinput>
Border style is 1. Border style is 1.
peter@localhost testdb=> <userinput>\pset format unaligned</userinput> peter@localhost testdb=&gt; <userinput>\pset format unaligned</userinput>
Output format is unaligned. Output format is unaligned.
peter@localhost testdb=> <userinput>\pset fieldsep ","</userinput> peter@localhost testdb=&gt; <userinput>\pset fieldsep ","</userinput>
Field separator is ",". Field separator is ",".
peter@localhost testdb=> <userinput>\pset tuples_only</userinput> peter@localhost testdb=&gt; <userinput>\pset tuples_only</userinput>
Showing only tuples. Showing only tuples.
peter@localhost testdb=> <userinput>SELECT second, first FROM my_table;</userinput> peter@localhost testdb=&gt; <userinput>SELECT second, first FROM my_table;</userinput>
one,1 one,1
two,2 two,2
three,3 three,3
...@@ -2708,11 +2708,11 @@ four,4 ...@@ -2708,11 +2708,11 @@ four,4
</programlisting> </programlisting>
Alternatively, use the short commands: Alternatively, use the short commands:
<programlisting> <programlisting>
peter@localhost testdb=> <userinput>\a \t \x</userinput> peter@localhost testdb=&gt; <userinput>\a \t \x</userinput>
Output format is aligned. Output format is aligned.
Tuples only is off. Tuples only is off.
Expanded display is on. Expanded display is on.
peter@localhost testdb=> <userinput>SELECT * FROM my_table;</userinput> peter@localhost testdb=&gt; <userinput>SELECT * FROM my_table;</userinput>
-[ RECORD 1 ]- -[ RECORD 1 ]-
first | 1 first | 1
second | one second | one
......
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