Skip to content
Snippets Groups Projects
  • Peter Eisentraut's avatar
    6ef24487
    Fix a whitespace issue with the man pages · 6ef24487
    Peter Eisentraut authored
    There is what may actually be a mistake in our markup.  The problem is
    in a situation like
    
    <para>
     <command>FOO</command> is ...
    
    there is strictly speaking a line break before "FOO".  In the HTML
    output, this does not appear to be a problem, but in the man page
    output, this shows up, so you get double blank lines at odd places.
    
    So far, we have attempted to work around this with an XSL hack, but
    that causes other problems, such as creating run-ins in places like
    
    <acronym>SQL</acronym> <command>COPY</command>
    
    So fix the problem properly by removing the extra whitespace.  I only
    fixed the problems that affect the man page output, not all the
    places.
    6ef24487
    History
    Fix a whitespace issue with the man pages
    Peter Eisentraut authored
    There is what may actually be a mistake in our markup.  The problem is
    in a situation like
    
    <para>
     <command>FOO</command> is ...
    
    there is strictly speaking a line break before "FOO".  In the HTML
    output, this does not appear to be a problem, but in the man page
    output, this shows up, so you get double blank lines at odd places.
    
    So far, we have attempted to work around this with an XSL hack, but
    that causes other problems, such as creating run-ins in places like
    
    <acronym>SQL</acronym> <command>COPY</command>
    
    So fix the problem properly by removing the extra whitespace.  I only
    fixed the problems that affect the man page output, not all the
    places.
create_server.sgml 4.40 KiB
<!--
doc/src/sgml/ref/create_server.sgml
PostgreSQL documentation
-->

<refentry id="SQL-CREATESERVER">
 <refmeta>
  <refentrytitle>CREATE SERVER</refentrytitle>
  <manvolnum>7</manvolnum>
  <refmiscinfo>SQL - Language Statements</refmiscinfo>
 </refmeta>

 <refnamediv>
  <refname>CREATE SERVER</refname>
  <refpurpose>define a new foreign server</refpurpose>
 </refnamediv>

 <indexterm zone="sql-createserver">
  <primary>CREATE SERVER</primary>
 </indexterm>

 <refsynopsisdiv>
<synopsis>
CREATE SERVER <replaceable class="parameter">server_name</replaceable> [ TYPE '<replaceable class="parameter">server_type</replaceable>' ] [ VERSION '<replaceable class="parameter">server_version</replaceable>' ]
    FOREIGN DATA WRAPPER <replaceable class="parameter">fdw_name</replaceable>
    [ OPTIONS ( <replaceable class="PARAMETER">option</replaceable> '<replaceable class="PARAMETER">value</replaceable>' [, ... ] ) ]
</synopsis>
 </refsynopsisdiv>

 <refsect1>
  <title>Description</title>

  <para>
   <command>CREATE SERVER</command> defines a new foreign server.  The
   user who defines the server becomes its owner.
  </para>

  <para>
   A foreign server typically encapsulates connection information that
   a foreign-data wrapper uses to access an external data resource.
   Additional user-specific connection information may be specified by
   means of user mappings.
  </para>

  <para>
   The server name must be unique within the database.
  </para>

  <para>
   Creating a server requires <literal>USAGE</> privilege on the
   foreign-data wrapper being used.
  </para>
 </refsect1>

 <refsect1>
  <title>Parameters</title>

  <variablelist>
   <varlistentry>
    <term><replaceable class="parameter">server_name</replaceable></term>
    <listitem>
     <para>
      The name of the foreign server to be created.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><replaceable class="parameter">server_type</replaceable></term>
    <listitem>
     <para>
      Optional server type.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><replaceable class="parameter">server_version</replaceable></term>
    <listitem>
     <para>
      Optional server version.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><replaceable class="parameter">fdw_name</replaceable></term>
    <listitem>
     <para>
      The name of the foreign-data wrapper that manages the server.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>OPTIONS ( <replaceable class="PARAMETER">option</replaceable> '<replaceable class="PARAMETER">value</replaceable>' [, ... ] )</literal></term>
    <listitem>
     <para>
      This clause specifies the options for the server.  The options
      typically define the connection details of the server, but the
      actual names and values are dependent on the server's
      foreign-data wrapper.
     </para>
    </listitem>
   </varlistentry>
  </variablelist>
 </refsect1>

 <refsect1>
  <title>Notes</title>

  <para>
   When using the <application>dblink</application> module
   (see <xref linkend="dblink">), the foreign server name can be used
   as an argument of the <xref linkend="contrib-dblink-connect">
   function to indicate the connection parameters.  See also there for
   more examples.  It is necessary to have
   the <literal>USAGE</literal> privilege on the foreign server to be
   able to use it in this way.
  </para>
 </refsect1>

 <refsect1>
  <title>Examples</title>

  <para>
   Create a server <literal>foo</> that uses the built-in foreign-data
   wrapper <literal>default</>:
<programlisting>
CREATE SERVER foo FOREIGN DATA WRAPPER "default";
</programlisting>
  </para>

  <para>
   Create a server <literal>myserver</> that uses the
   foreign-data wrapper <literal>pgsql</>:
<programlisting>
CREATE SERVER myserver FOREIGN DATA WRAPPER pgsql OPTIONS (host 'foo', dbname 'foodb', port '5432');
</programlisting></para>
 </refsect1>

 <refsect1>
  <title>Compatibility</title>

  <para>
   <command>CREATE SERVER</command> conforms to ISO/IEC 9075-9 (SQL/MED).
  </para>
 </refsect1>

 <refsect1>
  <title>See Also</title>

  <simplelist type="inline">
   <member><xref linkend="sql-alterserver"></member>
   <member><xref linkend="sql-dropserver"></member>
   <member><xref linkend="sql-createforeigndatawrapper"></member>
   <member><xref linkend="sql-createusermapping"></member>
  </simplelist>
 </refsect1>

</refentry>