Re: Typo in psql doc
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael@paquier.xyz>
Cc: ludovic.kuty@gmail.com, pgsql-docs@lists.postgresql.org
Date: 2021-04-14T14:12:02Z
Lists: pgsql-docs
Michael Paquier <michael@paquier.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
Commits
-
doc: Simplify example of HISTFILE for psql
- 1840d9f4c899 14.0 landed
-
Add space before :DBNAME for proper \set expansion.
- e4c76191a9f6 8.1.0 cited