Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id E246C9FA135 for ; Tue, 5 Dec 2006 19:26:11 -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 60085-06 for ; Tue, 5 Dec 2006 19:26:07 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail01.enterprisedb.com (mail01.enterprisedb.com [63.246.7.168]) by postgresql.org (Postfix) with ESMTP id 6D8169FA0FB for ; Tue, 5 Dec 2006 19:26:07 -0400 (AST) thread-index: AccYxL85Musmd/tQSIK5x073lpiXTw== Received: from [192.168.0.20] ([84.12.196.220]) by mail01.enterprisedb.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 5 Dec 2006 18:26:10 -0500 Subject: Re: psql man page error? Content-Class: urn:content-classes:message Importance: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2757 From: "Simon Riggs" To: "Bruce Momjian" Cc: "Tom Lane" , In-Reply-To: <200612052316.kB5NGq307285@momjian.us> References: <200612052316.kB5NGq307285@momjian.us> Content-Type: text/plain; charset="iso-8859-1" Date: Tue, 05 Dec 2006 23:25:42 +0000 Message-ID: <1165361142.3839.281.camel@silverbirch.site> MIME-Version: 1.0 X-Mailer: Evolution 2.6.0 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 05 Dec 2006 23:26:10.0218 (UTC) FILETIME=[BF1A58A0:01C718C4] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/11 X-Sequence-Number: 3934 On Tue, 2006-12-05 at 18:16 -0500, Bruce Momjian wrote: > 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? Well, it works, but IMHO its not as clear. -- Simon Riggs EnterpriseDB http://www.enterprisedb.com