Re: Correct handling of blank/commented lines in PSQL interactive-mode history
Justin Pryzby <pryzby@telsasoft.com>
From: Justin Pryzby <pryzby@telsasoft.com>
To: "David G. Johnston" <david.g.johnston@gmail.com>
Cc: Greg Nancarrow <gregn4422@gmail.com>, pgsql-hackers@postgresql.org
Date: 2021-09-06T19:37:31Z
Lists: pgsql-hackers
On Mon, Sep 06, 2021 at 07:50:15AM -0700, David G. Johnston wrote: > On Mon, Sep 6, 2021 at 7:13 AM Greg Nancarrow <gregn4422@gmail.com> wrote: > > I've attached a patch that corrects the behaviour. > > For the type of lines mentioned, the patch makes the history behave > > more like Bash history. The behavior of bash is configurable here: |HISTCONTROL | A colon-separated list of values controlling how commands are saved on the history list. If the list of values includes ignorespace, lines which begin with a space character are not saved in the history | list.... > I have my doubts that you've really fixed anything here since Bash is a > line-oriented shell while psql is a statement-oriented one. This is a > feature. Hm, I don't think bash is "line oriented" ? You can type anything into it that you'd put in a shell script. For example: $ for a in `seq 1 3` > do > echo $a > done 1 2 3 -- Justin
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