Re: Suggested fix for \p and \r in psql - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: Suggested fix for \p and \r in psql
Date
Msg-id alpine.DEB.2.20.1704021736080.4632@lancre
Whole thread Raw
In response to Suggested fix for \p and \r in psql  ("Daniel Verite" <daniel@manitou-mail.org>)
List pgsql-hackers
>> 1. \p ignores the "previous buffer". Example:
>
> Yeah, I did that intentionally, thinking that the old behavior was
> confusing.  We can certainly discuss it though.  I'd tend to agree
> with your point that \p and \w should print the same thing, but
> maybe neither of them should look at the previous_buf.

After some testing:

ISTM that \p should print what \g would execute, otherwise there is no 
consistent way to look at what \g would do.

Currently \e allows to look at this (previous) executed buffer by editing 
it, but I would find it more consistent if \p is in sync with that, and \e 
also coldly executes the command on return if it ends with ";".

>> 2. \r keeps the "previous buffer". I think it should clear it.
>
> I don't really agree with this.  The fact that it used to clear both
> buffers was an implementation accident that probably nobody had even
> understood clearly.  ISTM that loses functionality because you can't
> do \g anymore.

I agree on this one.

-- 
Fabien.



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Suggested fix for \p and \r in psql
Next
From: Corey Huinker
Date:
Subject: Re: Undefined psql variables