<term><option>--dbname=<replaceable class="parameter">dbname</replaceable></option></term>
<listitem>
<para>
Specifies the name of the database to connect to. This is
equivalent to specifying <replaceable
class="parameter">dbname</replaceable> as the first non-option
argument on the command line. The <replaceable>dbname</replaceable>
can be a <link linkend="libpq-connstring">connection string</link>.
If so, connection string parameters will override any conflicting
command line options.
</para>
</listitem>
</varlistentry>
<varlistentry id="app-psql-option-echo-queries">
<term><option>-e</option></term>
<term><option>--echo-queries</option></term>
<listitem>
<para>
Copy all SQL commands sent to the server to standard output as well.
This is equivalent
to setting the variable <varname>ECHO</varname> to
<literal>queries</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry id="app-psql-option-echo-hidden">
<term><option>-E</option></term>
<term><option>--echo-hidden</option></term>
<listitem>
<para>
Echo the actual queries generated by <command>\d</command> and other backslash
commands. You can use this to study <application>psql</application>'s
internal operations. This is equivalent to
setting the variable <varname>ECHO_HIDDEN</varname> to <literal>on</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry id="app-psql-option-file">
<term><option>-f <replaceable class="parameter">filename</replaceable></option></term>
<term><option>--file=<replaceable class="parameter">filename</replaceable></option></term>
<listitem>
<para>
Read commands from the
file <replaceable class="parameter">filename</replaceable>,
rather than standard input.
This option can be repeated and combined in any order with
the <option>-c</option> option. When either <option>-c</option>
or <option>-f</option> is specified, <application>psql</application>
does not read commands from standard input; instead it terminates
after processing all the <option>-c</option> and <option>-f</option>
options in sequence.
Except for that, this option is largely equivalent to the
meta-command <command>\i</command>.
</para>
<para>
If <replaceable>filename</replaceable> is <literal>-</literal>
(hyphen), then standard input is read until an EOF indication
or <command>\q</command> meta-command. This can be used to intersperse
interactive input with input from files. Note however that Readline
is not used in this case (much as if <option>-n</option> had been
specified).
</para>
<para>
Using this option is subtly different from writing <literal>psql
< <replaceable
class="parameter">filename</replaceable></literal>. In general,
both will do what you expect, but using <literal>-f</literal>
enables some nice features such as error messages with line
numbers. There is also a slight chance that using this option will
reduce the start-up overhead. On the other hand, the variant using
the shell's input redirection is (in theory) guaranteed to yield
exactly the same output you would have received had you entered
everything by hand.
</para>
</listitem>
</varlistentry>
<varlistentry id="app-psql-option-field-separator">
<term><option>-F <replaceable class="parameter">separator</replaceable></option></term>
<term><option>--field-separator=<replaceable class="parameter">separator</replaceable></option></term>
<listitem>
<para>
Use <replaceable class="parameter">separator</replaceable> as the
field separator for unaligned output. This is equivalent to
<command>\pset fieldsep</command>