File tree 4 files changed +40
-11
lines changed
4 files changed +40
-11
lines changed Original file line number Diff line number Diff line change 1
- <!-- $PostgreSQL: pgsql/doc/src/sgml/dblink.sgml,v 1.7 2009/06/06 21:27:56 joe Exp $ -->
1
+ <!-- $PostgreSQL: pgsql/doc/src/sgml/dblink.sgml,v 1.8 2009/06/18 14:34:36 petere Exp $ -->
2
2
3
3
<sect1 id="dblink">
4
4
<title>dblink</title>
45
45
46
46
<para>
47
47
The connection string may also be the name of an existing foreign
48
- server that utilizes the postgresql_fdw foreign data wrapper library.
49
- See the example below, as well as the following:
48
+ server. It is recommended to use
49
+ the <function>postgresql_fdw_validator</function> when defining
50
+ the corresponding foreign-data wrapper. See the example below, as
51
+ well as the following:
50
52
<simplelist type="inline">
51
53
<member><xref linkend="sql-createforeigndatawrapper" endterm="sql-createforeigndatawrapper-title"></member>
52
54
<member><xref linkend="sql-createserver" endterm="sql-createserver-title"></member>
134
136
-- DETAIL: Non-superuser cannot connect if the server does not request a password.
135
137
-- HINT: Target server's authentication method must be changed.
136
138
CREATE USER dblink_regression_test WITH PASSWORD 'secret';
137
- CREATE FOREIGN DATA WRAPPER postgresql;
139
+ CREATE FOREIGN DATA WRAPPER postgresql VALIDATOR postgresql_fdw_validator ;
138
140
CREATE SERVER fdtest FOREIGN DATA WRAPPER postgresql OPTIONS (hostaddr '127.0.0.1', dbname 'contrib_regression');
139
141
140
142
CREATE USER MAPPING FOR dblink_regression_test SERVER fdtest OPTIONS (user 'dblink_regression_test', password 'secret');
Original file line number Diff line number Diff line change 1
1
<!--
2
- $PostgreSQL: pgsql/doc/src/sgml/ref/create_foreign_data_wrapper.sgml,v 1.3 2009/02/27 07:20:00 petere Exp $
2
+ $PostgreSQL: pgsql/doc/src/sgml/ref/create_foreign_data_wrapper.sgml,v 1.4 2009/06/18 14:34:36 petere Exp $
3
3
PostgreSQL documentation
4
4
-->
5
5
@@ -103,7 +103,9 @@ CREATE FOREIGN DATA WRAPPER <replaceable class="parameter">name</replaceable>
103
103
rudimentary. The purpose of foreign-data wrappers, foreign
104
104
servers, and user mappings is to store this information in a
105
105
standard way so that it can be queried by interested applications.
106
- The functionality to actually query external data does not exist
106
+ One such application is <application>dblink</application>;
107
+ see <xref linkend="dblink">. The functionality to actually query
108
+ external data through a foreign-data wrapper library does not exist
107
109
yet.
108
110
</para>
109
111
Original file line number Diff line number Diff line change 1
1
<!--
2
- $PostgreSQL: pgsql/doc/src/sgml/ref/create_server.sgml,v 1.3 2009/02/27 07:20:00 petere Exp $
2
+ $PostgreSQL: pgsql/doc/src/sgml/ref/create_server.sgml,v 1.4 2009/06/18 14:34:36 petere Exp $
3
3
PostgreSQL documentation
4
4
-->
5
5
@@ -34,6 +34,13 @@ CREATE SERVER <replaceable class="parameter">servername</replaceable> [ TYPE 'se
34
34
user who defines the server becomes its owner.
35
35
</para>
36
36
37
+ <para>
38
+ A foreign server typically encapsulates connection information that
39
+ a foreign-data wrapper uses to access an external data resource.
40
+ Additional user-specific connection information may be specified by
41
+ means of user mappings.
42
+ </para>
43
+
37
44
<para>
38
45
The server name must be unique within the database.
39
46
</para>
@@ -98,6 +105,20 @@ CREATE SERVER <replaceable class="parameter">servername</replaceable> [ TYPE 'se
98
105
</variablelist>
99
106
</refsect1>
100
107
108
+ <refsect1>
109
+ <title>Notes</title>
110
+
111
+ <para>
112
+ When using the <application>dblink</application> module
113
+ (see <xref linkend="dblink">), the foreign server name can be used
114
+ as an argument of the <xref linkend="contrib-dblink-connect">
115
+ function to indicate the connection parameters. See also there for
116
+ more examples. It is necessary to have
117
+ the <literal>USAGE</literal> privilege on the foreign server to be
118
+ able to use it in this way.
119
+ </para>
120
+ </refsect1>
121
+
101
122
<refsect1>
102
123
<title>Examples</title>
103
124
Original file line number Diff line number Diff line change 1
1
<!--
2
- $PostgreSQL: pgsql/doc/src/sgml/ref/create_user_mapping.sgml,v 1.4 2009/02/27 07:20:00 petere Exp $
2
+ $PostgreSQL: pgsql/doc/src/sgml/ref/create_user_mapping.sgml,v 1.5 2009/06/18 14:34:36 petere Exp $
3
3
PostgreSQL documentation
4
4
-->
5
5
@@ -31,7 +31,10 @@ CREATE USER MAPPING FOR { <replaceable class="parameter">username</replaceable>
31
31
32
32
<para>
33
33
<command>CREATE USER MAPPING</command> defines a mapping of a user
34
- to a foreign server.
34
+ to a foreign server. A user mapping typically encapsulates
35
+ connection information that a foreign-data wrapper uses together
36
+ with the information encapsulated be a foreign server to access an
37
+ external data resource.
35
38
</para>
36
39
37
40
<para>
@@ -52,8 +55,9 @@ CREATE USER MAPPING FOR { <replaceable class="parameter">username</replaceable>
52
55
<para>
53
56
The name of an existing user that is mapped to foreign server.
54
57
<literal>CURRENT_USER</> and <literal>USER</> match the name of
55
- the current user. <literal>PUBLIC</> is used to match all
56
- present and future user names in the system.
58
+ the current user. When <literal>PUBLIC</> is specified, a
59
+ so-called public mapping is created that is used when no
60
+ user-specific mapping is applicable.
57
61
</para>
58
62
</listitem>
59
63
</varlistentry>
You can’t perform that action at this time.
0 commit comments