@@ -3516,55 +3516,66 @@ PSQL_EDITOR_LINENUMBER_ARG='--line '
3516
3516
<refsect1>
3517
3517
<title>Files</title>
3518
3518
3519
- <itemizedlist>
3519
+ <variablelist>
3520
+ <varlistentry>
3521
+ <term><filename>psqlrc</filename> and <filename>~/.psqlrc</filename></term>
3520
3522
<listitem>
3521
3523
<para>
3522
- Unless it is passed an <option>-X</option>
3523
- or <option>-c</option> option,
3524
- <application>psql</application> attempts to
3525
- read and execute commands from the system-wide
3526
- <filename>psqlrc</filename> file and the user's
3527
- <filename>~/.psqlrc</filename> file before starting up.
3528
- (On Windows, the user's startup file is named
3529
- <filename>%APPDATA%\postgresql\psqlrc.conf</filename>.)
3530
- See <filename><replaceable>PREFIX</>/share/psqlrc.sample</>
3531
- for information on setting up the system-wide file. It could be used
3532
- to set up the client or the server to taste (using the <command>\set
3533
- </command> and <command>SET</command> commands).
3524
+ Unless it is passed an <option>-X</option> or <option>-c</option> option,
3525
+ <application>psql</application> attempts to read and execute commands
3526
+ from the system-wide startup file (<filename>psqlrc</filename>) and then
3527
+ the user's personal startup file (<filename>~/.psqlrc</filename>), after
3528
+ connecting to the database but before accepting normal commands.
3529
+ These files can be used to set up the client and/or the server to taste,
3530
+ typically with <command>\set</command> and <command>SET</command>
3531
+ commands.
3534
3532
</para>
3535
3533
<para>
3536
- The location of the user's <filename>~/.psqlrc</filename> file can
3537
- also be set explicitly via the <envar>PSQLRC</envar> environment
3538
- setting.
3534
+ The system-wide startup file is named <filename>psqlrc</filename> and is
3535
+ sought in the installation's <quote>system configuration</> directory,
3536
+ which is most reliably identified by running <literal>pg_config
3537
+ --sysconfdir</>. By default this directory will be <filename>../etc/</>
3538
+ relative to the directory containing
3539
+ the <productname>PostgreSQL</productname> executables. The name of this
3540
+ directory can be set explicitly via the <envar>PGSYSCONFDIR</envar>
3541
+ environment variable.
3542
+ </para>
3543
+ <para>
3544
+ The user's personal startup file is named <filename>.psqlrc</filename>
3545
+ and is sought in the invoking user's home directory. On Windows, which
3546
+ lacks such a concept, the personal startup file is named
3547
+ <filename>%APPDATA%\postgresql\psqlrc.conf</filename>.
3548
+ The location of the user's startup file can be set explicitly via
3549
+ the <envar>PSQLRC</envar> environment variable.
3539
3550
</para>
3540
- </listitem>
3541
-
3542
- <listitem>
3543
3551
<para>
3544
- Both the system-wide<filename>psqlrc</filename> file and the user's
3545
- <filename>~/.psqlrc</filename> file can be made <application>psql</application>-version-specific
3552
+ Both the system-widestartup file and the user's personal startup file
3553
+ can be made <application>psql</application>-version-specific
3546
3554
by appending a dash and the <productname>PostgreSQL</productname>
3547
- major or minor<application>psql</application> release number,
3555
+ major or minor release number to the file name ,
3548
3556
for example <filename>~/.psqlrc-9.2</filename> or
3549
3557
<filename>~/.psqlrc-9.2.5</filename>. The most specific
3550
3558
version-matching file will be read in preference to a
3551
3559
non-version-specific file.
3552
3560
</para>
3553
3561
</listitem>
3562
+ </varlistentry>
3554
3563
3564
+ <varlistentry>
3565
+ <term><filename>.psql_history</filename></term>
3555
3566
<listitem>
3556
3567
<para>
3557
3568
The command-line history is stored in the file
3558
3569
<filename>~/.psql_history</filename>, or
3559
3570
<filename>%APPDATA%\postgresql\psql_history</filename> on Windows.
3560
3571
</para>
3561
3572
<para>
3562
- The location of the history file can
3563
- also be set explicitly via the <envar>PSQL_HISTORY</envar> environment
3564
- setting.
3573
+ The location of the history file can be set explicitly via
3574
+ the <envar>PSQL_HISTORY</envar> environment variable.
3565
3575
</para>
3566
3576
</listitem>
3567
- </itemizedlist>
3577
+ </varlistentry>
3578
+ </variablelist>
3568
3579
</refsect1>
3569
3580
3570
3581