mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-27 08:39:28 +08:00
8255566f9d
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
15 lines
420 B
SQL
15 lines
420 B
SQL
/* contrib/dblink/dblink--1.0--1.1.sql */
|
|
|
|
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
|
|
\echo Use "ALTER EXTENSION dblink UPDATE TO '1.1'" to load this file. \quit
|
|
|
|
CREATE FUNCTION dblink_fdw_validator(
|
|
options text[],
|
|
catalog oid
|
|
)
|
|
RETURNS void
|
|
AS 'MODULE_PATHNAME', 'dblink_fdw_validator'
|
|
LANGUAGE C STRICT;
|
|
|
|
CREATE FOREIGN DATA WRAPPER dblink_fdw VALIDATOR dblink_fdw_validator;
|