change the way for appoint port value
This commit is contained in:
@ -57,7 +57,7 @@ SELECT dblink_build_sql_delete('"MySchema"."Foo"','1 2',2,'{"0", "a"}');
|
|||||||
|
|
||||||
-- regular old dblink
|
-- regular old dblink
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM dblink('dbname=regression port=25632','SELECT * FROM foo') AS t(a int, b text, c text[])
|
FROM dblink('dbname=regression port=@portstring@','SELECT * FROM foo') AS t(a int, b text, c text[])
|
||||||
WHERE t.a > 7;
|
WHERE t.a > 7;
|
||||||
|
|
||||||
-- should generate "connection not available" error
|
-- should generate "connection not available" error
|
||||||
@ -66,7 +66,7 @@ FROM dblink('SELECT * FROM foo') AS t(a int, b text, c text[])
|
|||||||
WHERE t.a > 7;
|
WHERE t.a > 7;
|
||||||
|
|
||||||
-- create a persistent connection
|
-- create a persistent connection
|
||||||
SELECT dblink_connect('dbname=regression port=25632');
|
SELECT dblink_connect('dbname=regression port=@portstring@');
|
||||||
|
|
||||||
-- use the persistent connection
|
-- use the persistent connection
|
||||||
SELECT *
|
SELECT *
|
||||||
@ -127,10 +127,10 @@ WHERE t.a > 7;
|
|||||||
|
|
||||||
-- put more data into our slave table, first using arbitrary connection syntax
|
-- put more data into our slave table, first using arbitrary connection syntax
|
||||||
-- but truncate the actual return value so we can use diff to check for success
|
-- but truncate the actual return value so we can use diff to check for success
|
||||||
SELECT substr(dblink_exec('dbname=regression port=25632','INSERT INTO foo VALUES(10,''k'',''{"a10","b10","c10"}'')'),1,6);
|
SELECT substr(dblink_exec('dbname=regression port=@portstring@','INSERT INTO foo VALUES(10,''k'',''{"a10","b10","c10"}'')'),1,6);
|
||||||
|
|
||||||
-- create a persistent connection
|
-- create a persistent connection
|
||||||
SELECT dblink_connect('dbname=regression port=25632');
|
SELECT dblink_connect('dbname=regression port=@portstring@');
|
||||||
|
|
||||||
-- put more data into our slave table, using persistent connection syntax
|
-- put more data into our slave table, using persistent connection syntax
|
||||||
-- but truncate the actual return value so we can use diff to check for success
|
-- but truncate the actual return value so we can use diff to check for success
|
||||||
@ -176,7 +176,7 @@ FROM dblink('myconn','SELECT * FROM foo') AS t(a int, b text, c text[])
|
|||||||
WHERE t.a > 7;
|
WHERE t.a > 7;
|
||||||
|
|
||||||
-- create a named persistent connection
|
-- create a named persistent connection
|
||||||
SELECT dblink_connect('myconn','dbname=regression port=25632');
|
SELECT dblink_connect('myconn','dbname=regression port=@portstring@');
|
||||||
|
|
||||||
-- use the named persistent connection
|
-- use the named persistent connection
|
||||||
SELECT *
|
SELECT *
|
||||||
@ -190,10 +190,10 @@ WHERE t.a > 7;
|
|||||||
|
|
||||||
-- create a second named persistent connection
|
-- create a second named persistent connection
|
||||||
-- should error with "duplicate connection name"
|
-- should error with "duplicate connection name"
|
||||||
SELECT dblink_connect('myconn','dbname=regression port=25632');
|
SELECT dblink_connect('myconn','dbname=regression port=@portstring@');
|
||||||
|
|
||||||
-- create a second named persistent connection with a new name
|
-- create a second named persistent connection with a new name
|
||||||
SELECT dblink_connect('myconn2','dbname=regression port=25632');
|
SELECT dblink_connect('myconn2','dbname=regression port=@portstring@');
|
||||||
|
|
||||||
-- use the second named persistent connection
|
-- use the second named persistent connection
|
||||||
SELECT *
|
SELECT *
|
||||||
@ -279,7 +279,7 @@ FROM dblink('myconn','SELECT * FROM foo') AS t(a int, b text, c text[])
|
|||||||
WHERE t.a > 7;
|
WHERE t.a > 7;
|
||||||
|
|
||||||
-- create a named persistent connection
|
-- create a named persistent connection
|
||||||
SELECT dblink_connect('myconn','dbname=regression port=25632');
|
SELECT dblink_connect('myconn','dbname=regression port=@portstring@');
|
||||||
|
|
||||||
-- put more data into our slave table, using named persistent connection syntax
|
-- put more data into our slave table, using named persistent connection syntax
|
||||||
-- but truncate the actual return value so we can use diff to check for success
|
-- but truncate the actual return value so we can use diff to check for success
|
||||||
@ -313,15 +313,15 @@ SELECT dblink_disconnect('myconn');
|
|||||||
SELECT dblink_disconnect('myconn');
|
SELECT dblink_disconnect('myconn');
|
||||||
|
|
||||||
-- test asynchronous queries
|
-- test asynchronous queries
|
||||||
SELECT dblink_connect('dtest1', 'dbname=regression port=25632');
|
SELECT dblink_connect('dtest1', 'dbname=regression port=@portstring@');
|
||||||
SELECT * from
|
SELECT * from
|
||||||
dblink_send_query('dtest1', 'select * from foo where f1 < 3') as t1;
|
dblink_send_query('dtest1', 'select * from foo where f1 < 3') as t1;
|
||||||
|
|
||||||
SELECT dblink_connect('dtest2', 'dbname=regression port=25632');
|
SELECT dblink_connect('dtest2', 'dbname=regression port=@portstring@');
|
||||||
SELECT * from
|
SELECT * from
|
||||||
dblink_send_query('dtest2', 'select * from foo where f1 > 2 and f1 < 7') as t1;
|
dblink_send_query('dtest2', 'select * from foo where f1 > 2 and f1 < 7') as t1;
|
||||||
|
|
||||||
SELECT dblink_connect('dtest3', 'dbname=regression port=25632');
|
SELECT dblink_connect('dtest3', 'dbname=regression port=@portstring@');
|
||||||
SELECT * from
|
SELECT * from
|
||||||
dblink_send_query('dtest3', 'select * from foo where f1 > 6') as t1;
|
dblink_send_query('dtest3', 'select * from foo where f1 > 6') as t1;
|
||||||
|
|
||||||
@ -350,7 +350,7 @@ SELECT dblink_disconnect('dtest3');
|
|||||||
|
|
||||||
SELECT * from result;
|
SELECT * from result;
|
||||||
|
|
||||||
SELECT dblink_connect('dtest1', 'dbname=regression port=25632');
|
SELECT dblink_connect('dtest1', 'dbname=regression port=@portstring@');
|
||||||
SELECT * from
|
SELECT * from
|
||||||
dblink_send_query('dtest1', 'select * from foo where f1 < 3') as t1;
|
dblink_send_query('dtest1', 'select * from foo where f1 < 3') as t1;
|
||||||
|
|
||||||
@ -359,7 +359,7 @@ SELECT dblink_error_message('dtest1');
|
|||||||
SELECT dblink_disconnect('dtest1');
|
SELECT dblink_disconnect('dtest1');
|
||||||
|
|
||||||
-- test asynchronous notifications
|
-- test asynchronous notifications
|
||||||
SELECT dblink_connect('dbname=regression port=25632');
|
SELECT dblink_connect('dbname=regression port=@portstring@');
|
||||||
|
|
||||||
--should return listen
|
--should return listen
|
||||||
SELECT dblink_exec('LISTEN regression');
|
SELECT dblink_exec('LISTEN regression');
|
||||||
@ -405,7 +405,7 @@ SELECT dblink_build_sql_delete('test_dropped', '1', 1,
|
|||||||
SET datestyle = ISO, MDY;
|
SET datestyle = ISO, MDY;
|
||||||
SET intervalstyle = postgres;
|
SET intervalstyle = postgres;
|
||||||
SET timezone = UTC;
|
SET timezone = UTC;
|
||||||
SELECT dblink_connect('myconn','dbname=regression port=25632');
|
SELECT dblink_connect('myconn','dbname=regression port=@portstring@');
|
||||||
SELECT dblink_exec('myconn', 'SET datestyle = GERMAN, DMY;');
|
SELECT dblink_exec('myconn', 'SET datestyle = GERMAN, DMY;');
|
||||||
|
|
||||||
-- single row synchronous case
|
-- single row synchronous case
|
||||||
|
Reference in New Issue
Block a user