@@ -3420,55 +3420,66 @@ PSQL_EDITOR_LINENUMBER_ARG='--line '
3420
3420
<refsect1>
3421
3421
<title>Files</title>
3422
3422
3423
- <itemizedlist>
3423
+ <variablelist>
3424
+ <varlistentry>
3425
+ <term><filename>psqlrc</filename> and <filename>~/.psqlrc</filename></term>
3424
3426
<listitem>
3425
3427
<para>
3426
- Unless it is passed an <option>-X</option>
3427
- or <option>-c</option> option,
3428
- <application>psql</application> attempts to
3429
- read and execute commands from the system-wide
3430
- <filename>psqlrc</filename> file and the user's
3431
- <filename>~/.psqlrc</filename> file before starting up.
3432
- (On Windows, the user's startup file is named
3433
- <filename>%APPDATA%\postgresql\psqlrc.conf</filename>.)
3434
- See <filename><replaceable>PREFIX</>/share/psqlrc.sample</>
3435
- for information on setting up the system-wide file. It could be used
3436
- to set up the client or the server to taste (using the <command>\set
3437
- </command> and <command>SET</command> commands).
3428
+ Unless it is passed an <option>-X</option> or <option>-c</option> option,
3429
+ <application>psql</application> attempts to read and execute commands
3430
+ from the system-wide startup file (<filename>psqlrc</filename>) and then
3431
+ the user's personal startup file (<filename>~/.psqlrc</filename>), after
3432
+ connecting to the database but before accepting normal commands.
3433
+ These files can be used to set up the client and/or the server to taste,
3434
+ typically with <command>\set</command> and <command>SET</command>
3435
+ commands.
3438
3436
</para>
3439
3437
<para>
3440
- The location of the user's <filename>~/.psqlrc</filename> file can
3441
- also be set explicitly via the <envar>PSQLRC</envar> environment
3442
- setting.
3438
+ The system-wide startup file is named <filename>psqlrc</filename> and is
3439
+ sought in the installation's <quote>system configuration</> directory,
3440
+ which is most reliably identified by running <literal>pg_config
3441
+ --sysconfdir</>. By default this directory will be <filename>../etc/</>
3442
+ relative to the directory containing
3443
+ the <productname>PostgreSQL</productname> executables. The name of this
3444
+ directory can be set explicitly via the <envar>PGSYSCONFDIR</envar>
3445
+ environment variable.
3446
+ </para>
3447
+ <para>
3448
+ The user's personal startup file is named <filename>.psqlrc</filename>
3449
+ and is sought in the invoking user's home directory. On Windows, which
3450
+ lacks such a concept, the personal startup file is named
3451
+ <filename>%APPDATA%\postgresql\psqlrc.conf</filename>.
3452
+ The location of the user's startup file can be set explicitly via
3453
+ the <envar>PSQLRC</envar> environment variable.
3443
3454
</para>
3444
- </listitem>
3445
-
3446
- <listitem>
3447
3455
<para>
3448
- Both the system-wide <filename>psqlrc</filename> file and the user's
3449
- <filename>~/.psqlrc</filename> file can be made <application>psql</application>-version-specific
3456
+ Both the system-wide startup file and the user's personal startup file
3457
+ can be made <application>psql</application>-version-specific
3450
3458
by appending a dash and the <productname>PostgreSQL</productname>
3451
- major or minor <application>psql</application> release number,
3459
+ major or minor release number to the file name ,
3452
3460
for example <filename>~/.psqlrc-9.2</filename> or
3453
3461
<filename>~/.psqlrc-9.2.5</filename>. The most specific
3454
3462
version-matching file will be read in preference to a
3455
3463
non-version-specific file.
3456
3464
</para>
3457
3465
</listitem>
3466
+ </varlistentry>
3458
3467
3468
+ <varlistentry>
3469
+ <term><filename>.psql_history</filename></term>
3459
3470
<listitem>
3460
3471
<para>
3461
3472
The command-line history is stored in the file
3462
3473
<filename>~/.psql_history</filename>, or
3463
3474
<filename>%APPDATA%\postgresql\psql_history</filename> on Windows.
3464
3475
</para>
3465
3476
<para>
3466
- The location of the history file can
3467
- also be set explicitly via the <envar>PSQL_HISTORY</envar> environment
3468
- setting.
3477
+ The location of the history file can be set explicitly via
3478
+ the <envar>PSQL_HISTORY</envar> environment variable.
3469
3479
</para>
3470
3480
</listitem>
3471
- </itemizedlist>
3481
+ </varlistentry>
3482
+ </variablelist>
3472
3483
</refsect1>
3473
3484
3474
3485
0 commit comments