Re: Correct handling of blank/commented lines in PSQL interactive-mode history

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Greg Nancarrow <gregn4422(at)gmail(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Correct handling of blank/commented lines in PSQL interactive-mode history
Date: 2021-11-29 15:58:44
Message-ID: 1260407.1638201524@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Dilger 2021-11-29 16:26:38 Re: Non-superuser subscription owners
Previous Message Arne Roland 2021-11-29 15:48:09 Re: Enforce work_mem per worker