Home Explore Blog CI



postgresql

5th chunk of `doc/src/sgml/ref/psql-ref.sgml`
05de7d29d7644fe9eec1b280e205b896e5d8ce27486fd2c80000000100000fa3
 into file <replaceable
       class="parameter">filename</replaceable>, in addition to the
       normal output destination.
      </para>
      </listitem>
    </varlistentry>

    <varlistentry id="app-psql-option-no-readline">
      <term><option>-n</option></term>
      <term><option>--no-readline</option></term>
      <listitem>
      <para>
       Do not use <application>Readline</application> for line editing and
       do not use the command history (see
       <xref linkend="app-psql-readline"/> below).
      </para>
      </listitem>
    </varlistentry>

    <varlistentry id="app-psql-option-output">
      <term><option>-o <replaceable class="parameter">filename</replaceable></option></term>
      <term><option>--output=<replaceable class="parameter">filename</replaceable></option></term>
      <listitem>
      <para>
      Put all query output into file <replaceable
      class="parameter">filename</replaceable>. This is equivalent to
      the command <command>\o</command>.
      </para>
      </listitem>
    </varlistentry>

    <varlistentry id="app-psql-option-port">
      <term><option>-p <replaceable class="parameter">port</replaceable></option></term>
      <term><option>--port=<replaceable class="parameter">port</replaceable></option></term>
      <listitem>
      <para>
      Specifies the TCP port or the local Unix-domain
      socket file extension on which the server is listening for
      connections. Defaults to the value of the <envar>PGPORT</envar>
      environment variable or, if not set, to the port specified at
      compile time, usually 5432.
      </para>
      </listitem>
    </varlistentry>

    <varlistentry id="app-psql-option-pset">
      <term><option>-P <replaceable class="parameter">assignment</replaceable></option></term>
      <term><option>--pset=<replaceable class="parameter">assignment</replaceable></option></term>
      <listitem>
      <para>
      Specifies printing options, in the style of
      <command>\pset</command>. Note that here you
      have to separate name and value with an equal sign instead of a
      space. For example, to set the output format to <application>LaTeX</application>, you could write
      <literal>-P format=latex</literal>.
      </para>
      </listitem>
    </varlistentry>

    <varlistentry id="app-psql-option-quiet">
      <term><option>-q</option></term>
      <term><option>--quiet</option></term>
      <listitem>
      <para>
      Specifies that <application>psql</application> should do its work
      quietly. By default, it prints welcome messages and various
      informational output. If this option is used, none of this
      happens. This is useful with the <option>-c</option> option.
      This is equivalent to setting the variable <varname>QUIET</varname>
      to <literal>on</literal>.
      </para>
      </listitem>
    </varlistentry>

    <varlistentry id="app-psql-option-record-separator">
      <term><option>-R <replaceable class="parameter">separator</replaceable></option></term>
      <term><option>--record-separator=<replaceable class="parameter">separator</replaceable></option></term>
      <listitem>
      <para>
      Use <replaceable class="parameter">separator</replaceable> as the
      record separator for unaligned output. This is equivalent to
      <command>\pset recordsep</command>.
      </para>
      </listitem>
    </varlistentry>

    <varlistentry id="app-psql-option-single-step">
      <term><option>-s</option></term>
      <term><option>--single-step</option></term>
      <listitem>
      <para>
      Run in single-step mode. That means the user is prompted before
      each command is sent to the server, with the option to cancel
      execution as well. Use this to debug scripts.
      </para>
      </listitem>
    </varlistentry>

    <varlistentry id="app-psql-option-single-line">
      <term><option>-S</option></term>
      <term><option>--single-line</option></term>
      <listitem>
      <para>
      Runs

Title: psql Options: -L, -n, -o, -p, -P, -q, -R, -s, -S
Summary
This section details command-line options for psql: - `-L`: Logs query output to a file. - `-n`: Disables Readline. - `-o`: Redirects output to a file. - `-p`: Specifies the port. - `-P`: Sets printing options (like `\pset`). - `-q`: Runs quietly. - `-R`: Sets the record separator. - `-s`: Runs in single-step mode.