Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id EF38C9F938C for ; Tue, 5 Dec 2006 19:17:02 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 59896-01 for ; Tue, 5 Dec 2006 19:16:56 -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 F2C909FA135 for ; Tue, 5 Dec 2006 19:16:55 -0400 (AST) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id kB5NGq307285; Tue, 5 Dec 2006 18:16:52 -0500 (EST) From: Bruce Momjian Message-Id: <200612052316.kB5NGq307285@momjian.us> Subject: Re: psql man page error? In-Reply-To: <8124.1165342485@sss.pgh.pa.us> To: Tom Lane Date: Tue, 5 Dec 2006 18:16:52 -0500 (EST) CC: Simon Riggs , pgsql-docs@postgresql.org X-Mailer: ELM [version 2.4ME+ PL123] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/10 X-Sequence-Number: 3933 Tom Lane wrote: > Bruce Momjian writes: > > I think the proper fix is: > > > psql, like this: echo -e > > "\\x\nSELECT * FROM foo;" | psql. > > > I think all modern operating systems understand echo -e at this point. > > No, they don't, and neither does the Single Unix Spec: > http://www.opengroup.org/onlinepubs/007908799/xcu/echo.html > > So your version of the example depends on non-standards-compliant > echo behavior, which is not better than before. Well, at least my example works on _some_ operating systems, while the previous worked on none of them, so it is _better_. I can't think of a good way to do this except converting the example to a block that will not change newlines: echo '\x SELECT * FROM foo;' | psql Is that what people want? -- Bruce Momjian bruce@momjian.us EnterpriseDB http://www.enterprisedb.com + If your life is a hard drive, Christ can be your backup. +