pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feedpsql man page error?
17+ messages / 6 participants
[nested] [flat]
* psql man page error?
@ 2006-12-05 11:57 Simon Riggs <simon@2ndquadrant.com>
2006-12-05 17:22 ` Re: psql man page error? Jeff Frost <jeff@frostconsultingllc.com>
2006-12-05 17:41 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
0 siblings, 2 replies; 17+ messages in thread
From: Simon Riggs @ 2006-12-05 11:57 UTC (permalink / raw)
To: pgsql-docs
On the psql man page there is an example of how to perform multiple line
psql script as part of the -c option description.
The example given is
echo "\x \\ select * from foo;" | psql
which gives
prompt> echo "\x \\ select * from foo;" | psql
Expanded display is on.
invalid command \
i.e. doesn't work on bash. With bash the command should be:
echo -e "\x \n select * from foo;" | psql
which gives
prompt> echo -e "\x \n select * from foo;" | psql
Expanded display is on.
ERROR: relation "foo" does not exist
Does this mean there are multiple forms of the echo command, or is this
example just wrong?
--
Simon Riggs
EnterpriseDB http://www.enterprisedb.com
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: psql man page error?
2006-12-05 11:57 psql man page error? Simon Riggs <simon@2ndquadrant.com>
@ 2006-12-05 17:22 ` Jeff Frost <jeff@frostconsultingllc.com>
1 sibling, 0 replies; 17+ messages in thread
From: Jeff Frost @ 2006-12-05 17:22 UTC (permalink / raw)
To: Simon Riggs <simon@2ndquadrant.com>; +Cc: pgsql-docs
On Tue, 5 Dec 2006, Simon Riggs wrote:
> which gives
>
> prompt> echo "\x \\ select * from foo;" | psql
> Expanded display is on.
> invalid command \
>
> i.e. doesn't work on bash. With bash the command should be:
>
> echo -e "\x \n select * from foo;" | psql
>
> which gives
>
> prompt> echo -e "\x \n select * from foo;" | psql
> Expanded display is on.
> ERROR: relation "foo" does not exist
>
> Does this mean there are multiple forms of the echo command, or is this
> example just wrong?
I believe that /bin/echo and the bash built-in used to be slightly different,
although reviewing both man pages on my FC5 system seem to indicate that they
have the same command-line arguments.
It's also possible that I'm thinking back to my Solaris (2.5.1) days when the
built-in tcsh echo was in fact different than /bin/echo. That's why all my
scripts seem to call the binary and not the built-in.
Another possibility is that the original author had the options set in his
xpg_echo environment variable and forgot about it...or his distro was setting
it in a profile.d file.
--
Jeff Frost, Owner <jeff@frostconsultingllc.com>
Frost Consulting, LLC http://www.frostconsultingllc.com/
Phone: 650-780-7908 FAX: 650-649-1954
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: psql man page error?
2006-12-05 11:57 psql man page error? Simon Riggs <simon@2ndquadrant.com>
@ 2006-12-05 17:41 ` Bruce Momjian <bruce@momjian.us>
2006-12-05 18:14 ` Re: psql man page error? Tom Lane <tgl@sss.pgh.pa.us>
2006-12-06 11:03 ` Re: psql man page error? Peter Eisentraut <peter_e@gmx.net>
1 sibling, 2 replies; 17+ messages in thread
From: Bruce Momjian @ 2006-12-05 17:41 UTC (permalink / raw)
To: Simon Riggs <simon@2ndquadrant.com>; +Cc: pgsql-docs
Simon Riggs wrote:
>
> On the psql man page there is an example of how to perform multiple line
> psql script as part of the -c option description.
>
> The example given is
>
> echo "\x \\ select * from foo;" | psql
>
> which gives
>
> prompt> echo "\x \\ select * from foo;" | psql
> Expanded display is on.
> invalid command \
>
> i.e. doesn't work on bash. With bash the command should be:
>
> echo -e "\x \n select * from foo;" | psql
>
> which gives
>
> prompt> echo -e "\x \n select * from foo;" | psql
> Expanded display is on.
> ERROR: relation "foo" does not exist
>
> Does this mean there are multiple forms of the echo command, or is this
> example just wrong?
Intersting. This example has been around since at least 2002. The SGML
looks like this:
<application>psql</application>, like this: <literal>echo "\x \\
select * from foo;" | psql</literal>.
and I suppose the asumption was that the \\ would be at the end of the
output line, but in fact both HTML and manual pages just put the \\
anywhere on the line. 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.
Change applied to HEAD and 8.2.X.
--
Bruce Momjian bruce@momjian.us
EnterpriseDB http://www.enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: psql man page error?
2006-12-05 11:57 psql man page error? Simon Riggs <simon@2ndquadrant.com>
2006-12-05 17:41 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
@ 2006-12-05 18:14 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-12-05 19:57 ` Re: psql man page error? Simon Riggs <simon@2ndquadrant.com>
2006-12-05 23:16 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
1 sibling, 2 replies; 17+ messages in thread
From: Tom Lane @ 2006-12-05 18:14 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: Simon Riggs <simon@2ndquadrant.com>; pgsql-docs
Bruce Momjian <bruce@momjian.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.
regards, tom lane
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: psql man page error?
2006-12-05 11:57 psql man page error? Simon Riggs <simon@2ndquadrant.com>
2006-12-05 17:41 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
2006-12-05 18:14 ` Re: psql man page error? Tom Lane <tgl@sss.pgh.pa.us>
@ 2006-12-05 19:57 ` Simon Riggs <simon@2ndquadrant.com>
1 sibling, 0 replies; 17+ messages in thread
From: Simon Riggs @ 2006-12-05 19:57 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Bruce Momjian <bruce@momjian.us>; pgsql-docs
On Tue, 2006-12-05 at 13:14 -0500, Tom Lane wrote:
> Bruce Momjian <bruce@momjian.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.
So the -e is wrong, but the rest of the change was right. Guess we just
need to add a comment about "(you may need to use the -e option on echo
to get this to work on your OS)."
--
Simon Riggs
EnterpriseDB http://www.enterprisedb.com
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: psql man page error?
2006-12-05 11:57 psql man page error? Simon Riggs <simon@2ndquadrant.com>
2006-12-05 17:41 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
2006-12-05 18:14 ` Re: psql man page error? Tom Lane <tgl@sss.pgh.pa.us>
@ 2006-12-05 23:16 ` Bruce Momjian <bruce@momjian.us>
2006-12-05 23:25 ` Re: psql man page error? Simon Riggs <simon@2ndquadrant.com>
1 sibling, 1 reply; 17+ messages in thread
From: Bruce Momjian @ 2006-12-05 23:16 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Simon Riggs <simon@2ndquadrant.com>; pgsql-docs
Tom Lane wrote:
> Bruce Momjian <bruce@momjian.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?
--
Bruce Momjian bruce@momjian.us
EnterpriseDB http://www.enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: psql man page error?
2006-12-05 11:57 psql man page error? Simon Riggs <simon@2ndquadrant.com>
2006-12-05 17:41 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
2006-12-05 18:14 ` Re: psql man page error? Tom Lane <tgl@sss.pgh.pa.us>
2006-12-05 23:16 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
@ 2006-12-05 23:25 ` Simon Riggs <simon@2ndquadrant.com>
2006-12-06 04:29 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
0 siblings, 1 reply; 17+ messages in thread
From: Simon Riggs @ 2006-12-05 23:25 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-docs
On Tue, 2006-12-05 at 18:16 -0500, Bruce Momjian wrote:
> Tom Lane wrote:
> > Bruce Momjian <bruce@momjian.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.
--
Simon Riggs
EnterpriseDB http://www.enterprisedb.com
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: psql man page error?
2006-12-05 11:57 psql man page error? Simon Riggs <simon@2ndquadrant.com>
2006-12-05 17:41 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
2006-12-05 18:14 ` Re: psql man page error? Tom Lane <tgl@sss.pgh.pa.us>
2006-12-05 23:16 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
2006-12-05 23:25 ` Re: psql man page error? Simon Riggs <simon@2ndquadrant.com>
@ 2006-12-06 04:29 ` Bruce Momjian <bruce@momjian.us>
2006-12-06 05:25 ` Re: psql man page error? Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 17+ messages in thread
From: Bruce Momjian @ 2006-12-06 04:29 UTC (permalink / raw)
To: Simon Riggs <simon@2ndquadrant.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; pgsql-docs
Simon Riggs wrote:
> On Tue, 2006-12-05 at 18:16 -0500, Bruce Momjian wrote:
> > Tom Lane wrote:
> > > Bruce Momjian <bruce@momjian.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@momjian.us
EnterpriseDB http://www.enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: psql man page error?
2006-12-05 11:57 psql man page error? Simon Riggs <simon@2ndquadrant.com>
2006-12-05 17:41 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
2006-12-05 18:14 ` Re: psql man page error? Tom Lane <tgl@sss.pgh.pa.us>
2006-12-05 23:16 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
2006-12-05 23:25 ` Re: psql man page error? Simon Riggs <simon@2ndquadrant.com>
2006-12-06 04:29 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
@ 2006-12-06 05:25 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-12-06 14:14 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
0 siblings, 1 reply; 17+ messages in thread
From: Tom Lane @ 2006-12-06 05:25 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: Simon Riggs <simon@2ndquadrant.com>; pgsql-docs
Bruce Momjian <bruce@momjian.us> writes:
> 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.
The example as you have it now is directly contradictory to the
published spec.
I agree with Simon's suggestion to remove "-e" from the example
(thereby making it spec-compliant) and add a parenthetical remark
suggesting that standards-challenged versions of echo might need "-e".
regards, tom lane
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: psql man page error?
2006-12-05 11:57 psql man page error? Simon Riggs <simon@2ndquadrant.com>
2006-12-05 17:41 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
2006-12-05 18:14 ` Re: psql man page error? Tom Lane <tgl@sss.pgh.pa.us>
2006-12-05 23:16 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
2006-12-05 23:25 ` Re: psql man page error? Simon Riggs <simon@2ndquadrant.com>
2006-12-06 04:29 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
2006-12-06 05:25 ` Re: psql man page error? Tom Lane <tgl@sss.pgh.pa.us>
@ 2006-12-06 14:14 ` Bruce Momjian <bruce@momjian.us>
2006-12-06 15:26 ` Re: psql man page error? Bruno Wolff III <bruno@wolff.to>
0 siblings, 1 reply; 17+ messages in thread
From: Bruce Momjian @ 2006-12-06 14:14 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Simon Riggs <simon@2ndquadrant.com>; pgsql-docs
Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > 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.
>
> The example as you have it now is directly contradictory to the
> published spec.
>
> I agree with Simon's suggestion to remove "-e" from the example
> (thereby making it spec-compliant) and add a parenthetical remark
> suggesting that standards-challenged versions of echo might need "-e".
Well, I just tried Linux and FreeBSD bash (the default shell?) and they
both need '-e' to render '\n' as a newline, so I think we should just
leave it with '-e'. Following the spec doesn't help if our two major
operating systems don't follow the spec, plus the example doesn't work
on Win32 at all.
--
Bruce Momjian bruce@momjian.us
EnterpriseDB http://www.enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: psql man page error?
2006-12-05 11:57 psql man page error? Simon Riggs <simon@2ndquadrant.com>
2006-12-05 17:41 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
2006-12-05 18:14 ` Re: psql man page error? Tom Lane <tgl@sss.pgh.pa.us>
2006-12-05 23:16 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
2006-12-05 23:25 ` Re: psql man page error? Simon Riggs <simon@2ndquadrant.com>
2006-12-06 04:29 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
2006-12-06 05:25 ` Re: psql man page error? Tom Lane <tgl@sss.pgh.pa.us>
2006-12-06 14:14 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
@ 2006-12-06 15:26 ` Bruno Wolff III <bruno@wolff.to>
0 siblings, 0 replies; 17+ messages in thread
From: Bruno Wolff III @ 2006-12-06 15:26 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Simon Riggs <simon@2ndquadrant.com>; pgsql-docs
On Wed, Dec 06, 2006 at 09:14:01 -0500,
Bruce Momjian <bruce@momjian.us> wrote:
>
> Well, I just tried Linux and FreeBSD bash (the default shell?) and they
> both need '-e' to render '\n' as a newline, so I think we should just
> leave it with '-e'. Following the spec doesn't help if our two major
> operating systems don't follow the spec, plus the example doesn't work
> on Win32 at all.
If you need several lines of output, couldn't you use one echo for each
line and separate them with semicolons?
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: psql man page error?
2006-12-05 11:57 psql man page error? Simon Riggs <simon@2ndquadrant.com>
2006-12-05 17:41 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
@ 2006-12-06 11:03 ` Peter Eisentraut <peter_e@gmx.net>
2006-12-06 14:10 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
1 sibling, 1 reply; 17+ messages in thread
From: Peter Eisentraut @ 2006-12-06 11:03 UTC (permalink / raw)
To: pgsql-docs; +Cc: Bruce Momjian <bruce@momjian.us>; Simon Riggs <simon@2ndquadrant.com>
Am Dienstag, 5. Dezember 2006 18:41 schrieb Bruce Momjian:
> <application>psql</application>, like this: <literal>echo "\x \\
> select * from foo;" | psql</literal>.
>
> and I suppose the asumption was that the \\ would be at the end of the
> output line, but in fact both HTML and manual pages just put the \\
> anywhere on the line.
Which is correct. Removing the \\ alters the point of the example.
--
Peter Eisentraut
http://developer.postgresql.org/~petere/
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: psql man page error?
2006-12-05 11:57 psql man page error? Simon Riggs <simon@2ndquadrant.com>
2006-12-05 17:41 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
2006-12-06 11:03 ` Re: psql man page error? Peter Eisentraut <peter_e@gmx.net>
@ 2006-12-06 14:10 ` Bruce Momjian <bruce@momjian.us>
2006-12-06 15:17 ` Re: psql man page error? Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 17+ messages in thread
From: Bruce Momjian @ 2006-12-06 14:10 UTC (permalink / raw)
To: Peter Eisentraut <peter_e@gmx.net>; +Cc: pgsql-docs@postgresql.org, Simon Riggs <simon@2ndquadrant.com>
Peter Eisentraut wrote:
> Am Dienstag, 5. Dezember 2006 18:41 schrieb Bruce Momjian:
> > <application>psql</application>, like this: <literal>echo "\x \\
> > select * from foo;" | psql</literal>.
> >
> > and I suppose the asumption was that the \\ would be at the end of the
> > output line, but in fact both HTML and manual pages just put the \\
> > anywhere on the line.
>
> 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.
--
Bruce Momjian bruce@momjian.us
EnterpriseDB http://www.enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: psql man page error?
2006-12-05 11:57 psql man page error? Simon Riggs <simon@2ndquadrant.com>
2006-12-05 17:41 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
2006-12-06 11:03 ` Re: psql man page error? Peter Eisentraut <peter_e@gmx.net>
2006-12-06 14:10 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
@ 2006-12-06 15:17 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-12-06 15:39 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
0 siblings, 1 reply; 17+ messages in thread
From: Tom Lane @ 2006-12-06 15:17 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: Peter Eisentraut <peter_e@gmx.net>; pgsql-docs@postgresql.org, Simon Riggs <simon@2ndquadrant.com>
Bruce Momjian <bruce@momjian.us> 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
regards, tom lane
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: psql man page error?
2006-12-05 11:57 psql man page error? Simon Riggs <simon@2ndquadrant.com>
2006-12-05 17:41 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
2006-12-06 11:03 ` Re: psql man page error? Peter Eisentraut <peter_e@gmx.net>
2006-12-06 14:10 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
2006-12-06 15:17 ` Re: psql man page error? Tom Lane <tgl@sss.pgh.pa.us>
@ 2006-12-06 15:39 ` Bruce Momjian <bruce@momjian.us>
2006-12-06 15:42 ` Re: psql man page error? Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 17+ messages in thread
From: Bruce Momjian @ 2006-12-06 15:39 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Peter Eisentraut <peter_e@gmx.net>; pgsql-docs@postgresql.org, Simon Riggs <simon@2ndquadrant.com>
Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> 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. +
Attachments:
/bjm/diff (text/x-diff, 1.4K) download
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 <application>psql</application> specific features),
or a single backslash command. Thus you cannot mix
<acronym>SQL</acronym> and <application>psql</application>
! meta-commands. To achieve that, you could pipe the string into
! <application>psql</application>, like this: <literal>echo -e
! "\\x\nSELECT * FROM foo;" | psql</literal>.
</para>
<para>
If the command string contains multiple SQL commands, they are
--- 87,96 ----
it contains no <application>psql</application> specific features),
or a single backslash command. Thus you cannot mix
<acronym>SQL</acronym> and <application>psql</application>
! meta-commands with this option. To achieve that, you could
! pipe the string into <application>psql</application>, like
! this: <literal>echo "\x \\ SELECT * FROM foo;" | psql</literal>.
! (<literal>\\</> is the separator meta-command.)
</para>
<para>
If the command string contains multiple SQL commands, they are
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: psql man page error?
2006-12-05 11:57 psql man page error? Simon Riggs <simon@2ndquadrant.com>
2006-12-05 17:41 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
2006-12-06 11:03 ` Re: psql man page error? Peter Eisentraut <peter_e@gmx.net>
2006-12-06 14:10 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
2006-12-06 15:17 ` Re: psql man page error? Tom Lane <tgl@sss.pgh.pa.us>
2006-12-06 15:39 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
@ 2006-12-06 15:42 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-12-06 15:46 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
0 siblings, 1 reply; 17+ messages in thread
From: Tom Lane @ 2006-12-06 15:42 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: Peter Eisentraut <peter_e@gmx.net>; pgsql-docs@postgresql.org, Simon Riggs <simon@2ndquadrant.com>
Bruce Momjian <bruce@momjian.us> writes:
> ! pipe the string into <application>psql</application>, like
> ! this: <literal>echo "\x \\ SELECT * FROM foo;" | psql</literal>.
This should probably use single quotes not double, hm?
regards, tom lane
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: psql man page error?
2006-12-05 11:57 psql man page error? Simon Riggs <simon@2ndquadrant.com>
2006-12-05 17:41 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
2006-12-06 11:03 ` Re: psql man page error? Peter Eisentraut <peter_e@gmx.net>
2006-12-06 14:10 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
2006-12-06 15:17 ` Re: psql man page error? Tom Lane <tgl@sss.pgh.pa.us>
2006-12-06 15:39 ` Re: psql man page error? Bruce Momjian <bruce@momjian.us>
2006-12-06 15:42 ` Re: psql man page error? Tom Lane <tgl@sss.pgh.pa.us>
@ 2006-12-06 15:46 ` Bruce Momjian <bruce@momjian.us>
0 siblings, 0 replies; 17+ messages in thread
From: Bruce Momjian @ 2006-12-06 15:46 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Peter Eisentraut <peter_e@gmx.net>; pgsql-docs@postgresql.org, Simon Riggs <simon@2ndquadrant.com>
Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > ! pipe the string into <application>psql</application>, like
> > ! this: <literal>echo "\x \\ SELECT * FROM foo;" | psql</literal>.
>
> This should probably use single quotes not double, hm?
Yep, done.
--
Bruce Momjian bruce@momjian.us
EnterpriseDB http://www.enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
Attachments:
/rtmp/diff (text/x-diff, 1.1K) download
Index: doc/src/sgml/ref/psql-ref.sgml
===================================================================
RCS file: /cvsroot/pgsql/doc/src/sgml/ref/psql-ref.sgml,v
retrieving revision 1.177
diff -c -c -r1.177 psql-ref.sgml
*** doc/src/sgml/ref/psql-ref.sgml 6 Dec 2006 15:40:11 -0000 1.177
--- doc/src/sgml/ref/psql-ref.sgml 6 Dec 2006 15:46:30 -0000
***************
*** 89,95 ****
<acronym>SQL</acronym> and <application>psql</application>
meta-commands with this option. To achieve that, you could
pipe the string into <application>psql</application>, like
! this: <literal>echo "\x \\ SELECT * FROM foo;" | psql</literal>.
(<literal>\\</> is the separator meta-command.)
</para>
<para>
--- 89,95 ----
<acronym>SQL</acronym> and <application>psql</application>
meta-commands with this option. To achieve that, you could
pipe the string into <application>psql</application>, like
! this: <literal>echo '\x \\ SELECT * FROM foo;' | psql</literal>.
(<literal>\\</> is the separator meta-command.)
</para>
<para>
^ permalink raw reply [nested|flat] 17+ messages in thread
end of thread, other threads:[~2006-12-06 15:46 UTC | newest]
Thread overview: 17+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-12-05 11:57 psql man page error? Simon Riggs <simon@2ndquadrant.com>
2006-12-05 17:22 ` Jeff Frost <jeff@frostconsultingllc.com>
2006-12-05 17:41 ` Bruce Momjian <bruce@momjian.us>
2006-12-05 18:14 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-12-05 19:57 ` Simon Riggs <simon@2ndquadrant.com>
2006-12-05 23:16 ` Bruce Momjian <bruce@momjian.us>
2006-12-05 23:25 ` Simon Riggs <simon@2ndquadrant.com>
2006-12-06 04:29 ` Bruce Momjian <bruce@momjian.us>
2006-12-06 05:25 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-12-06 14:14 ` Bruce Momjian <bruce@momjian.us>
2006-12-06 15:26 ` Bruno Wolff III <bruno@wolff.to>
2006-12-06 11:03 ` Peter Eisentraut <peter_e@gmx.net>
2006-12-06 14:10 ` Bruce Momjian <bruce@momjian.us>
2006-12-06 15:17 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-12-06 15:39 ` Bruce Momjian <bruce@momjian.us>
2006-12-06 15:42 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-12-06 15:46 ` Bruce Momjian <bruce@momjian.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox