mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-03-20 02:56:58 +08:00
Allow CREATE SUBSCRIPTION to accept a foreign server using the SERVER
clause instead of a raw connection string using the CONNECTION clause.
* Enables a user with sufficient privileges to create a subscription
using a foreign server by name without specifying the connection
details.
* Integrates with user mappings (and other FDW infrastructure) using
the subscription owner.
* Provides a layer of indirection to manage multiple subscriptions
to the same remote server more easily.
Also add CREATE FOREIGN DATA WRAPPER ... CONNECTION clause to specify
a connection_function. To be eligible for a subscription, the foreign
server's foreign data wrapper must specify a connection_function.
Add connection_function support to postgres_fdw, and bump postgres_fdw
version to 1.3.
Bump catversion.
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Reviewed-by: Shlok Kyal <shlok.kyal.oss@gmail.com>
Reviewed-by: Masahiko Sawada <sawada.mshk@gmail.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Discussion: https://postgr.es/m/61831790a0a937038f78ce09f8dd4cef7de7456a.camel@j-davis.com
13 lines
478 B
SQL
13 lines
478 B
SQL
/* contrib/postgres_fdw/postgres_fdw--1.2--1.3.sql */
|
|
|
|
-- complain if script is sourced in psql, rather than via ALTER EXTENSION
|
|
\echo Use "ALTER EXTENSION postgres_fdw UPDATE TO '1.3'" to load this file. \quit
|
|
|
|
-- takes internal parameter to prevent calling from SQL
|
|
CREATE FUNCTION postgres_fdw_connection(oid, oid, internal)
|
|
RETURNS text
|
|
AS 'MODULE_PATHNAME'
|
|
LANGUAGE C STRICT PARALLEL RESTRICTED;
|
|
|
|
ALTER FOREIGN DATA WRAPPER postgres_fdw CONNECTION postgres_fdw_connection;
|