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

From Tom Lane
Subject Re: Suggested fix for \p and \r in psql
Date
Msg-id 31766.1491152060@sss.pgh.pa.us
Whole thread Raw
Responses Re: Suggested fix for \p and \r in psql  ("Daniel Verite" <daniel@manitou-mail.org>)
List pgsql-hackers
"Daniel Verite" <daniel@manitou-mail.org> writes:
> The documentation over-simplifies things as if there
> was only one query buffer, instead of two of them.

Yeah, there's a lot of oversimplification in the docs for slash commands
--- for instance, I was just noticing yesterday that there's no mention
of the variant argument-parsing behavior of slash commands that use
OT_WHOLE_LINE or OT_FILEPIPE parsing.  It would be good to make some
effort to improve that.  It seems like a separate question from what
the code should do, though.

My first thought about how to document the query-buffer behavior is
to continue to speak as though there is only one query buffer, but
to add, for example, for the \g command "If the query buffer is empty
then the most recent command is re-executed".

If we do phrase it like that, I think that the most natural behavior
for \r is the way I have it in HEAD --- you'd expect it to clear
the query buffer, but you would not expect it to forget the most
recent command.
        regards, tom lane



pgsql-hackers by date:

Previous
From: "Daniel Verite"
Date:
Subject: Re: Suggested fix for \p and \r in psql
Next
From: Fabien COELHO
Date:
Subject: Re: Undefined psql variables