Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 3E6CA9F9F46 for ; Wed, 6 Dec 2006 11:39:42 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 62784-08 for ; Wed, 6 Dec 2006 11:39:31 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from momjian.us (momjian.us [70.90.9.53]) by postgresql.org (Postfix) with ESMTP id 659259F93E5 for ; Wed, 6 Dec 2006 11:39:37 -0400 (AST) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id kB6FdYn14111; Wed, 6 Dec 2006 10:39:34 -0500 (EST) From: Bruce Momjian Message-Id: <200612061539.kB6FdYn14111@momjian.us> Subject: Re: psql man page error? In-Reply-To: <26001.1165418274@sss.pgh.pa.us> To: Tom Lane Date: Wed, 6 Dec 2006 10:39:34 -0500 (EST) CC: Peter Eisentraut , pgsql-docs@postgresql.org, Simon Riggs X-Mailer: ELM [version 2.4ME+ PL123] MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ELM1165419574-16504-0_" Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/21 X-Sequence-Number: 3944 --ELM1165419574-16504-0_ Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" Tom Lane wrote: > Bruce Momjian writes: > > Peter Eisentraut wrote: > >> Which is correct. Removing the \\ alters the point of the example. > > > Well, if it doesn't render \\ at the end of the line, the example isn't > > very clear unless you are looking at the SGML. > > No, you've completely misunderstood the original example. It's > intending to show a backslash-backslash terminator for the \x command, > not two lines of input, ie the equivalent of this: > > regression=# \x \\ select 1,2; > Expanded display is on. > -[ RECORD 1 ] > ?column? | 1 > ?column? | 2 You are right, I totally misunderstood it. New patch applied, that mentions \\ is a separator meta-command. I now see \\ documented farther down the file. I didn't know it did that. -- Bruce Momjian bruce@momjian.us EnterpriseDB http://www.enterprisedb.com + If your life is a hard drive, Christ can be your backup. + --ELM1165419574-16504-0_ Content-Transfer-Encoding: 7bit Content-Type: text/x-diff Content-Disposition: inline; filename="/bjm/diff" Index: doc/src/sgml/ref/psql-ref.sgml =================================================================== RCS file: /cvsroot/pgsql/doc/src/sgml/ref/psql-ref.sgml,v retrieving revision 1.176 diff -c -c -r1.176 psql-ref.sgml *** doc/src/sgml/ref/psql-ref.sgml 5 Dec 2006 17:40:55 -0000 1.176 --- doc/src/sgml/ref/psql-ref.sgml 6 Dec 2006 15:37:30 -0000 *************** *** 87,95 **** it contains no psql specific features), or a single backslash command. Thus you cannot mix SQL and psql ! meta-commands. To achieve that, you could pipe the string into ! psql, like this: echo -e ! "\\x\nSELECT * FROM foo;" | psql. If the command string contains multiple SQL commands, they are --- 87,96 ---- it contains no psql specific features), or a single backslash command. Thus you cannot mix SQL and psql ! meta-commands with this option. To achieve that, you could ! pipe the string into psql, like ! this: echo "\x \\ SELECT * FROM foo;" | psql. ! (\\ is the separator meta-command.) If the command string contains multiple SQL commands, they are --ELM1165419574-16504-0_--