Re: small windows psqlrc re-wording

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Julien Rouhaud <rjuju123(at)gmail(dot)com>
Cc: Robert Treat <rob(at)xzilla(dot)net>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: small windows psqlrc re-wording
Date: 2022-09-08 15:02:49
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Julien Rouhaud <rjuju123(at)gmail(dot)com> writes:
> On Wed, Sep 07, 2022 at 01:10:11PM -0400, Tom Lane wrote:
> - for example <filename>~/.psqlrc-9.2</filename> or
> - <filename>~/.psqlrc-9.2.5</filename>. The most specific
> + for example <filename>~/.psqlrc-15</filename> or
> + <filename>~/.psqlrc-15.2</filename>. The most specific

> This bit is a bit saddening. It's probably good to switch to the new 2 digits
> versioning but not trying to maintain it any further right?

It occurred to me later to substitute &majorversion; and &version;
like this:

+ for example <filename>~/.psqlrc-&majorversion;</filename> or
+ <filename>~/.psqlrc-&version;</filename>. The most specific

On testing that in HEAD, I read

Both the system-wide startup file and the user's personal startup file
can be made psql-version-specific by appending a dash and the
PostgreSQL major or minor release number to the file name, for example
~/.psqlrc-16 or ~/.psqlrc-16devel.

That's a little confusing but it's actually accurate, because what
process_psqlrc_file appends is the string PG_VERSION, so in a devel
branch or beta release there's a non-numeric "minor release".
I'm inclined to go ahead and do it like that.

regards, tom lane

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2022-09-08 15:03:01 Re: proposal: possibility to read dumped table's name from file
Previous Message Ashutosh Sharma 2022-09-08 15:02:05 Re: confirmed_flush_lsn shows LSN of the data that has not yet been received by the logical subscriber.