1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Add a \setenv command to psql.

This can be used to set (or unset) environment variables that will
affect programs called by psql (such as the PAGER), probably most
usefully in a .psqlrc file.

Andrew Dunstan, reviewed by Josh Kupershmidt.
This commit is contained in:
Andrew Dunstan
2011-12-04 11:43:38 -05:00
parent eb06416ba4
commit e6d9e2106f
3 changed files with 65 additions and 1 deletions

View File

@ -2241,6 +2241,24 @@ lo_import 152801
</varlistentry>
<varlistentry>
<term><literal>\setenv [ <replaceable class="parameter">name</replaceable> [ <replaceable class="parameter">value</replaceable> ] ]</literal></term>
<listitem>
<para>
Sets the environment variable <replaceable
class="parameter">name</replaceable> to <replaceable
class="parameter">value</replaceable>, or if the
<replaceable class="parameter">value</replaceable> is
not supplied, unsets the environment variable. Example:
<programlisting>
testdb=&gt; <userinput>\setenv PAGER less</userinput>
testdb=&gt; <userinput>\setenv LESS -imx4F</userinput>
</programlisting>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>\sf[+] <replaceable class="parameter">function_description</> </literal></term>