mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Specify the port in dblink and postgres_fdw tests.
That allows to run those tests against a postmaster listening on a nonstandard port without requiring to export PGPORT in postmaster's environment. This still doesn't support connecting to a nondefault host without configuring it in postmaster's environment. That's harder and less frequently used though. So this is a useful step.
This commit is contained in:
@ -89,7 +89,7 @@ SELECT dblink_build_sql_delete('"MySchema"."Foo"','1 2',2,'{"0", "a"}');
|
||||
(1 row)
|
||||
|
||||
CREATE FUNCTION connection_parameters() RETURNS text LANGUAGE SQL AS $f$
|
||||
SELECT $$dbname='$$||current_database()||$$'$$;
|
||||
SELECT $$dbname='$$||current_database()||$$' port=$$||current_setting('port');
|
||||
$f$;
|
||||
-- regular old dblink
|
||||
SELECT *
|
||||
@ -816,7 +816,9 @@ CREATE ROLE dblink_regression_test;
|
||||
DO $d$
|
||||
BEGIN
|
||||
EXECUTE $$CREATE SERVER fdtest FOREIGN DATA WRAPPER dblink_fdw
|
||||
OPTIONS (dbname '$$||current_database()||$$')$$;
|
||||
OPTIONS (dbname '$$||current_database()||$$',
|
||||
port '$$||current_setting('port')||$$'
|
||||
)$$;
|
||||
END;
|
||||
$d$;
|
||||
CREATE USER MAPPING FOR public SERVER fdtest
|
||||
|
@ -56,7 +56,7 @@ SELECT dblink_build_sql_update('"MySchema"."Foo"','1 2',2,'{"0", "a"}','{"99", "
|
||||
SELECT dblink_build_sql_delete('"MySchema"."Foo"','1 2',2,'{"0", "a"}');
|
||||
|
||||
CREATE FUNCTION connection_parameters() RETURNS text LANGUAGE SQL AS $f$
|
||||
SELECT $$dbname='$$||current_database()||$$'$$;
|
||||
SELECT $$dbname='$$||current_database()||$$' port=$$||current_setting('port');
|
||||
$f$;
|
||||
|
||||
-- regular old dblink
|
||||
@ -395,7 +395,9 @@ CREATE ROLE dblink_regression_test;
|
||||
DO $d$
|
||||
BEGIN
|
||||
EXECUTE $$CREATE SERVER fdtest FOREIGN DATA WRAPPER dblink_fdw
|
||||
OPTIONS (dbname '$$||current_database()||$$')$$;
|
||||
OPTIONS (dbname '$$||current_database()||$$',
|
||||
port '$$||current_setting('port')||$$'
|
||||
)$$;
|
||||
END;
|
||||
$d$;
|
||||
|
||||
|
@ -6,7 +6,9 @@ CREATE SERVER testserver1 FOREIGN DATA WRAPPER postgres_fdw;
|
||||
DO $d$
|
||||
BEGIN
|
||||
EXECUTE $$CREATE SERVER loopback FOREIGN DATA WRAPPER postgres_fdw
|
||||
OPTIONS (dbname '$$||current_database()||$$');$$;
|
||||
OPTIONS (dbname '$$||current_database()||$$',
|
||||
port '$$||current_setting('port')||$$'
|
||||
)$$;
|
||||
END;
|
||||
$d$;
|
||||
CREATE USER MAPPING FOR public SERVER testserver1
|
||||
|
@ -8,7 +8,9 @@ CREATE SERVER testserver1 FOREIGN DATA WRAPPER postgres_fdw;
|
||||
DO $d$
|
||||
BEGIN
|
||||
EXECUTE $$CREATE SERVER loopback FOREIGN DATA WRAPPER postgres_fdw
|
||||
OPTIONS (dbname '$$||current_database()||$$');$$;
|
||||
OPTIONS (dbname '$$||current_database()||$$',
|
||||
port '$$||current_setting('port')||$$'
|
||||
)$$;
|
||||
END;
|
||||
$d$;
|
||||
|
||||
|
Reference in New Issue
Block a user