Skip to content

Commit 5214f09

Browse files
committed
Clean up for dblink autocommit OFF handling.
1 parent aa4c702 commit 5214f09

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

contrib/dblink/expected/dblink.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ WHERE t.a > 7;
183183
ERROR: dblink: no connection available
184184
-- put more data into our slave table, first using arbitrary connection syntax
185185
-- but truncate the actual return value so we can use diff to check for success
186-
SELECT substr(dblink_exec('dbname=regression_slave','INSERT INTO foo VALUES (10,''k'',''{"a10","b10","c10"}'')'),1,6);
186+
SELECT substr(dblink_exec('dbname=regression_slave','SET autocommit TO ''on'';INSERT INTO foo VALUES (10,''k'',''{"a10","b10","c10"}'')'),1,6);
187187
substr
188188
--------
189189
INSERT

contrib/dblink/sql/dblink.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ CREATE DATABASE regression_slave;
3030
-- Turn off echoing so that expected file does not depend on
3131
-- contents of dblink.sql.
3232
\set ECHO none
33+
SET autocommit TO 'on';
3334
\i dblink.sql
3435
\set ECHO all
3536

@@ -72,6 +73,7 @@ SELECT dblink_build_sql_delete('foo','1 2',2,'{"0", "a"}');
7273
--
7374
\connect regression
7475
\set ECHO none
76+
SET autocommit TO 'on';
7577
\i dblink.sql
7678
\set ECHO all
7779

@@ -124,7 +126,7 @@ WHERE t.a > 7;
124126

125127
-- put more data into our slave table, first using arbitrary connection syntax
126128
-- but truncate the actual return value so we can use diff to check for success
127-
SELECT substr(dblink_exec('dbname=regression_slave','INSERT INTO foo VALUES(10,''k'',''{"a10","b10","c10"}'')'),1,6);
129+
SELECT substr(dblink_exec('dbname=regression_slave','SET autocommit TO ''on'';INSERT INTO foo VALUES(10,''k'',''{"a10","b10","c10"}'')'),1,6);
128130

129131
-- create a persistent connection
130132
SELECT dblink_connect('dbname=regression_slave');

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy