⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 psql-ref.sgml

📁 postgresql8.3.4源码,开源数据库
💻 SGML
📖 第 1 页 / 共 5 页
字号:
        <tip>        <para>        Use <command>\lo_list</command> to find out the large object's        <acronym>OID</acronym>.        </para>        </tip>        </listitem>      </varlistentry>      <varlistentry>        <term><literal>\lo_import <replaceable class="parameter">filename</replaceable> [ <replaceable class="parameter">comment</replaceable> ]</literal></term>        <listitem>        <para>        Stores the file into a <productname>PostgreSQL</productname>        large object. Optionally, it associates the given        comment with the object. Example:<programlisting>foo=&gt; <userinput>\lo_import '/home/peter/pictures/photo.xcf' 'a picture of me'</userinput>lo_import 152801</programlisting>        The response indicates that the large object received object        ID 152801, which can be used to access the newly-created large        object in the future. For the sake of readability, it is        recommended to always associate a human-readable comment with        every object. Both OIDs and comments can be viewed with the        <command>\lo_list</command> command.        </para>        <para>        Note that this command is subtly different from the server-side        <function>lo_import</function> because it acts as the local user        on the local file system, rather than the server's user and file        system.        </para>        </listitem>      </varlistentry>      <varlistentry>        <term><literal>\lo_list</literal></term>        <listitem>        <para>        Shows a list of all <productname>PostgreSQL</productname>        large objects currently stored in the database,        along with any comments provided for them.        </para>        </listitem>      </varlistentry>      <varlistentry>        <term><literal>\lo_unlink <replaceable class="parameter">loid</replaceable></literal></term>        <listitem>        <para>        Deletes the large object with <acronym>OID</acronym>        <replaceable class="parameter">loid</replaceable> from the        database.        </para>        <tip>        <para>        Use <command>\lo_list</command> to find out the large object's        <acronym>OID</acronym>.        </para>        </tip>        </listitem>      </varlistentry>      <varlistentry>        <term><literal>\o</literal> [ {<replaceable class="parameter">filename</replaceable> | <literal>|</literal><replaceable class="parameter">command</replaceable>} ]</term>        <listitem>        <para>        Saves future query results to the file <replaceable        class="parameter">filename</replaceable> or pipes future results        into a separate Unix shell to execute <replaceable        class="parameter">command</replaceable>. If no arguments are        specified, the query output will be reset to the standard output.        </para>        <para>        <quote>Query results</quote> includes all tables, command        responses, and notices obtained from the database server, as        well as output of various backslash commands that query the        database (such as <command>\d</command>), but not error        messages.        </para>        <tip>        <para>        To intersperse text output in between query results, use        <command>\qecho</command>.        </para>        </tip>        </listitem>      </varlistentry>      <varlistentry>        <term><literal>\p</literal></term>        <listitem>        <para>        Print the current query buffer to the standard output.        </para>        </listitem>      </varlistentry>      <varlistentry>        <term><literal>\password [ <replaceable class="parameter">username</replaceable> ]</literal></term>        <listitem>        <para>        Changes the password of the specified user (by default, the current        user).  This command prompts for the new password, encrypts it, and        sends it to the server as an <command>ALTER ROLE</> command.  This        makes sure that the new password does not appear in cleartext in the        command history, the server log, or elsewhere.        </para>        </listitem>      </varlistentry>      <varlistentry>        <term><literal>\prompt [ <replaceable class="parameter">text</replaceable> ] <replaceable class="parameter">name</replaceable></literal></term>        <listitem>        <para>         Prompts the user to set variable <replaceable         class="parameter">name</>.  An optional prompt, <replaceable         class="parameter">text</>, can be specified.  (For multi-word         prompts, use single-quotes.)        </para>        <para>         By default, <literal>\prompt</> uses the terminal for input and         output.  However, if the <option>-f</> command line switch is         used, <literal>\prompt</> uses standard input and standard output.        </para>        </listitem>      </varlistentry>      <varlistentry>        <term><literal>\pset <replaceable class="parameter">parameter</replaceable> [ <replaceable class="parameter">value</replaceable> ]</literal></term>        <listitem>        <para>        This command sets options affecting the output of query result        tables. <replaceable class="parameter">parameter</replaceable>        describes which option is to be set. The semantics of        <replaceable class="parameter">value</replaceable> depend        thereon.        </para>        <para>        Adjustable printing options are:        <variablelist>          <varlistentry>          <term><literal>format</literal></term>          <listitem>          <para>          Sets the output format to one of <literal>unaligned</literal>,          <literal>aligned</literal>, <literal>html</literal>,          <literal>latex</literal>, or <literal>troff-ms</literal>.          Unique abbreviations are allowed.  (That would mean one letter          is enough.)          </para>          <para>          <quote>Unaligned</quote> writes all columns of a row on a          line, separated by the currently active field separator. This          is intended to create output that might be intended to be read          in by other programs (tab-separated, comma-separated).          <quote>Aligned</quote> mode is the standard, human-readable,          nicely formatted text output that is default. The          <quote><acronym>HTML</acronym></quote> and          <quote>LaTeX</quote> modes put out tables that are intended to          be included in documents using the respective mark-up          language. They are not complete documents! (This might not be          so dramatic in <acronym>HTML</acronym>, but in LaTeX you must          have a complete document wrapper.)          </para>          </listitem>          </varlistentry>          <varlistentry>          <term><literal>border</literal></term>          <listitem>          <para>          The second argument must be a number. In general, the higher          the number the more borders and lines the tables will have,          but this depends on the particular format. In          <acronym>HTML</acronym> mode, this will translate directly          into the <literal>border=...</literal> attribute, in the          others only values 0 (no border), 1 (internal dividing lines),          and 2 (table frame) make sense.          </para>          </listitem>          </varlistentry>          <varlistentry>          <term><literal>expanded</literal> (or <literal>x</literal>)</term>          <listitem>          <para>          You can specify an optional second argument, if it is provided it          may be either <literal>on</literal> or <literal>off</literal>          which will enable or disable expanded mode.  If the second          argument is not provided then we will toggle between regular and          expanded format. When expanded format is enabled, query results          are displayed in two columns, with the column name on the left and          the data on the right. This mode is useful if the data wouldn't fit          on the screen in the normal <quote>horizontal</quote> mode.          </para>          <para>          Expanded mode is supported by all four output formats.          </para>          </listitem>          </varlistentry>          <varlistentry>          <term><literal>null</literal></term>          <listitem>          <para>          The second argument is a string that should be printed          whenever a column is null. The default is not to print          anything, which can easily be mistaken for, say, an empty          string. Thus, one might choose to write <literal>\pset null          '(null)'</literal>.          </para>          </listitem>          </varlistentry>          <varlistentry>          <term><literal>fieldsep</literal></term>          <listitem>          <para>          Specifies the field separator to be used in unaligned output          mode. That way one can create, for example, tab- or          comma-separated output, which other programs might prefer. To          set a tab as field separator, type <literal>\pset fieldsep          '\t'</literal>. The default field separator is          <literal>'|'</literal> (a vertical bar).          </para>          </listitem>          </varlistentry>          <varlistentry>          <term><literal>footer</literal></term>          <listitem>          <para>          You can specify an optional second argument, if it is provided it          may be either <literal>on</literal> or <literal>off</literal>          which will enable or disable display of the default footer          <literal>(x rows)</literal>.  If the second argument is not          provided then we will toggle between on and off.          </para>          </listitem>          </varlistentry>          <varlistentry>          <term><literal>numericlocale</literal></term>          <listitem>          <para>          You can specify an optional second argument, if it is provided it          may be either <literal>on</literal> or <literal>off</literal>          which will enable or disable display of a locale-aware character          to seperate groups of digits to the left of the decimal marker.  If          the second argument is not provided then we will toggle between          on and off.          </para>          </listitem>          </varlistentry>          <varlistentry>          <term><literal>recordsep</literal></term>          <listitem>          <para>          Specifies the record (line) separator to use in unaligned          output mode. The default is a newline character.          </para>          </listitem>          </varlistentry>          <varlistentry>          <term><literal>tuples_only</literal> (or <literal>t</literal>)</term>          <listitem>          <para>          You can specify an optional second argument, if it is provided it          may be either <literal>on</literal> or <literal>off</literal>          which will enable or disable the tuples only mode.  If the          second argument is not provided then we will toggle between tuples          only and full display. Full display shows extra information such          as column headers, titles, and various footers. In tuples only          mode, only actual table data is shown.          </para>          </listitem>          </varlistentry>          <varlistentry>          <term><literal>title [ <replaceable class="parameter">text</replaceable> ]</literal></term>          <listitem>          <para>          Sets the table title for any subsequently printed tables. This          can be used to give your output descriptive tags. If no          argument is given, the title is unset.          </para>          </listitem>          </varlistentry>          <varlistentry>          <term><literal>tableattr</literal> (or <literal>T</literal>) <literal>[ <replaceable class="parameter">text</replaceable> ]</literal></term>          <listitem>          <para>          Allows you to specify any attributes to be placed inside the          <acronym>HTML</acronym> <sgmltag>table</sgmltag> tag. This          could for example be <literal>cellpadding</literal> or          <literal>bgcolor</literal>. Note that you probably don't want          to specify <literal>border</literal> here, as that is already          taken care of by <literal>\pset border</literal>.          </para>          </listitem>          </varlistentry>          <varlistentry>          <term><literal>pager</literal></term>          <listitem>          <para>          Controls use of a pager for query and <application>psql</>          help output. If the environment variable <envar>PAGER</envar>          is set, the output is piped to the specified program.          Otherwise a platform-dependent default (such as          <filename>more</filename>) is used.          </para>          <para>          When the pager is off, the pager is not used. When the pager          is on, the pager is used only when appropriate, i.e. the     

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -