I have found that typing:

	test=> select * from pg_class\p\g

no longer works.  I honors the \p, but ignores the \g.

Any ideas Peter?

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Thu, 11 Nov 1999 13:21:34 -0500 (EST)
Bruce Momjian <maillist@candle.pha.pa.us>
psql and \p\g
I see that \e no longer works as expected:

	test=> select * from pg_class;
	...
	test=> \e

and in the editor, the query is not appearing.  The 'select' query
should appear in the editor because I have not entered a non-backslash
command to clear the query buffer.



-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Thu, 11 Nov 1999 13:27:04 -0500 (EST)
Bruce Momjian <maillist@candle.pha.pa.us>
failure of \e in psql
On 1999-11-11, Bruce Momjian mentioned:

> I have found that typing:
> 
> 	test=> select * from pg_class\p\g
> 
> no longer works.  I honors the \p, but ignores the \g.
> 
> Any ideas Peter?

select * from foo \p \g

This was done to normalize the grammar a little bit (haha, very
funny). In particular it allows this sort of stuff:
=> select * from foo \p \o out.txt \g \\ select * from foo 2 \x \g
etc.

Is it *really* necessary to be able to omit the space?

-- 
Peter Eisentraut                  Sernanders vaeg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden


Thu, 11 Nov 1999 22:36:26 +0100 (CET)
Peter Eisentraut <peter_e@gmx.net>
Re: psql and \p\g
On 1999-11-11, Bruce Momjian mentioned:

> I see that \e no longer works as expected:
> 
> 	test=> select * from pg_class;
> 	...
> 	test=> \e
> 
> and in the editor, the query is not appearing.  The 'select' query
> should appear in the editor because I have not entered a non-backslash
> command to clear the query buffer.

Well, once you send it, it's sent and gone. You have to edit it before you
send it. I guess I'm not following you. Of course you should somehow be
able to re-edit the previous query. Hmm.

-- 
Peter Eisentraut                  Sernanders vaeg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden


Thu, 11 Nov 1999 22:37:49 +0100 (CET)
Peter Eisentraut <peter_e@gmx.net>
Re: failure of \e in psql
> On 1999-11-11, Bruce Momjian mentioned:
> 
> > I have found that typing:
> > 
> > 	test=> select * from pg_class\p\g
> > 
> > no longer works.  I honors the \p, but ignores the \g.
> > 
> > Any ideas Peter?
> 
> select * from foo \p \g
> 
> This was done to normalize the grammar a little bit (haha, very
> funny). In particular it allows this sort of stuff:
> => select * from foo \p \o out.txt \g \\ select * from foo 2 \x \g
> etc.
> 
> Is it *really* necessary to be able to omit the space?
> 

Yes, I believe it is, in the sense that many people are used to doing
them together.  Can a backslash trigger some separation of commands, or
at least \p\g be recognized correctly.  I don't think there are other
meaningful combinations.

Can you add a unix-style timestamp for \T?

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Thu, 11 Nov 1999 16:50:18 -0500 (EST)
Bruce Momjian <maillist@candle.pha.pa.us>
Re: psql and \p\g
> On 1999-11-11, Bruce Momjian mentioned:
> 
> > I see that \e no longer works as expected:
> > 
> > 	test=> select * from pg_class;
> > 	...
> > 	test=> \e
> > 
> > and in the editor, the query is not appearing.  The 'select' query
> > should appear in the editor because I have not entered a non-backslash
> > command to clear the query buffer.
> 
> Well, once you send it, it's sent and gone. You have to edit it before you
> send it. I guess I'm not following you. Of course you should somehow be
> able to re-edit the previous query. Hmm.

That is how it used to work.  You run the query, get an error, and \e
pulls it into the editor for fixing.

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Thu, 11 Nov 1999 16:51:14 -0500 (EST)
Bruce Momjian <maillist@candle.pha.pa.us>
Re: failure of \e in psql
Bruce Momjian <maillist@candle.pha.pa.us> writes:
>> This was done to normalize the grammar a little bit (haha, very
>> funny). In particular it allows this sort of stuff:
>> => select * from foo \p \o out.txt \g \\ select * from foo 2 \x \g
>> etc.
>> 
>> Is it *really* necessary to be able to omit the space?

> Yes, I believe it is, in the sense that many people are used to doing
> them together.  Can a backslash trigger some separation of commands, or
> at least \p\g be recognized correctly.  I don't think there are other
> meaningful combinations.

It'd probably be sufficient if backslash-commands that never take
parameters can be adjacent to a following backslash command.

			regards, tom lane

Thu, 11 Nov 1999 17:16:12 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Re: psql and \p\g 
> On 1999-11-11, Bruce Momjian mentioned:
> 
> > I see that \e no longer works as expected:
> > 
> > 	test=> select * from pg_class;
> > 	...
> > 	test=> \e
> > 
> > and in the editor, the query is not appearing.  The 'select' query
> > should appear in the editor because I have not entered a non-backslash
> > command to clear the query buffer.
> 
> Well, once you send it, it's sent and gone. You have to edit it before you
> send it. I guess I'm not following you. Of course you should somehow be
> able to re-edit the previous query. Hmm.

Peter, before I go hunting around, can you tell me any other things psql
used to do that it doesn't do anymore?

We had hand-tuned psql over the years, and it would be good to know what
features no longer exist so we can decide if they are needed.

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Fri, 12 Nov 1999 01:07:46 -0500 (EST)
Bruce Momjian <maillist@candle.pha.pa.us>
Re: failure of \e in psql
On Thu, 11 Nov 1999, Bruce Momjian wrote:

> Can you add a unix-style timestamp for \T?

Do you mean \echo `date` ?

-- 
Peter Eisentraut                  Sernanders vaeg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden


Fri, 12 Nov 1999 11:04:03 +0100 (MET)
Peter Eisentraut <e99re41@DoCS.UU.SE>
Re: psql and \p\g
On Fri, 12 Nov 1999, Bruce Momjian wrote:

> Peter, before I go hunting around, can you tell me any other things psql
> used to do that it doesn't do anymore?

Well, let's put it this way: Everythings that used to work, that people
found useful, and that doesn't work anymore is a bug. That's what it's all
about after all.

However: About the \e thing I simply didn't know. The \p\g was removed for
consistency. You might also be interested to know that \E no longer
exists, because I couldn't make sense of it. Also \d* is slated for
implementation but no one wanted to respond to my request to explain what
this is actually supposed to do. That's all I can come up with right now.

> We had hand-tuned psql over the years, and it would be good to know what
> features no longer exist so we can decide if they are needed.

Well, I really comes down to what Tom said, doesn't it: If the docs don't
match the code, the code it wrong. And it will get fixed. A lot of those
"tunings" seemed to be of the nature "If I put \o after \x I want it to do
<foo> instead".

That doesn't mean that they were bad of course, but the purpose of all of
this was to put a consistent face on things.

Having said that, if I mess it up I'll fix it of course.

-- 
Peter Eisentraut                  Sernanders vaeg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden


Fri, 12 Nov 1999 11:11:17 +0100 (MET)
Peter Eisentraut <e99re41@DoCS.UU.SE>
Re: failure of \e in psql
> On Thu, 11 Nov 1999, Bruce Momjian wrote:
> 
> > Can you add a unix-style timestamp for \T?
> 
> Do you mean \echo `date` ?
> 

Oh, very nifty.  Never mind.  I didn't see that.

Seems you have added more powerful flags to take over some of the old
flag usage. If you want to remove some of the older psql flags and
require them to use your newer syntax that allows more functionality,
you can do it.

If you want, just print an error message for the old flag showing them
the new syntax to use and we can remove the messages after a few
releases.

However, some of the more popular flags should probably be left in.
Maybe it should just be left alone.  Not sure.

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Fri, 12 Nov 1999 11:54:44 -0500 (EST)
Bruce Momjian <maillist@candle.pha.pa.us>
Re: psql and \p\g
> On Fri, 12 Nov 1999, Bruce Momjian wrote:
> 
> > Peter, before I go hunting around, can you tell me any other things psql
> > used to do that it doesn't do anymore?
> 
> Well, let's put it this way: Everythings that used to work, that people
> found useful, and that doesn't work anymore is a bug. That's what it's all
> about after all.
> 
> However: About the \e thing I simply didn't know. The \p\g was removed for
> consistency. You might also be interested to know that \E no longer
> exists, because I couldn't make sense of it. Also \d* is slated for
> implementation but no one wanted to respond to my request to explain what
> this is actually supposed to do. That's all I can come up with right now.

First, let me say I am very glad you overhauled psql.  It was very
needed, and I like the new functionality.  Already learned \echo `date`.
Quite handy and very flexible.

I was just curious if there was any stuff you found confusing and
skipped so we could comment on it all at once.

We have fixed the pager off by default, and looks like \p\g and \e need
work, but that is small compared to how much functionality does work
perfectly.  I personally found the \e and \p\g stuff very tricky to
implement.

[Of course, with the new output, I am going to have to re-do every one
of my SQL query outputs for the book.  :-) ]

No idea what \d* does, nor \E.  

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Fri, 12 Nov 1999 12:00:27 -0500 (EST)
Bruce Momjian <maillist@candle.pha.pa.us>
Re: failure of \e in psql
Peter, I no longer see the pg_description descriptions when using the
\do, \df, and \dT commands.

The commands are much less useful without the descriptions.  Seems \dd
with a string is much smarter, and pulls descriptions based on string
matching.

Interesting that \dd shows descriptions of everything.

Not sure how to recommend you change this.  The new \df and \do
displays are much clearer without the descriptions.  It seems \df and
\do show additional information about argument types and return values,
while \dd shows comments.

Maybe just add descriptions to \dT, and suggest people use \dd to get
info about specific operators of functions?  But that kind of messes the
clarity of using \dd for descriptions.

I am stumped.  Maybe it can't be improved.

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Sat, 13 Nov 1999 11:35:47 -0500 (EST)
Bruce Momjian <maillist@candle.pha.pa.us>
Failure to show descriptions in \df command
You can turn the descriptions on by typing \set description on (or \set
description foo, or whatever, as long as it's something), for example, in
your ~/.psqlrc (or in your .psqlrc-7.0.0 if you don't want to interfere
with the current version).

The reason for having descriptions off by default was that in a number of
views (I recall functions and operators), they don't fit on the screen
very nicely. On the other hand, the \dd command always shows descriptions,
because it's sort of the built-in manual, but it doesn't show anything
else (argument types, etc.).

Read the fine (SGML) manual ;)

	-Peter


On Sat, 13 Nov 1999, Bruce Momjian wrote:

> Peter, I no longer see the pg_description descriptions when using the
> \do, \df, and \dT commands.
> 
> The commands are much less useful without the descriptions.  Seems \dd
> with a string is much smarter, and pulls descriptions based on string
> matching.
> 
> Interesting that \dd shows descriptions of everything.
> 
> Not sure how to recommend you change this.  The new \df and \do
> displays are much clearer without the descriptions.  It seems \df and
> \do show additional information about argument types and return values,
> while \dd shows comments.
> 
> Maybe just add descriptions to \dT, and suggest people use \dd to get
> info about specific operators of functions?  But that kind of messes the
> clarity of using \dd for descriptions.
> 
> I am stumped.  Maybe it can't be improved.
> 
> 

-- 
Peter Eisentraut                  Sernanders vaeg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden


Sat, 13 Nov 1999 18:15:53 +0100 (MET)
Peter Eisentraut <e99re41@DoCS.UU.SE>
Re: Failure to show descriptions in \df command
> You can turn the descriptions on by typing \set description on (or \set
> description foo, or whatever, as long as it's something), for example, in
> your ~/.psqlrc (or in your .psqlrc-7.0.0 if you don't want to interfere
> with the current version).

OK. I noticed that the existance of an .psqlrc file causes an extra
newline to be printed on startup before the first prompt.  Is that
intentional?

> 
> The reason for having descriptions off by default was that in a number of
> views (I recall functions and operators), they don't fit on the screen
> very nicely. On the other hand, the \dd command always shows descriptions,
> because it's sort of the built-in manual, but it doesn't show anything
> else (argument types, etc.).

Got it.  Yes, much clearer for \df and \do.  I noticed that using \set
description on and then using \dT generates an error of:
	
	test=> \set description on
	test=> \dT
	ERROR:  Relation 'p' does not exist


Also, the \set commands don't seem to complain about bad commands:

	test=> \set figgle
	test=> 

Is that intentional?

> 
> Read the fine (SGML) manual ;)
> 

That was part of my problem.  I hadn't figured out how to generate html
from the sgml ref stuff.  I just spent some time and figured out I have
to issue the 'make' command from the upper sgml directory because there
is no Makefile in the sgml/ref directory.  I can view them fine now.

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Sat, 13 Nov 1999 13:19:19 -0500 (EST)
Bruce Momjian <maillist@candle.pha.pa.us>
Re: [HACKERS] Re: Failure to show descriptions in \df command