From: | Bruce Momjian <bruce(at)momjian(dot)us> |
---|---|
To: | Simon Riggs <simon(at)2ndquadrant(dot)com> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-docs(at)postgresql(dot)org |
Subject: | Re: psql man page error? |
Date: | 2006-12-06 04:29:41 |
Message-ID: | 200612060429.kB64Tfa16970@momjian.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-docs |
Simon Riggs wrote:
> On Tue, 2006-12-05 at 18:16 -0500, Bruce Momjian wrote:
> > Tom Lane wrote:
> > > Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > > > I think the proper fix is:
> > >
> > > > <application>psql</application>, like this: <literal>echo -e
> > > > "\\x\nSELECT * FROM foo;" | psql</literal>.
> > >
> > > > 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 <programlisting> 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.
Well, it is even worse because some versions of echo automatically
interpret backslashes, so it would have to be \\x. I am thinking we
should just leave it as I have it now, unless we want to use 'awk' or
'perl' where we know the backslash behavior.
--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2006-12-06 05:25:26 | Re: psql man page error? |
Previous Message | Simon Riggs | 2006-12-05 23:25:42 | Re: psql man page error? |