public inbox for [email protected]
help / color / mirror / Atom feedFrom: Bharath Rupireddy <[email protected]>
To: Jeff Davis <[email protected]>
Cc: Ashutosh Bapat <[email protected]>
Cc: Joe Conway <[email protected]>
Cc: [email protected]
Subject: Re: [17] CREATE SUBSCRIPTION ... SERVER
Date: Mon, 29 Jan 2024 23:17:40 +0530
Message-ID: <CALj2ACXnQkqsP90DdXW7uVLzn4eRj6cyGwaJ4W0UjQOr8ELRJA@mail.gmail.com> (raw)
In-Reply-To: <CALj2ACXW+GQy3ppBoKWbVoF7Cq5VaOemP2MuhJou-bYV04BjVw@mail.gmail.com>
References: <[email protected]>
<CAExHW5vv-78ixJs3arsuZ+12A4AyqehJnDPhejp0m4FAKG6JZA@mail.gmail.com>
<[email protected]>
<CAExHW5sAo4Gv3AwuxQNGSQ2Z45B8_MZEb-SG-B8D-hLMdrquAg@mail.gmail.com>
<[email protected]>
<[email protected]>
<CAExHW5unvpDv6yMSmqurHP7Du1PqoJFWVxeK-4YNm5EnoNJiSQ@mail.gmail.com>
<[email protected]>
<CAExHW5sQVJeCgCGMkum_k4Z4VPaK5GkdAjHW-d+F3MngBZ9qBA@mail.gmail.com>
<[email protected]>
<[email protected]>
<[email protected]>
<CALj2ACXDua2Az15Kj3OZFaRm49G8-faemiEEv8t9GNCcsxv8Hw@mail.gmail.com>
<[email protected]>
<CAExHW5v5poohyfNRVQp3yjVE56ej0dWvVMbysSSVtg21aHT3uQ@mail.gmail.com>
<[email protected]>
<CAExHW5vF+cp9efQj=-W+Rhbr9f9ZZqt3XFnP0NB5jKsm=C=5tw@mail.gmail.com>
<[email protected]>
<[email protected]>
<CAExHW5uCzS-VeSYQHTHxFSdQik-f_O892xmzrzm2fuO+ro+otA@mail.gmail.com>
<[email protected]>
<CAExHW5vDPBB_PShBmSj=v=Jf1K=vSmWdPZTzCJsLpqDgqek+sA@mail.gmail.com>
<[email protected]>
<CALj2ACXW+GQy3ppBoKWbVoF7Cq5VaOemP2MuhJou-bYV04BjVw@mail.gmail.com>
On Mon, Jan 29, 2024 at 11:11 PM Bharath Rupireddy
<[email protected]> wrote:
>
> On Wed, Jan 24, 2024 at 7:15 AM Jeff Davis <[email protected]> wrote:
> >
> > On Tue, 2024-01-23 at 15:21 +0530, Ashutosh Bapat wrote:
> > > I am with the prefix. The changes it causes make review difficult. If
> > > you can separate those changes into a patch that will help.
> >
> > I ended up just removing the dummy FDW. Real users are likely to want
> > to use postgres_fdw, and if not, it's easy enough to issue a CREATE
> > FOREIGN DATA WRAPPER. Or I can bring it back if desired.
> >
> > Updated patch set (patches are renumbered):
> >
> > * removed dummy FDW and test churn
> > * made a new pg_connection_validator function which leaves
> > postgresql_fdw_validator in place. (I didn't document the new function
> > -- should I?)
> > * included your tests improvements
> > * removed dependency from the subscription to the user mapping -- we
> > don't depend on the user mapping for foreign tables, so we shouldn't
> > depend on them here. Of course a change to a user mapping still
> > invalidates the subscription worker and it will restart.
> > * general cleanup
> >
> > Overall it's simpler and hopefully easier to review. The patch to
> > introduce the pg_create_connection role could use some more discussion,
> > but I believe 0001 and 0002 are nearly ready.
>
> Thanks for the patches. I have some comments on v9-0001:
>
> 1.
> +SELECT pg_conninfo_from_server('testserver1', CURRENT_USER, false);
> + pg_conninfo_from_server
> +-----------------------------------
> + user = 'value' password = 'value'
>
> Isn't this function an unsafe one as it shows the password? I don't
> see its access being revoked from the public. If it seems important
> for one to understand how the server forms a connection string by
> gathering bits and pieces from foreign server and user mapping, why
> can't it look for the password in the result string and mask it before
> returning it as output?
>
> 2.
> + */
> +typedef const struct ConnectionOption *(*walrcv_conninfo_options_fn) (void);
> +
>
> struct here is unnecessary as the structure definition of
> ConnectionOption is typedef-ed already.
>
> 3.
> + OPTIONS (user 'publicuser', password $pwd$'\"$# secret'$pwd$);
>
> Is pwd here present working directory name? If yes, isn't it going to
> be different on BF animals making test output unstable?
>
> 4.
> -struct ConnectionOption
> +struct TestConnectionOption
> {
>
> How about say PgFdwConnectionOption instead of TestConnectionOption?
>
> 5. Comment #4 makes me think - why not get rid of
> postgresql_fdw_validator altogether and use pg_connection_validator
> instead for testing purposes? The tests don't complain much, see the
> patch Remove-deprecated-postgresql_fdw_validator.diff created on top
> of v9-0001.
>
> I'll continue to review the other patches.
I forgot to attach the diff patch as specified in comment #5, please
find the attached. Sorry for the noise.
--
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com
Attachments:
[application/octet-stream] Remove-deprecated-postgresql_fdw_validator.diff (32.2K, 2-Remove-deprecated-postgresql_fdw_validator.diff)
download | inline diff:
From fc2079981862b0b45259d5c9e27547f571af4762 Mon Sep 17 00:00:00 2001
From: Bharath Rupireddy <[email protected]>
Date: Mon, 29 Jan 2024 17:34:35 +0000
Subject: [PATCH] Remove deprecated postgresql_fdw_validator
---
src/backend/foreign/foreign.c | 113 -------------
src/include/catalog/pg_proc.dat | 4 -
src/test/regress/expected/create_am.out | 2 +-
src/test/regress/expected/foreign_data.out | 174 ++++++++++-----------
src/test/regress/sql/create_am.sql | 2 +-
src/test/regress/sql/foreign_data.sql | 6 +-
6 files changed, 92 insertions(+), 209 deletions(-)
diff --git a/src/backend/foreign/foreign.c b/src/backend/foreign/foreign.c
index b4635d6eba..d83e84c070 100644
--- a/src/backend/foreign/foreign.c
+++ b/src/backend/foreign/foreign.c
@@ -786,119 +786,6 @@ pg_connection_validator(PG_FUNCTION_ARGS)
}
-/*
- * Describes the valid options for postgresql FDW, server, and user mapping.
- */
-struct TestConnectionOption
-{
- const char *optname;
- Oid optcontext; /* Oid of catalog in which option may appear */
-};
-
-/*
- * Copied from fe-connect.c PQconninfoOptions.
- *
- * The list is small - don't bother with bsearch if it stays so.
- */
-static const struct TestConnectionOption test_conninfo_options[] = {
- {"authtype", ForeignServerRelationId},
- {"service", ForeignServerRelationId},
- {"user", UserMappingRelationId},
- {"password", UserMappingRelationId},
- {"connect_timeout", ForeignServerRelationId},
- {"dbname", ForeignServerRelationId},
- {"host", ForeignServerRelationId},
- {"hostaddr", ForeignServerRelationId},
- {"port", ForeignServerRelationId},
- {"tty", ForeignServerRelationId},
- {"options", ForeignServerRelationId},
- {"requiressl", ForeignServerRelationId},
- {"sslmode", ForeignServerRelationId},
- {"gsslib", ForeignServerRelationId},
- {"gssdelegation", ForeignServerRelationId},
- {NULL, InvalidOid}
-};
-
-
-/*
- * Check if the provided option is one of the test conninfo options.
- * context is the Oid of the catalog the option came from, or 0 if we
- * don't care.
- */
-static bool
-is_test_conninfo_option(const char *option, Oid context)
-{
- const struct TestConnectionOption *opt;
-
- for (opt = test_conninfo_options; opt->optname; opt++)
- if (context == opt->optcontext && strcmp(opt->optname, option) == 0)
- return true;
- return false;
-}
-
-
-/*
- * Validate the generic option given to SERVER or USER MAPPING.
- * Raise an ERROR if the option or its value is considered invalid.
- *
- * Valid server options are all libpq conninfo options except
- * user and password -- these may only appear in USER MAPPING options.
- *
- * Caution: this function is deprecated, and is now meant only for testing
- * purposes, because the list of options it knows about doesn't necessarily
- * square with those known to whichever libpq instance you might be using.
- * Inquire of libpq itself, instead.
- */
-Datum
-postgresql_fdw_validator(PG_FUNCTION_ARGS)
-{
- List *options_list = untransformRelOptions(PG_GETARG_DATUM(0));
- Oid catalog = PG_GETARG_OID(1);
-
- ListCell *cell;
-
- foreach(cell, options_list)
- {
- DefElem *def = lfirst(cell);
-
- if (!is_test_conninfo_option(def->defname, catalog))
- {
- const struct TestConnectionOption *opt;
- const char *closest_match;
- ClosestMatchState match_state;
- bool has_valid_options = false;
-
- /*
- * Unknown option specified, complain about it. Provide a hint
- * with a valid option that looks similar, if there is one.
- */
- initClosestMatch(&match_state, def->defname, 4);
- for (opt = test_conninfo_options; opt->optname; opt++)
- {
- if (catalog == opt->optcontext)
- {
- has_valid_options = true;
- updateClosestMatch(&match_state, opt->optname);
- }
- }
-
- closest_match = getClosestMatch(&match_state);
- ereport(ERROR,
- (errcode(ERRCODE_SYNTAX_ERROR),
- errmsg("invalid option \"%s\"", def->defname),
- has_valid_options ? closest_match ?
- errhint("Perhaps you meant the option \"%s\".",
- closest_match) : 0 :
- errhint("There are no valid options in this context.")));
-
- PG_RETURN_BOOL(false);
- }
- }
-
- PG_RETURN_BOOL(true);
-}
-
-
/*
* get_foreign_data_wrapper_oid - given a FDW name, look up the OID
*
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index 1ea5e03b6c..8a988b5efa 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -7513,10 +7513,6 @@
proargtypes => 'regclass', prosrc => 'pg_relation_filepath' },
{ oid => '2316', descr => '(internal)',
- proname => 'postgresql_fdw_validator', prorettype => 'bool',
- proargtypes => '_text oid', prosrc => 'postgresql_fdw_validator' },
-
-{ oid => '6015', descr => '(internal)',
proname => 'pg_connection_validator', prorettype => 'bool',
proargtypes => '_text oid', prosrc => 'pg_connection_validator' },
diff --git a/src/test/regress/expected/create_am.out b/src/test/regress/expected/create_am.out
index b50293d514..f212122c3c 100644
--- a/src/test/regress/expected/create_am.out
+++ b/src/test/regress/expected/create_am.out
@@ -334,7 +334,7 @@ CREATE TABLE tableam_parted_2_heapx PARTITION OF tableam_parted_heapx FOR VALUES
-- sequences, views and foreign servers shouldn't have an AM
CREATE VIEW tableam_view_heapx AS SELECT * FROM tableam_tbl_heapx;
CREATE SEQUENCE tableam_seq_heapx;
-CREATE FOREIGN DATA WRAPPER fdw_heap2 VALIDATOR postgresql_fdw_validator;
+CREATE FOREIGN DATA WRAPPER fdw_heap2 VALIDATOR pg_connection_validator;
CREATE SERVER fs_heap2 FOREIGN DATA WRAPPER fdw_heap2 ;
CREATE FOREIGN table tableam_fdw_heapx () SERVER fs_heap2;
-- Verify that new AM was used for tables, matviews, but not for sequences, views and fdws
diff --git a/src/test/regress/expected/foreign_data.out b/src/test/regress/expected/foreign_data.out
index 0211531f32..169bf5cb99 100644
--- a/src/test/regress/expected/foreign_data.out
+++ b/src/test/regress/expected/foreign_data.out
@@ -23,13 +23,13 @@ CREATE ROLE regress_test_indirect;
CREATE ROLE regress_unprivileged_role;
CREATE FOREIGN DATA WRAPPER dummy;
COMMENT ON FOREIGN DATA WRAPPER dummy IS 'useless';
-CREATE FOREIGN DATA WRAPPER postgresql VALIDATOR postgresql_fdw_validator;
+CREATE FOREIGN DATA WRAPPER postgresql VALIDATOR pg_connection_validator;
-- At this point we should have 2 built-in wrappers and no servers.
SELECT fdwname, fdwhandler::regproc, fdwvalidator::regproc, fdwoptions FROM pg_foreign_data_wrapper ORDER BY 1, 2, 3;
- fdwname | fdwhandler | fdwvalidator | fdwoptions
-------------+------------+--------------------------+------------
- dummy | - | - |
- postgresql | - | postgresql_fdw_validator |
+ fdwname | fdwhandler | fdwvalidator | fdwoptions
+------------+------------+-------------------------+------------
+ dummy | - | - |
+ postgresql | - | pg_connection_validator |
(2 rows)
SELECT srvname, srvoptions FROM pg_foreign_server;
@@ -47,12 +47,12 @@ CREATE FOREIGN DATA WRAPPER foo VALIDATOR bar; -- ERROR
ERROR: function bar(text[], oid) does not exist
CREATE FOREIGN DATA WRAPPER foo;
\dew
- List of foreign-data wrappers
- Name | Owner | Handler | Validator
-------------+---------------------------+---------+--------------------------
+ List of foreign-data wrappers
+ Name | Owner | Handler | Validator
+------------+---------------------------+---------+-------------------------
dummy | regress_foreign_data_user | - | -
foo | regress_foreign_data_user | - | -
- postgresql | regress_foreign_data_user | - | postgresql_fdw_validator
+ postgresql | regress_foreign_data_user | - | pg_connection_validator
(3 rows)
CREATE FOREIGN DATA WRAPPER foo; -- duplicate
@@ -60,12 +60,12 @@ ERROR: foreign-data wrapper "foo" already exists
DROP FOREIGN DATA WRAPPER foo;
CREATE FOREIGN DATA WRAPPER foo OPTIONS (testing '1');
\dew+
- List of foreign-data wrappers
- Name | Owner | Handler | Validator | Access privileges | FDW options | Description
-------------+---------------------------+---------+--------------------------+-------------------+---------------+-------------
- dummy | regress_foreign_data_user | - | - | | | useless
- foo | regress_foreign_data_user | - | - | | (testing '1') |
- postgresql | regress_foreign_data_user | - | postgresql_fdw_validator | | |
+ List of foreign-data wrappers
+ Name | Owner | Handler | Validator | Access privileges | FDW options | Description
+------------+---------------------------+---------+-------------------------+-------------------+---------------+-------------
+ dummy | regress_foreign_data_user | - | - | | | useless
+ foo | regress_foreign_data_user | - | - | | (testing '1') |
+ postgresql | regress_foreign_data_user | - | pg_connection_validator | | |
(3 rows)
DROP FOREIGN DATA WRAPPER foo;
@@ -74,11 +74,11 @@ ERROR: option "testing" provided more than once
CREATE FOREIGN DATA WRAPPER foo OPTIONS (testing '1', another '2');
\dew+
List of foreign-data wrappers
- Name | Owner | Handler | Validator | Access privileges | FDW options | Description
-------------+---------------------------+---------+--------------------------+-------------------+----------------------------+-------------
- dummy | regress_foreign_data_user | - | - | | | useless
- foo | regress_foreign_data_user | - | - | | (testing '1', another '2') |
- postgresql | regress_foreign_data_user | - | postgresql_fdw_validator | | |
+ Name | Owner | Handler | Validator | Access privileges | FDW options | Description
+------------+---------------------------+---------+-------------------------+-------------------+----------------------------+-------------
+ dummy | regress_foreign_data_user | - | - | | | useless
+ foo | regress_foreign_data_user | - | - | | (testing '1', another '2') |
+ postgresql | regress_foreign_data_user | - | pg_connection_validator | | |
(3 rows)
DROP FOREIGN DATA WRAPPER foo;
@@ -87,14 +87,14 @@ CREATE FOREIGN DATA WRAPPER foo; -- ERROR
ERROR: permission denied to create foreign-data wrapper "foo"
HINT: Must be superuser to create a foreign-data wrapper.
RESET ROLE;
-CREATE FOREIGN DATA WRAPPER foo VALIDATOR postgresql_fdw_validator;
+CREATE FOREIGN DATA WRAPPER foo VALIDATOR pg_connection_validator;
\dew+
- List of foreign-data wrappers
- Name | Owner | Handler | Validator | Access privileges | FDW options | Description
-------------+---------------------------+---------+--------------------------+-------------------+-------------+-------------
- dummy | regress_foreign_data_user | - | - | | | useless
- foo | regress_foreign_data_user | - | postgresql_fdw_validator | | |
- postgresql | regress_foreign_data_user | - | postgresql_fdw_validator | | |
+ List of foreign-data wrappers
+ Name | Owner | Handler | Validator | Access privileges | FDW options | Description
+------------+---------------------------+---------+-------------------------+-------------------+-------------+-------------
+ dummy | regress_foreign_data_user | - | - | | | useless
+ foo | regress_foreign_data_user | - | pg_connection_validator | | |
+ postgresql | regress_foreign_data_user | - | pg_connection_validator | | |
(3 rows)
-- HANDLER related checks
@@ -119,12 +119,12 @@ ALTER FOREIGN DATA WRAPPER foo VALIDATOR bar; -- ERROR
ERROR: function bar(text[], oid) does not exist
ALTER FOREIGN DATA WRAPPER foo NO VALIDATOR;
\dew+
- List of foreign-data wrappers
- Name | Owner | Handler | Validator | Access privileges | FDW options | Description
-------------+---------------------------+---------+--------------------------+-------------------+-------------+-------------
- dummy | regress_foreign_data_user | - | - | | | useless
- foo | regress_foreign_data_user | - | - | | |
- postgresql | regress_foreign_data_user | - | postgresql_fdw_validator | | |
+ List of foreign-data wrappers
+ Name | Owner | Handler | Validator | Access privileges | FDW options | Description
+------------+---------------------------+---------+-------------------------+-------------------+-------------+-------------
+ dummy | regress_foreign_data_user | - | - | | | useless
+ foo | regress_foreign_data_user | - | - | | |
+ postgresql | regress_foreign_data_user | - | pg_connection_validator | | |
(3 rows)
ALTER FOREIGN DATA WRAPPER foo OPTIONS (a '1', b '2');
@@ -135,33 +135,33 @@ ERROR: option "c" not found
ALTER FOREIGN DATA WRAPPER foo OPTIONS (ADD x '1', DROP x);
\dew+
List of foreign-data wrappers
- Name | Owner | Handler | Validator | Access privileges | FDW options | Description
-------------+---------------------------+---------+--------------------------+-------------------+----------------+-------------
- dummy | regress_foreign_data_user | - | - | | | useless
- foo | regress_foreign_data_user | - | - | | (a '1', b '2') |
- postgresql | regress_foreign_data_user | - | postgresql_fdw_validator | | |
+ Name | Owner | Handler | Validator | Access privileges | FDW options | Description
+------------+---------------------------+---------+-------------------------+-------------------+----------------+-------------
+ dummy | regress_foreign_data_user | - | - | | | useless
+ foo | regress_foreign_data_user | - | - | | (a '1', b '2') |
+ postgresql | regress_foreign_data_user | - | pg_connection_validator | | |
(3 rows)
ALTER FOREIGN DATA WRAPPER foo OPTIONS (DROP a, SET b '3', ADD c '4');
\dew+
List of foreign-data wrappers
- Name | Owner | Handler | Validator | Access privileges | FDW options | Description
-------------+---------------------------+---------+--------------------------+-------------------+----------------+-------------
- dummy | regress_foreign_data_user | - | - | | | useless
- foo | regress_foreign_data_user | - | - | | (b '3', c '4') |
- postgresql | regress_foreign_data_user | - | postgresql_fdw_validator | | |
+ Name | Owner | Handler | Validator | Access privileges | FDW options | Description
+------------+---------------------------+---------+-------------------------+-------------------+----------------+-------------
+ dummy | regress_foreign_data_user | - | - | | | useless
+ foo | regress_foreign_data_user | - | - | | (b '3', c '4') |
+ postgresql | regress_foreign_data_user | - | pg_connection_validator | | |
(3 rows)
ALTER FOREIGN DATA WRAPPER foo OPTIONS (a '2');
ALTER FOREIGN DATA WRAPPER foo OPTIONS (b '4'); -- ERROR
ERROR: option "b" provided more than once
\dew+
- List of foreign-data wrappers
- Name | Owner | Handler | Validator | Access privileges | FDW options | Description
-------------+---------------------------+---------+--------------------------+-------------------+-----------------------+-------------
- dummy | regress_foreign_data_user | - | - | | | useless
- foo | regress_foreign_data_user | - | - | | (b '3', c '4', a '2') |
- postgresql | regress_foreign_data_user | - | postgresql_fdw_validator | | |
+ List of foreign-data wrappers
+ Name | Owner | Handler | Validator | Access privileges | FDW options | Description
+------------+---------------------------+---------+-------------------------+-------------------+-----------------------+-------------
+ dummy | regress_foreign_data_user | - | - | | | useless
+ foo | regress_foreign_data_user | - | - | | (b '3', c '4', a '2') |
+ postgresql | regress_foreign_data_user | - | pg_connection_validator | | |
(3 rows)
SET ROLE regress_test_role;
@@ -172,11 +172,11 @@ SET ROLE regress_test_role_super;
ALTER FOREIGN DATA WRAPPER foo OPTIONS (ADD d '5');
\dew+
List of foreign-data wrappers
- Name | Owner | Handler | Validator | Access privileges | FDW options | Description
-------------+---------------------------+---------+--------------------------+-------------------+------------------------------+-------------
- dummy | regress_foreign_data_user | - | - | | | useless
- foo | regress_foreign_data_user | - | - | | (b '3', c '4', a '2', d '5') |
- postgresql | regress_foreign_data_user | - | postgresql_fdw_validator | | |
+ Name | Owner | Handler | Validator | Access privileges | FDW options | Description
+------------+---------------------------+---------+-------------------------+-------------------+------------------------------+-------------
+ dummy | regress_foreign_data_user | - | - | | | useless
+ foo | regress_foreign_data_user | - | - | | (b '3', c '4', a '2', d '5') |
+ postgresql | regress_foreign_data_user | - | pg_connection_validator | | |
(3 rows)
ALTER FOREIGN DATA WRAPPER foo OWNER TO regress_test_role; -- ERROR
@@ -191,21 +191,21 @@ HINT: Must be superuser to alter a foreign-data wrapper.
RESET ROLE;
\dew+
List of foreign-data wrappers
- Name | Owner | Handler | Validator | Access privileges | FDW options | Description
-------------+---------------------------+---------+--------------------------+-------------------+------------------------------+-------------
- dummy | regress_foreign_data_user | - | - | | | useless
- foo | regress_test_role_super | - | - | | (b '3', c '4', a '2', d '5') |
- postgresql | regress_foreign_data_user | - | postgresql_fdw_validator | | |
+ Name | Owner | Handler | Validator | Access privileges | FDW options | Description
+------------+---------------------------+---------+-------------------------+-------------------+------------------------------+-------------
+ dummy | regress_foreign_data_user | - | - | | | useless
+ foo | regress_test_role_super | - | - | | (b '3', c '4', a '2', d '5') |
+ postgresql | regress_foreign_data_user | - | pg_connection_validator | | |
(3 rows)
ALTER FOREIGN DATA WRAPPER foo RENAME TO foo1;
\dew+
List of foreign-data wrappers
- Name | Owner | Handler | Validator | Access privileges | FDW options | Description
-------------+---------------------------+---------+--------------------------+-------------------+------------------------------+-------------
- dummy | regress_foreign_data_user | - | - | | | useless
- foo1 | regress_test_role_super | - | - | | (b '3', c '4', a '2', d '5') |
- postgresql | regress_foreign_data_user | - | postgresql_fdw_validator | | |
+ Name | Owner | Handler | Validator | Access privileges | FDW options | Description
+------------+---------------------------+---------+-------------------------+-------------------+------------------------------+-------------
+ dummy | regress_foreign_data_user | - | - | | | useless
+ foo1 | regress_test_role_super | - | - | | (b '3', c '4', a '2', d '5') |
+ postgresql | regress_foreign_data_user | - | pg_connection_validator | | |
(3 rows)
ALTER FOREIGN DATA WRAPPER foo1 RENAME TO foo;
@@ -225,12 +225,12 @@ ERROR: foreign-data wrapper "nonexistent" does not exist
DROP FOREIGN DATA WRAPPER IF EXISTS nonexistent;
NOTICE: foreign-data wrapper "nonexistent" does not exist, skipping
\dew+
- List of foreign-data wrappers
- Name | Owner | Handler | Validator | Access privileges | FDW options | Description
-------------+---------------------------+------------------+--------------------------+-------------------+------------------------------+-------------
- dummy | regress_foreign_data_user | - | - | | | useless
- foo | regress_test_role_super | test_fdw_handler | - | | (b '3', c '4', a '2', d '5') |
- postgresql | regress_foreign_data_user | - | postgresql_fdw_validator | | |
+ List of foreign-data wrappers
+ Name | Owner | Handler | Validator | Access privileges | FDW options | Description
+------------+---------------------------+------------------+-------------------------+-------------------+------------------------------+-------------
+ dummy | regress_foreign_data_user | - | - | | | useless
+ foo | regress_test_role_super | test_fdw_handler | - | | (b '3', c '4', a '2', d '5') |
+ postgresql | regress_foreign_data_user | - | pg_connection_validator | | |
(3 rows)
DROP ROLE regress_test_role_super; -- ERROR
@@ -241,11 +241,11 @@ DROP FOREIGN DATA WRAPPER foo;
RESET ROLE;
DROP ROLE regress_test_role_super;
\dew+
- List of foreign-data wrappers
- Name | Owner | Handler | Validator | Access privileges | FDW options | Description
-------------+---------------------------+---------+--------------------------+-------------------+-------------+-------------
- dummy | regress_foreign_data_user | - | - | | | useless
- postgresql | regress_foreign_data_user | - | postgresql_fdw_validator | | |
+ List of foreign-data wrappers
+ Name | Owner | Handler | Validator | Access privileges | FDW options | Description
+------------+---------------------------+---------+-------------------------+-------------------+-------------+-------------
+ dummy | regress_foreign_data_user | - | - | | | useless
+ postgresql | regress_foreign_data_user | - | pg_connection_validator | | |
(2 rows)
CREATE FOREIGN DATA WRAPPER foo;
@@ -257,12 +257,12 @@ ERROR: user mapping for "regress_foreign_data_user" already exists for server "
CREATE USER MAPPING IF NOT EXISTS FOR current_user SERVER s1; -- NOTICE
NOTICE: user mapping for "regress_foreign_data_user" already exists for server "s1", skipping
\dew+
- List of foreign-data wrappers
- Name | Owner | Handler | Validator | Access privileges | FDW options | Description
-------------+---------------------------+---------+--------------------------+-------------------+-------------+-------------
- dummy | regress_foreign_data_user | - | - | | | useless
- foo | regress_foreign_data_user | - | - | | |
- postgresql | regress_foreign_data_user | - | postgresql_fdw_validator | | |
+ List of foreign-data wrappers
+ Name | Owner | Handler | Validator | Access privileges | FDW options | Description
+------------+---------------------------+---------+-------------------------+-------------------+-------------+-------------
+ dummy | regress_foreign_data_user | - | - | | | useless
+ foo | regress_foreign_data_user | - | - | | |
+ postgresql | regress_foreign_data_user | - | pg_connection_validator | | |
(3 rows)
\des+
@@ -293,11 +293,11 @@ NOTICE: drop cascades to 2 other objects
DETAIL: drop cascades to server s1
drop cascades to user mapping for regress_foreign_data_user on server s1
\dew+
- List of foreign-data wrappers
- Name | Owner | Handler | Validator | Access privileges | FDW options | Description
-------------+---------------------------+---------+--------------------------+-------------------+-------------+-------------
- dummy | regress_foreign_data_user | - | - | | | useless
- postgresql | regress_foreign_data_user | - | postgresql_fdw_validator | | |
+ List of foreign-data wrappers
+ Name | Owner | Handler | Validator | Access privileges | FDW options | Description
+------------+---------------------------+---------+-------------------------+-------------------+-------------+-------------
+ dummy | regress_foreign_data_user | - | - | | | useless
+ postgresql | regress_foreign_data_user | - | pg_connection_validator | | |
(2 rows)
\des+
@@ -1245,7 +1245,7 @@ GRANT USAGE ON FOREIGN SERVER s4 TO regress_test_role;
DROP USER MAPPING FOR public SERVER s4;
ALTER SERVER s6 OPTIONS (DROP host, DROP dbname);
ALTER USER MAPPING FOR regress_test_role SERVER s6 OPTIONS (DROP username);
-ALTER FOREIGN DATA WRAPPER foo VALIDATOR postgresql_fdw_validator;
+ALTER FOREIGN DATA WRAPPER foo VALIDATOR pg_connection_validator;
WARNING: changing the foreign-data wrapper validator can cause the options for dependent objects to become invalid
-- Privileges
SET ROLE regress_unprivileged_role;
diff --git a/src/test/regress/sql/create_am.sql b/src/test/regress/sql/create_am.sql
index 2785ffd8bb..41c9667fb0 100644
--- a/src/test/regress/sql/create_am.sql
+++ b/src/test/regress/sql/create_am.sql
@@ -225,7 +225,7 @@ CREATE TABLE tableam_parted_2_heapx PARTITION OF tableam_parted_heapx FOR VALUES
-- sequences, views and foreign servers shouldn't have an AM
CREATE VIEW tableam_view_heapx AS SELECT * FROM tableam_tbl_heapx;
CREATE SEQUENCE tableam_seq_heapx;
-CREATE FOREIGN DATA WRAPPER fdw_heap2 VALIDATOR postgresql_fdw_validator;
+CREATE FOREIGN DATA WRAPPER fdw_heap2 VALIDATOR pg_connection_validator;
CREATE SERVER fs_heap2 FOREIGN DATA WRAPPER fdw_heap2 ;
CREATE FOREIGN table tableam_fdw_heapx () SERVER fs_heap2;
diff --git a/src/test/regress/sql/foreign_data.sql b/src/test/regress/sql/foreign_data.sql
index a8e2edfeee..e1f79d4fee 100644
--- a/src/test/regress/sql/foreign_data.sql
+++ b/src/test/regress/sql/foreign_data.sql
@@ -33,7 +33,7 @@ CREATE ROLE regress_unprivileged_role;
CREATE FOREIGN DATA WRAPPER dummy;
COMMENT ON FOREIGN DATA WRAPPER dummy IS 'useless';
-CREATE FOREIGN DATA WRAPPER postgresql VALIDATOR postgresql_fdw_validator;
+CREATE FOREIGN DATA WRAPPER postgresql VALIDATOR pg_connection_validator;
-- At this point we should have 2 built-in wrappers and no servers.
SELECT fdwname, fdwhandler::regproc, fdwvalidator::regproc, fdwoptions FROM pg_foreign_data_wrapper ORDER BY 1, 2, 3;
@@ -59,7 +59,7 @@ DROP FOREIGN DATA WRAPPER foo;
SET ROLE regress_test_role;
CREATE FOREIGN DATA WRAPPER foo; -- ERROR
RESET ROLE;
-CREATE FOREIGN DATA WRAPPER foo VALIDATOR postgresql_fdw_validator;
+CREATE FOREIGN DATA WRAPPER foo VALIDATOR pg_connection_validator;
\dew+
-- HANDLER related checks
@@ -548,7 +548,7 @@ GRANT USAGE ON FOREIGN SERVER s4 TO regress_test_role;
DROP USER MAPPING FOR public SERVER s4;
ALTER SERVER s6 OPTIONS (DROP host, DROP dbname);
ALTER USER MAPPING FOR regress_test_role SERVER s6 OPTIONS (DROP username);
-ALTER FOREIGN DATA WRAPPER foo VALIDATOR postgresql_fdw_validator;
+ALTER FOREIGN DATA WRAPPER foo VALIDATOR pg_connection_validator;
-- Privileges
SET ROLE regress_unprivileged_role;
--
2.34.1
view thread (63+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: [17] CREATE SUBSCRIPTION ... SERVER
In-Reply-To: <CALj2ACXnQkqsP90DdXW7uVLzn4eRj6cyGwaJ4W0UjQOr8ELRJA@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox