Re: Suggested fix for \p and \r in psql

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Daniel Verite <daniel(at)manitou-mail(dot)org>, PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Suggested fix for \p and \r in psql
Date: 2017-04-02 15:44:45
Message-ID: alpine.DEB.2.20.1704021736080.4632@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Corey Huinker 2017-04-02 15:58:00 Re: Undefined psql variables
Previous Message Tom Lane 2017-04-02 15:41:04 Re: Suggested fix for \p and \r in psql