Re: Correct handling of blank/commented lines in PSQL interactive-mode history
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>,
Greg Nancarrow <gregn4422@gmail.com>,
"David G. Johnston" <david.g.johnston@gmail.com>,
PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2021-11-29T15:58:44Z
Lists: pgsql-hackers
Alvaro Herrera <alvherre@alvh.no-ip.org> writes: > I wonder if these things would be easier to deal with or more convenient > if we thought of -- as starting a line-scoped comment, and /* */ as > starting a query-scoped comment, and treat both types differently. That > is, a -- comment would not be part of the subsequent command (and they > would become two separate history entries), but a /* */ comment would be > part of the command, and so both the comment and the query would be > saved as a single history entry. The hack I was fooling with yesterday would have had that effect, although it was a consequence of the fact that I was too lazy to parse slash-star comments ;-). But basically what I was trying to do was to force a line that was only whitespace (possibly plus dash-dash comment) to be treated as a separate history entry, while not suppressing dash-dash comments altogether as the current code does. regards, tom lane
Commits
-
psql: initialize comment-begin setting to a useful value by default.
- 3d858af07ee6 15.0 landed
-
psql: treat "--" comments between queries as separate history entries.
- c2f654930e9f 15.0 landed
-
psql: include intra-query "--" comments in what's sent to the server.
- 83884682f4df 15.0 landed