Re: small windows psqlrc re-wording - Mailing list pgsql-hackers

From Tom Lane
Subject Re: small windows psqlrc re-wording
Date
Msg-id 3972135.1662649369@sss.pgh.pa.us
Whole thread Raw
In response to Re: small windows psqlrc re-wording  (Julien Rouhaud <rjuju123@gmail.com>)
Responses Re: small windows psqlrc re-wording
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Ashutosh Sharma
Date:
Subject: Re: confirmed_flush_lsn shows LSN of the data that has not yet been received by the logical subscriber.
Next
From: Pavel Stehule
Date:
Subject: Re: proposal: possibility to read dumped table's name from file