Home Explore Blog CI



postgresql

2nd chunk of `doc/src/sgml/ref/create_foreign_data_wrapper.sgml`
efc70a2dbbb401399176c62dabb00d28f3016f996a94b7fa00000001000007ee
 function must take no arguments, and
      its return type must be <type>fdw_handler</type>.
     </para>

     <para>
      It is possible to create a foreign-data wrapper with no handler
      function, but foreign tables using such a wrapper can only be declared,
      not accessed.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>VALIDATOR <replaceable class="parameter">validator_function</replaceable></literal></term>
    <listitem>
     <para><replaceable class="parameter">validator_function</replaceable>
      is the name of a previously registered function that will be called to
      check the generic options given to the foreign-data wrapper, as
      well as options for foreign servers, user mappings and foreign tables
      using the foreign-data wrapper.  If no validator function or <literal>NO
      VALIDATOR</literal> is specified, then options will not be
      checked at creation time.  (Foreign-data wrappers will possibly
      ignore or reject invalid option specifications at run time,
      depending on the implementation.)  The validator function must
      take two arguments: one of type <type>text[]</type>, which will
      contain the array of options as stored in the system catalogs,
      and one of type <type>oid</type>, which will be the OID of the
      system catalog containing the options. The return type is ignored;
      the function should report invalid options using the
      <function>ereport(ERROR)</function> function.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>OPTIONS ( <replaceable class="parameter">option</replaceable> '<replaceable class="parameter">value</replaceable>' [, ... ] )</literal></term>
    <listitem>
     <para>
      This clause specifies options for the new foreign-data wrapper.
      The allowed option names and values are specific to each foreign
      data wrapper and are validated using the foreign-data wrapper's
      validator function.  Option names must

Title: CREATE FOREIGN DATA WRAPPER Parameters (Continued)
Summary
This section describes the `VALIDATOR` and `OPTIONS` parameters for the `CREATE FOREIGN DATA WRAPPER` command. The `VALIDATOR` parameter specifies a function to validate options for the foreign-data wrapper, foreign servers, user mappings, and foreign tables. If no validator is specified, options are not checked at creation. The validator function receives the options as a text array and the OID of the system catalog containing the options. The `OPTIONS` parameter allows specifying options for the new foreign-data wrapper, with allowed names and values validated by the validator function.