~ubuntu-branches/ubuntu/utopic/postgresql-9.4/utopic-security

« back to all changes in this revision

Viewing changes to doc/src/sgml/ref/psql-ref.sgml

  • Committer: Package Import Robot
  • Author(s): Martin Pitt, CVE-2014-8161
  • Date: 2015-02-06 12:31:46 UTC
  • mfrom: (1.1.5) (7.1.2 utopic-proposed)
  • Revision ID: package-import@ubuntu.com-20150206123146-vtmf30jbkm7w16p8
Tags: 9.4.1-0ubuntu0.14.10
* New upstream security/bug fix release (LP: #1418928)
  - Fix buffer overruns in to_char() [CVE-2015-0241]
  - Fix buffer overruns in contrib/pgcrypto [CVE-2015-0243]
  - Fix possible loss of frontend/backend protocol synchronization after an
    error [CVE-2015-0244]
  - Fix information leak via constraint-violation error messages
    [CVE-2014-8161]
  - See release notes for details about other fixes:
    http://www.postgresql.org/about/news/1569/

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
      <term><option>--echo-all</></term>
54
54
      <listitem>
55
55
      <para>
56
 
      Print all input lines to standard output as they are read. This is more
57
 
      useful for script processing than interactive mode. This is
 
56
      Print all nonempty input lines to standard output as they are read.
 
57
      (This does not apply to lines read interactively.) This is
58
58
      equivalent to setting the variable <varname>ECHO</varname> to
59
59
      <literal>all</literal>.
60
60
      </para>
161
161
      Echo the actual queries generated by <command>\d</command> and other backslash
162
162
      commands. You can use this to study <application>psql</application>'s
163
163
      internal operations. This is equivalent to
164
 
      setting the variable <varname>ECHO_HIDDEN</varname> from within
165
 
      <application>psql</application>.
 
164
      setting the variable <varname>ECHO_HIDDEN</varname> to <literal>on</>.
166
165
      </para>
167
166
      </listitem>
168
167
    </varlistentry>
321
320
      quietly. By default, it prints welcome messages and various
322
321
      informational output. If this option is used, none of this
323
322
      happens. This is useful with the <option>-c</option> option.
324
 
      Within <application>psql</application> you can also set the
325
 
      <varname>QUIET</varname> variable to achieve the same effect.
 
323
      This is equivalent to setting the variable <varname>QUIET</varname>
 
324
      to <literal>on</>.
326
325
      </para>
327
326
      </listitem>
328
327
    </varlistentry>
598
597
    determined at compile time.
599
598
    Since the database server uses the same default, you will not have
600
599
    to specify the port in most cases. The default user name is your
601
 
    Unix user name, as is the default database name. Note that you cannot
 
600
    operating-system user name, as is the default database name.
 
601
    Note that you cannot
602
602
    just connect to any database under any user name. Your database
603
603
    administrator should have informed you about your access rights.
604
604
    </para>
1640
1640
 
1641
1641
 
1642
1642
      <varlistentry>
1643
 
        <term><literal>\g</literal> [ { <replaceable class="parameter">filename</replaceable> | <literal>|</literal><replaceable class="parameter">command</replaceable> } ]</term>
1644
 
 
 
1643
        <term><literal>\g [ <replaceable class="parameter">filename</replaceable> ]</literal></term>
 
1644
        <term><literal>\g [ |<replaceable class="parameter">command</replaceable> ]</literal></term>
1645
1645
        <listitem>
1646
1646
        <para>
1647
 
        Sends the current query input buffer to the server and
 
1647
        Sends the current query input buffer to the server, and
1648
1648
        optionally stores the query's output in <replaceable
1649
1649
        class="parameter">filename</replaceable> or pipes the output
1650
 
        into a separate Unix shell executing <replaceable
 
1650
        to the shell command <replaceable
1651
1651
        class="parameter">command</replaceable>.  The file or command is
1652
1652
        written to only if the query successfully returns zero or more tuples,
1653
1653
        not if the query fails or is a non-data-returning SQL command.
1661
1661
      </varlistentry>
1662
1662
 
1663
1663
      <varlistentry>
1664
 
        <term><literal>\gset</literal> [ <replaceable class="parameter">prefix</replaceable> ]</term>
 
1664
        <term><literal>\gset [ <replaceable class="parameter">prefix</replaceable> ]</literal></term>
1665
1665
 
1666
1666
        <listitem>
1667
1667
        <para>
1725
1725
 
1726
1726
 
1727
1727
      <varlistentry>
1728
 
        <term><literal>\H</literal></term>
 
1728
        <term><literal>\H</literal> or <literal>\html</literal></term>
1729
1729
        <listitem>
1730
1730
        <para>
1731
1731
        Turns on <acronym>HTML</acronym> query output format. If the
1739
1739
 
1740
1740
 
1741
1741
      <varlistentry>
1742
 
        <term><literal>\i <replaceable class="parameter">filename</replaceable></literal></term>
 
1742
        <term><literal>\i</literal> or <literal>\include</literal> <replaceable class="parameter">filename</replaceable></term>
1743
1743
        <listitem>
1744
1744
        <para>
1745
1745
        Reads input from the file <replaceable
1758
1758
 
1759
1759
 
1760
1760
      <varlistentry>
1761
 
        <term><literal>\ir <replaceable class="parameter">filename</replaceable></literal></term>
 
1761
        <term><literal>\ir</literal> or <literal>\include_relative</literal> <replaceable class="parameter">filename</replaceable></term>
1762
1762
        <listitem>
1763
1763
        <para>
1764
1764
        The <literal>\ir</> command is similar to <literal>\i</>, but resolves
1874
1874
 
1875
1875
 
1876
1876
      <varlistentry>
1877
 
        <term><literal>\o</literal> [ {<replaceable class="parameter">filename</replaceable> | <literal>|</literal><replaceable class="parameter">command</replaceable>} ]</term>
1878
 
 
 
1877
        <term><literal>\o</literal> or <literal>\out [ <replaceable class="parameter">filename</replaceable> ]</literal></term>
 
1878
        <term><literal>\o</literal> or <literal>\out [ |<replaceable class="parameter">command</replaceable> ]</literal></term>
1879
1879
        <listitem>
1880
1880
        <para>
1881
 
        Saves future query results to the file <replaceable
1882
 
        class="parameter">filename</replaceable> or pipes future results
1883
 
        into a separate Unix shell to execute <replaceable
1884
 
        class="parameter">command</replaceable>. If no arguments are
1885
 
        specified, the query output will be reset to the standard output.
 
1881
        Arranges to save future query results to the file <replaceable
 
1882
        class="parameter">filename</replaceable> or pipe future results
 
1883
        to the shell command <replaceable
 
1884
        class="parameter">command</replaceable>. If no argument is
 
1885
        specified, the query output is reset to the standard output.
1886
1886
        </para>
1887
1887
 
1888
1888
        <para><quote>Query results</quote> includes all tables, command
1903
1903
 
1904
1904
 
1905
1905
      <varlistentry>
1906
 
        <term><literal>\p</literal></term>
 
1906
        <term><literal>\p</literal> or <literal>\print</literal></term>
1907
1907
        <listitem>
1908
1908
        <para>
1909
1909
        Print the current query buffer to the standard output.
2332
2332
 
2333
2333
 
2334
2334
      <varlistentry>
2335
 
        <term><literal>\r</literal></term>
 
2335
        <term><literal>\r</literal> or <literal>\reset</literal></term>
2336
2336
        <listitem>
2337
2337
        <para>
2338
2338
        Resets (clears) the query buffer.
2399
2399
 
2400
2400
 
2401
2401
      <varlistentry>
2402
 
        <term><literal>\setenv [ <replaceable class="parameter">name</replaceable> [ <replaceable class="parameter">value</replaceable> ] ]</literal></term>
 
2402
        <term><literal>\setenv <replaceable class="parameter">name</replaceable> [ <replaceable class="parameter">value</replaceable> ]</literal></term>
2403
2403
 
2404
2404
        <listitem>
2405
2405
        <para>
2492
2492
 
2493
2493
 
2494
2494
      <varlistentry>
2495
 
        <term><literal>\w</literal> <replaceable class="parameter">filename</replaceable></term>
2496
 
        <term><literal>\w</literal> <literal>|</><replaceable class="parameter">command</replaceable></term>
 
2495
        <term><literal>\w</literal> or <literal>\write</literal> <replaceable class="parameter">filename</replaceable></term>
 
2496
        <term><literal>\w</literal> or <literal>\write</literal> <literal>|</><replaceable class="parameter">command</replaceable></term>
2497
2497
        <listitem>
2498
2498
        <para>
2499
2499
        Outputs the current query buffer to the file <replaceable
2500
 
        class="parameter">filename</replaceable> or pipes it to the Unix
 
2500
        class="parameter">filename</replaceable> or pipes it to the shell
2501
2501
        command <replaceable class="parameter">command</replaceable>.
2502
2502
        </para>
2503
2503
        </listitem>
2550
2550
        <term><literal>\! [ <replaceable class="parameter">command</replaceable> ]</literal></term>
2551
2551
        <listitem>
2552
2552
        <para>
2553
 
        Escapes to a separate Unix shell or executes the Unix command
 
2553
        Escapes to a separate shell or executes the shell command
2554
2554
        <replaceable class="parameter">command</replaceable>. The
2555
2555
        arguments are not further interpreted; the shell will see them
2556
2556
        as-is.  In particular, the variable substitution rules and
2807
2807
        <term><varname>ECHO</varname></term>
2808
2808
        <listitem>
2809
2809
        <para>
2810
 
        If set to <literal>all</literal>, all lines
2811
 
        entered from the keyboard or from a script are written to the standard output
2812
 
        before they are parsed or executed. To select this behavior on program
 
2810
        If set to <literal>all</literal>, all nonempty input lines are printed
 
2811
        to standard output as they are read.  (This does not apply to lines
 
2812
        read interactively.)  To select this behavior on program
2813
2813
        start-up, use the switch <option>-a</option>. If set to
2814
2814
        <literal>queries</literal>,
2815
 
        <application>psql</application> merely prints all queries as
2816
 
        they are sent to the server. The switch for this is
 
2815
        <application>psql</application> prints each query to standard output
 
2816
        as it is sent to the server. The switch for this is
2817
2817
        <option>-e</option>.
2818
2818
        </para>
2819
2819
        </listitem>
2823
2823
        <term><varname>ECHO_HIDDEN</varname></term>
2824
2824
        <listitem>
2825
2825
        <para>
2826
 
        When this variable is set and a backslash command queries the
2827
 
        database, the query is first shown. This way you can study the
 
2826
        When this variable is set to <literal>on</> and a backslash command
 
2827
        queries the database, the query is first shown.
 
2828
        This feature helps you to study
2828
2829
        <productname>PostgreSQL</productname> internals and provide
2829
2830
        similar functionality in your own programs. (To select this behavior
2830
2831
        on program start-up, use the switch <option>-E</option>.)  If you set
2984
2985
      </term>
2985
2986
        <listitem>
2986
2987
        <para>
2987
 
        When <literal>on</>, if a statement in a transaction block
 
2988
        When set to <literal>on</>, if a statement in a transaction block
2988
2989
        generates an error, the error is ignored and the transaction
2989
 
        continues. When <literal>interactive</>, such errors are only
 
2990
        continues. When set to <literal>interactive</>, such errors are only
2990
2991
        ignored in interactive sessions, and not when reading script
2991
 
        files. When <literal>off</> (the default), a statement in a
 
2992
        files. When unset or set to <literal>off</>, a statement in a
2992
2993
        transaction block that generates an error aborts the entire
2993
 
        transaction. The on_error_rollback-on mode works by issuing an
 
2994
        transaction. The error rollback mode works by issuing an
2994
2995
        implicit <command>SAVEPOINT</> for you, just before each command
2995
 
        that is in a transaction block, and rolls back to the savepoint
2996
 
        on error.
 
2996
        that is in a transaction block, and then rolling back to the
 
2997
        savepoint if the command fails.
2997
2998
        </para>
2998
2999
        </listitem>
2999
3000
      </varlistentry>
3003
3004
        <listitem>
3004
3005
        <para>
3005
3006
        By default, command processing continues after an error.  When this
3006
 
        variable is set, it will instead stop immediately.  In interactive mode,
 
3007
        variable is set to <literal>on</>, processing will instead stop
 
3008
        immediately.  In interactive mode,
3007
3009
        <application>psql</application> will return to the command prompt;
3008
3010
        otherwise, <application>psql</application> will exit, returning
3009
3011
        error code 3 to distinguish this case from fatal error
3045
3047
        <term><varname>QUIET</varname></term>
3046
3048
        <listitem>
3047
3049
        <para>
3048
 
        This variable is equivalent to the command line option
3049
 
        <option>-q</option>. It is probably not too useful in
 
3050
        Setting this variable to <literal>on</> is equivalent to the command
 
3051
        line option <option>-q</option>. It is probably not too useful in
3050
3052
        interactive mode.
3051
3053
        </para>
3052
3054
        </listitem>
3056
3058
        <term><varname>SINGLELINE</varname></term>
3057
3059
        <listitem>
3058
3060
        <para>
3059
 
        This variable is equivalent to the command line option
3060
 
        <option>-S</option>.
 
3061
        Setting this variable to <literal>on</> is equivalent to the command
 
3062
        line option <option>-S</option>.
3061
3063
        </para>
3062
3064
        </listitem>
3063
3065
      </varlistentry>
3066
3068
        <term><varname>SINGLESTEP</varname></term>
3067
3069
        <listitem>
3068
3070
        <para>
3069
 
        This variable is equivalent to the command line option
3070
 
        <option>-s</option>.
 
3071
        Setting this variable to <literal>on</> is equivalent to the command
 
3072
        line option <option>-s</option>.
3071
3073
        </para>
3072
3074
        </listitem>
3073
3075
      </varlistentry>