Michael Paquier <mich...@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