Commit 57ca1d4f authored by Andres Freund's avatar Andres Freund

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.
parent ddc2504d
......@@ -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$;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment