Home Explore Blog CI



postgresql

34th chunk of `doc/src/sgml/ref/psql-ref.sgml`
39e0b7bd50c96faae2241e11f955b9312b8ae0468191d76c0000000100000fa6
 <literal>defined</literal> means that it was requested when creating
        the statistics, and NULL means it wasn't requested.
        You can use <structname>pg_stats_ext</structname> if you'd like to
        know whether <link linkend="sql-analyze"><command>ANALYZE</command></link>
        was run and statistics are available to the planner.
        </para>
        </listitem>
      </varlistentry>

      <varlistentry id="app-psql-meta-command-dy">
        <term><literal>\dy[x+] [ <link linkend="app-psql-patterns"><replaceable class="parameter">pattern</replaceable></link> ]</literal></term>
        <listitem>
        <para>
        Lists event triggers.
        If <replaceable class="parameter">pattern</replaceable>
        is specified, only those event triggers whose names match the pattern
        are listed.
        If <literal>x</literal> is appended to the command name, the results
        are displayed in expanded mode.
        If <literal>+</literal> is appended to the command name, each object
        is listed with its associated description.
        </para>
        </listitem>
      </varlistentry>

      <varlistentry id="app-psql-meta-command-edit">
        <term><literal>\e</literal> or <literal>\edit</literal> <literal> <optional> <replaceable class="parameter">filename</replaceable> </optional> <optional> <replaceable class="parameter">line_number</replaceable> </optional> </literal></term>

        <listitem>
        <para>
        If <replaceable class="parameter">filename</replaceable> is
        specified, the file is edited; after the editor exits, the file's
        content is copied into the current query buffer. If no <replaceable
        class="parameter">filename</replaceable> is given, the current query
        buffer is copied to a temporary file which is then edited in the same
        fashion.  Or, if the current query buffer is empty, the most recently
        executed query is copied to a temporary file and edited in the same
        fashion.
        </para>

        <para>
        If you edit a file or the previous query, and you quit the editor without
        modifying the file, the query buffer is cleared.
        Otherwise, the new contents of the query buffer are re-parsed according to
        the normal rules of <application>psql</application>, treating the
        whole buffer as a single line.  Any complete queries are immediately
        executed; that is, if the query buffer contains or ends with a
        semicolon, everything up to that point is executed and removed from
        the query buffer.  Whatever remains in the query buffer is
        redisplayed.  Type semicolon or <literal>\g</literal> to send it,
        or <literal>\r</literal> to cancel it by clearing the query buffer.
        </para>

        <para>
        Treating the buffer as a single line primarily affects meta-commands:
        whatever is in the buffer after a meta-command will be taken as
        argument(s) to the meta-command, even if it spans multiple lines.
        (Thus you cannot make meta-command-using scripts this way.
        Use <command>\i</command> for that.)
        </para>

        <para>
        If a line number is specified, <application>psql</application> will
        position the cursor on the specified line of the file or query buffer.
        Note that if a single all-digits argument is given,
        <application>psql</application> assumes it is a line number,
        not a file name.
        </para>

        <tip>
        <para>
        See <xref linkend="app-psql-environment"/>, below, for how to
        configure and customize your editor.
        </para>
        </tip>
        </listitem>
      </varlistentry>

      <varlistentry id="app-psql-meta-command-echo">
        <term><literal>\echo <replaceable class="parameter">text</replaceable> [ ... ]</literal></term>
        <listitem>
        <para>
        Prints the evaluated arguments to standard output, separated by
        spaces

Title: psql Meta-Commands: \dy, \e (\edit), \echo
Summary
This section describes the `psql` meta-commands `\dy`, `\e`, and `\echo`: * `\dy`: Lists event triggers, filtering by name pattern. `x` provides expanded output. `+` shows each object's description. * `\e` or `\edit`: Edits a specified file or the current/previous query buffer. After editing, the content is parsed and executed. The buffer is treated as a single line for meta-commands. An optional line number can be specified to position the cursor. The editor can be configured using environment variables. * `\echo`: Prints the evaluated arguments to standard output, separated by spaces and followed by a newline.