Thread
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
-
Typo in psql doc
The Post Office <noreply@postgresql.org> — 2021-04-13T07:57:54Z
The following documentation comment has been logged on the website: Page: https://www.postgresql.org/docs/13/app-psql.html Description: There is a spurious space inside the documentation: \set HISTFILE ~/.psql_history- :DBNAME instead of \set HISTFILE ~/.psql_history-:DBNAME
-
Re: Typo in psql doc
Michael Paquier <michael@paquier.xyz> — 2021-04-14T05:58:53Z
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). -- Michael
-
Re: Typo in psql doc
Tom Lane <tgl@sss.pgh.pa.us> — 2021-04-14T14:12:02Z
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
-
Re: Typo in psql doc
Michael Paquier <michael@paquier.xyz> — 2021-04-15T01:48:25Z
On Wed, Apr 14, 2021 at 10:12:02AM -0400, Tom Lane wrote: > 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. Oh, interesting point. I did not notice that this was different before. -- Michael
-
Re: Typo in psql doc
Ludovic Kuty <ludovic.kuty@gmail.com> — 2021-04-15T07:55:53Z
Yes indeed, thanks. I re-tested the example this morning and it worked correctly with the space. I guess I had messed up things when I first tried it. > Michael Paquier <mailto:michael@paquier.xyz> > 14 April 2021 at 07:58 > > 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). > -- > Michael > PG Doc comments form <mailto:noreply@postgresql.org> > 13 April 2021 at 09:57 > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/13/app-psql.html > Description: > > There is a spurious space inside the documentation: > \set HISTFILE ~/.psql_history- :DBNAME > instead of > \set HISTFILE ~/.psql_history-:DBNAME
-
Re: Typo in psql doc
Michael Paquier <michael@paquier.xyz> — 2021-04-15T08:02:32Z
On Thu, Apr 15, 2021 at 09:55:53AM +0200, Ludovic Kuty wrote: > Yes indeed, thanks. I re-tested the example this morning and it worked > correctly with the space. I guess I had messed up things when I first tried > it. After seeing Tom's argument that this behavior become more consistent in 9.2, and that e4c7619 introduced it initially because of what ~9.1 was doing, I have considered both points and just applied a small patch for HEAD with 1840d9f to remove the space. -- Michael