aboutsummaryrefslogtreecommitdiff
path: root/doc/src/sgml/ref/alter_foreign_data_wrapper.sgml
blob: 155c8944375035f74f0cbfdceb226155b6fe3e1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/alter_foreign_data_wrapper.sgml,v 1.2 2009/02/24 10:06:32 petere Exp $
PostgreSQL documentation
-->

<refentry id="SQL-ALTERFOREIGNDATAWRAPPER">
 <refmeta>
  <refentrytitle id="sql-alterforeigndatawrapper-title">ALTER FOREIGN DATA WRAPPER</refentrytitle>
  <refmiscinfo>SQL - Language Statements</refmiscinfo>
 </refmeta>

 <refnamediv>
  <refname>ALTER FOREIGN DATA WRAPPER</refname>
  <refpurpose>change the definition of a foreign-data wrapper</refpurpose>
 </refnamediv>

 <indexterm zone="sql-alterforeigndatawrapper">
  <primary>ALTER FOREIGN DATA WRAPPER</primary>
 </indexterm>

 <refsynopsisdiv>
<synopsis>
ALTER FOREIGN DATA WRAPPER <replaceable class="parameter">name</replaceable>
    [ VALIDATOR <replaceable class="parameter">valfunction</replaceable> | NO VALIDATOR ]
    [ OPTIONS ( [ ADD | SET | DROP ] <replaceable class="PARAMETER">option</replaceable> ['<replaceable class="PARAMETER">value</replaceable>'] [, ... ]) ]
ALTER FOREIGN DATA WRAPPER <replaceable class="parameter">name</replaceable> OWNER TO <replaceable>new_owner</replaceable>
</synopsis>
 </refsynopsisdiv>

 <refsect1>
  <title>Description</title>

  <para>
   <command>ALTER FOREIGN DATA WRAPPER</command> changes the
   definition of a foreign-data wrapper.  The first form of the
   command changes the library or the generic options of the
   foreign-data wrapper (at least one clause is required).  The second
   form changes the owner of the foreign-data wrapper.
  </para>

  <para>
   Only superusers can alter foreign-data wrappers.  Additionally,
   only superusers can own foreign-data wrappers.
  </para>
 </refsect1>

 <refsect1>
  <title>Parameters</title>

  <variablelist>
   <varlistentry>
    <term><replaceable class="parameter">name</replaceable></term>
    <listitem>
     <para>
      The name of an existing foreign-data wrapper.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>VALIDATOR <replaceable class="parameter">valfunction</replaceable></literal></term>
    <listitem>
     <para>
      Specifies a new foreign-data wrapper validator function.
     </para>

     <para>
      Note that it is possible that after changing the validator the
      options to the foreign-data wrapper, servers, and user mappings
      have become invalid.   It is up to the user to make sure that
      these options are correct before using the foreign-data
      wrapper.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>NO VALIDATOR</literal></term>
    <listitem>
     <para>
      This is used to specify that the foreign-data wrapper should no
      longer have a validator function.
     </para>
    </listitem>
   </varlistentry>

   <varlistentry>
    <term><literal>OPTIONS ( [ ADD | SET | DROP ] <replaceable class="PARAMETER">option</replaceable> ['<replaceable class="PARAMETER">value</replaceable>'] [, ... ] )</literal></term>
    <listitem>
     <para>
      Change options for the foreign-data
      wrapper.  <literal>ADD</>, <literal>SET</>, and <literal>DROP</>
      specify the action to be performed.  <literal>ADD</> is assumed
      if no operation is explicitly specified.  Option names must be
      unique; names and values are also validated using the foreign
      data wrapper library.
     </para>
    </listitem>
   </varlistentry>
  </variablelist>
 </refsect1>

 <refsect1>
  <title>Examples</title>

  <para>
   Change a foreign-data wrapper <literal>dbi</>, add
   option <literal>foo</>, drop <literal>bar</>:
<programlisting>
ALTER FOREIGN DATA WRAPPER dbi OPTIONS (ADD foo '1', DROP 'bar');
</programlisting>
  </para>

  <para>
   Change the foreign-data wrapper <literal>dbi</> validator
   to <literal>bob.myvalidator</>:
<programlisting>
ALTER FOREIGN DATA WRAPPER dbi VALIDATOR bob.myvalidator;
</programlisting>
  </para>
 </refsect1>

 <refsect1>
  <title>Compatibility</title>

  <para>
   <command>ALTER FOREIGN DATA WRAPPER</command> conforms to ISO/IEC
   9075-9 (SQL/MED).  The standard does not specify the <literal>
   VALIDATOR</literal> and <literal>OWNER TO</> variants of the
   command.
  </para>
 </refsect1>

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

  <simplelist type="inline">
   <member><xref linkend="sql-createforeigndatawrapper" endterm="sql-createforeigndatawrapper-title"></member>
   <member><xref linkend="sql-dropforeigndatawrapper" endterm="sql-dropforeigndatawrapper-title"></member>
  </simplelist>
 </refsect1>

</refentry>