After looking at the text more carefully, I thought it could use a deal more help than Robert has given it. I propose the attached.
regards, tom lane
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index 186f8c506a..f8112c1500 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -4892,21 +4892,23 @@ PSQL_EDITOR_LINENUMBER_ARG='--line ' commands. </para> <para> - The system-wide startup file is named <filename>psqlrc</filename> and is + The system-wide startup file is named <filename>psqlrc</filename>. + By default it is sought in the installation's <quote>system configuration</quote> directory, which is most reliably identified by running <literal>pg_config - --sysconfdir</literal>. By default this directory will be <filename>../etc/</filename> + --sysconfdir</literal>. + Typically this directory will be <filename>../etc/</filename> relative to the directory containing - the <productname>PostgreSQL</productname> executables. The name of this - directory can be set explicitly via the <envar>PGSYSCONFDIR</envar> - environment variable. + the <productname>PostgreSQL</productname> executables. + The directory to look in can be set explicitly via + the <envar>PGSYSCONFDIR</envar> environment variable. </para> <para> The user's personal startup file is named <filename>.psqlrc</filename> - and is sought in the invoking user's home directory. On Windows, which - lacks such a concept, the personal startup file is named + and is sought in the invoking user's home directory. On Windows + the personal startup file is instead named <filename>%APPDATA%\postgresql\psqlrc.conf</filename>. - The location of the user's startup file can be set explicitly via + In either case, this default file name can be overridden by setting the <envar>PSQLRC</envar> environment variable. </para> <para> @@ -4914,10 +4916,12 @@ PSQL_EDITOR_LINENUMBER_ARG='--line ' can be made <application>psql</application>-version-specific by appending a dash and the <productname>PostgreSQL</productname> major or minor release number to the file name, - 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 version-matching file will be read in preference to a non-version-specific file. + These version suffixes are added after determining the file name + as explained above. </para> </listitem> </varlistentry>