Re: Typo in psql doc

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: ludovic(dot)kuty(at)gmail(dot)com, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: Typo in psql doc
Date: 2021-04-14 14:12:02
Message-ID: 3487764.1618409522@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Michael Paquier <michael(at)paquier(dot)xyz> writes:
> On Tue, Apr 13, 2021 at 07:57:54AM +0000, PG Doc comments form wrote:
>> There is a spurious space inside the documentation:
>> \set HISTFILE ~/.psql_history- :DBNAME
>> instead of
>> \set HISTFILE ~/.psql_history-:DBNAME

> Both commands sey in your .psqlrc results in the same path being
> used, as I guess that psqlscanslash.l eats all the whitespaces
> in-between. So the documentation is not wrong here (see also commit
> e4c7619).

I think that e4c7619 may have been working around a since-fixed
limitation in variable expansion. [experiments ...] Ah, looks like
this behavior changed in 9.2, which is later than I would've guessed:

psql (9.1.24)
Type "help" for help.

regression=# \set FOO bar-:DBNAME
regression=# \echo :FOO
bar-:DBNAME

psql (9.2.24)
Type "help" for help.

regression=# \set FOO bar-:DBNAME
regression=# \echo :FOO
bar-regression

As you say, both ways now give the same result. Since it's not the
point of this example to illustrate \set's space-eating behavior,
it might be clearer to revert the addition of the space.

regards, tom lane

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Fujii Masao 2021-04-14 14:46:58 INCLUDING COMPRESSION
Previous Message Michael Paquier 2021-04-14 05:58:53 Re: Typo in psql doc