Re: Suggested fix for \p and \r in psql
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: "Daniel Verite" <daniel@manitou-mail.org>
Cc: pgsql-hackers@postgresql.org
Date: 2017-04-02T16:54:20Z
Lists: 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
Commits
-
Doc: clarify behavior of OT_WHOLE_LINE and OT_FILEPIPE psql slash commands.
- ffac5998b4c1 10.0 landed
-
Document psql's behavior of recalling the previously executed query.
- 68dba97a4dea 10.0 landed
-
Fix behavior of psql's \p to agree with \g, \w, etc.
- 5dbc5da1187c 10.0 landed
-
Support \if ... \elif ... \else ... \endif in psql scripting.
- e984ef5861df 10.0 cited