Thread: failure of \e in psql

failure of \e in psql

From
Bruce Momjian
Date:
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,
Pennsylvania19026
 


Re: failure of \e in psql

From
Peter Eisentraut
Date:
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



Re: failure of \e in psql

From
Bruce Momjian
Date:
> 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,
Pennsylvania19026
 


Re: failure of \e in psql

From
Bruce Momjian
Date:
> 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,
Pennsylvania19026
 


Re: failure of \e in psql

From
Peter Eisentraut
Date:
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



Re: failure of \e in psql

From
Bruce Momjian
Date:
> 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,
Pennsylvania19026
 


Failure to show descriptions in \df command

From
Bruce Momjian
Date:
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,
Pennsylvania19026
 


Re: Failure to show descriptions in \df command

From
Peter Eisentraut
Date:
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



Re: [HACKERS] Re: Failure to show descriptions in \df command

From
Bruce Momjian
Date:
> 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 ontest=> \dTERROR:  Relation 'p' does
notexist
 


Also, the \set commands don't seem to complain about bad commands:
test=> \set figgletest=> 

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,
Pennsylvania19026