Julien Rouhaud <rjuju123@gmail.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