aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2012-10-10 16:53:08 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2012-10-10 16:53:08 -0400
commit8255566f9d479fdfeea09da3141d26afdbb5abe2 (patch)
tree00d54179dbdb5ea74c7fc782b001400993ff894b /doc/src
parent392b2e5010ddce24bcb1a9d38adb1d06f01fb543 (diff)
downloadpostgresql-8255566f9d479fdfeea09da3141d26afdbb5abe2.tar.gz
postgresql-8255566f9d479fdfeea09da3141d26afdbb5abe2.zip
Create an improved FDW option validator function for contrib/dblink.
dblink now has its own validator function dblink_fdw_validator(), which is better than the core function postgresql_fdw_validator() because it gets the list of legal options from libpq instead of having a hard-wired list. Make the dblink extension module provide a standard foreign data wrapper dblink_fdw that encapsulates use of this validator, and recommend use of that wrapper instead of making up wrappers on the fly. Unfortunately, because ad-hoc wrappers *were* recommended practice previously, it's not clear when we can get rid of postgresql_fdw_validator without causing upgrade problems. But this is a step in the right direction. Shigeru Hanada, reviewed by KaiGai Kohei
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/dblink.sgml12
1 files changed, 4 insertions, 8 deletions
diff --git a/doc/src/sgml/dblink.sgml b/doc/src/sgml/dblink.sgml
index 72ca765be73..186ab865865 100644
--- a/doc/src/sgml/dblink.sgml
+++ b/doc/src/sgml/dblink.sgml
@@ -46,12 +46,10 @@ dblink_connect(text connname, text connstr) returns text
<para>
The connection string may also be the name of an existing foreign
- server. It is recommended to use
- the <function>postgresql_fdw_validator</function> when defining
- the corresponding foreign-data wrapper. See the example below, as
- well as the following:
+ server. It is recommended to use the foreign-data wrapper
+ <literal>dblink_fdw</literal> when defining the corresponding foreign
+ server. See the example below, as well as the following:
<simplelist type="inline">
- <member><xref linkend="sql-createforeigndatawrapper"></member>
<member><xref linkend="sql-createserver"></member>
<member><xref linkend="sql-createusermapping"></member>
</simplelist>
@@ -136,8 +134,7 @@ SELECT dblink_connect('myconn', 'dbname=postgres');
-- DETAIL: Non-superuser cannot connect if the server does not request a password.
-- HINT: Target server's authentication method must be changed.
CREATE USER dblink_regression_test WITH PASSWORD 'secret';
-CREATE FOREIGN DATA WRAPPER postgresql VALIDATOR postgresql_fdw_validator;
-CREATE SERVER fdtest FOREIGN DATA WRAPPER postgresql OPTIONS (hostaddr '127.0.0.1', dbname 'contrib_regression');
+CREATE SERVER fdtest FOREIGN DATA WRAPPER dblink_fdw OPTIONS (hostaddr '127.0.0.1', dbname 'contrib_regression');
CREATE USER MAPPING FOR dblink_regression_test SERVER fdtest OPTIONS (user 'dblink_regression_test', password 'secret');
GRANT USAGE ON FOREIGN SERVER fdtest TO dblink_regression_test;
@@ -173,7 +170,6 @@ REVOKE SELECT ON TABLE foo FROM dblink_regression_test;
DROP USER MAPPING FOR dblink_regression_test SERVER fdtest;
DROP USER dblink_regression_test;
DROP SERVER fdtest;
-DROP FOREIGN DATA WRAPPER postgresql;
</screen>
</refsect1>
</refentry>