Skip to content

Commit f85f43d

Browse files
committed
Backend support for autocommit removed, per recent discussions. The
only remnant of this failed experiment is that the server will take SET AUTOCOMMIT TO ON. Still TODO: provide some client-side autocommit logic in libpq.
1 parent d9b679c commit f85f43d

File tree

99 files changed

+277
-536
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+277
-536
lines changed

contrib/adddepend/adddepend

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/perl
2-
# $Id: adddepend,v 1.3 2002/12/02 00:28:29 tgl Exp $
2+
# $Id: adddepend,v 1.4 2003/05/14 03:25:55 tgl Exp $
33

44
# Project exists to assist PostgreSQL users with their structural upgrade
55
# from 7.2 (or prior) to 7.3 (possibly later). Must be run against a 7.3
@@ -125,20 +125,13 @@ my $dbh = DBI->connect($dsn, $dbuser, $dbpass);
125125
# We want to control commits
126126
$dbh->{'AutoCommit'} = 0;
127127

128-
# turn on autocommit
128+
# control where things get created
129129
my $sql = qq{
130130
SET search_path = public;
131131
};
132132
my $sth = $dbh->prepare($sql);
133133
$sth->execute();
134134

135-
# turn on autocommit
136-
my $sql2 = qq{
137-
SET autocommit TO 'on';
138-
};
139-
my $sth2 = $dbh->prepare($sql2);
140-
$sth2->execute();
141-
142135
END {
143136
$dbh->disconnect() if $dbh;
144137
}

contrib/array/array_iterator.sql.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
-- Adjust this setting to control where the objects get created.
77
SET search_path = public;
88

9-
SET autocommit TO 'on';
10-
119
CREATE OR REPLACE FUNCTION array_texteq(_text, text)
1210
RETURNS bool
1311
AS 'MODULE_PATHNAME'

contrib/btree_gist/btree_gist.sql.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
-- Adjust this setting to control where the objects get created.
22
SET search_path = public;
33

4-
SET autocommit TO 'on';
5-
64
-- create type of int2 key
75
CREATE FUNCTION int2key_in(cstring)
86
RETURNS int2key

contrib/btree_gist/expected/btree_gist.out

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
-- does not depend on contents of btree_gist.sql.
44
--
55
\set ECHO none
6-
psql:btree_gist.sql:10: NOTICE: ProcedureCreate: type int2key is not yet defined
7-
psql:btree_gist.sql:15: NOTICE: Argument type "int2key" is only a shell
8-
psql:btree_gist.sql:27: NOTICE: ProcedureCreate: type int4key is not yet defined
9-
psql:btree_gist.sql:32: NOTICE: Argument type "int4key" is only a shell
10-
psql:btree_gist.sql:44: NOTICE: ProcedureCreate: type int8key is not yet defined
11-
psql:btree_gist.sql:49: NOTICE: Argument type "int8key" is only a shell
12-
psql:btree_gist.sql:61: NOTICE: ProcedureCreate: type float4key is not yet defined
13-
psql:btree_gist.sql:66: NOTICE: Argument type "float4key" is only a shell
14-
psql:btree_gist.sql:79: NOTICE: ProcedureCreate: type float8key is not yet defined
15-
psql:btree_gist.sql:84: NOTICE: Argument type "float8key" is only a shell
16-
psql:btree_gist.sql:394: NOTICE: ProcedureCreate: type tskey is not yet defined
17-
psql:btree_gist.sql:399: NOTICE: Argument type "tskey" is only a shell
6+
psql:btree_gist.sql:8: NOTICE: ProcedureCreate: type int2key is not yet defined
7+
psql:btree_gist.sql:13: NOTICE: Argument type "int2key" is only a shell
8+
psql:btree_gist.sql:25: NOTICE: ProcedureCreate: type int4key is not yet defined
9+
psql:btree_gist.sql:30: NOTICE: Argument type "int4key" is only a shell
10+
psql:btree_gist.sql:42: NOTICE: ProcedureCreate: type int8key is not yet defined
11+
psql:btree_gist.sql:47: NOTICE: Argument type "int8key" is only a shell
12+
psql:btree_gist.sql:59: NOTICE: ProcedureCreate: type float4key is not yet defined
13+
psql:btree_gist.sql:64: NOTICE: Argument type "float4key" is only a shell
14+
psql:btree_gist.sql:77: NOTICE: ProcedureCreate: type float8key is not yet defined
15+
psql:btree_gist.sql:82: NOTICE: Argument type "float8key" is only a shell
16+
psql:btree_gist.sql:392: NOTICE: ProcedureCreate: type tskey is not yet defined
17+
psql:btree_gist.sql:397: NOTICE: Argument type "tskey" is only a shell
1818
CREATE TABLE int4tmp (b int4);
1919
\copy int4tmp from 'data/test_btree.data'
2020
CREATE TABLE int8tmp (b int8);

contrib/chkpass/chkpass.sql.in

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
-- darcy@druid.net
55
-- http://www.druid.net/darcy/
66
--
7-
-- $Header: /cvsroot/pgsql/contrib/chkpass/chkpass.sql.in,v 1.3 2002/10/18 18:41:19 momjian Exp $
7+
-- $Header: /cvsroot/pgsql/contrib/chkpass/chkpass.sql.in,v 1.4 2003/05/14 03:25:55 tgl Exp $
88
--
99
-- best viewed with tabs set to 4
1010
--
@@ -16,8 +16,6 @@
1616
-- Adjust this setting to control where the objects get created.
1717
SET search_path = public;
1818

19-
SET autocommit TO 'on';
20-
2119
CREATE FUNCTION chkpass_in(cstring)
2220
RETURNS chkpass
2321
AS 'MODULE_PATHNAME'

contrib/cube/cube.sql.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
-- Adjust this setting to control where the objects get created.
55
SET search_path = public;
66

7-
SET autocommit TO 'on';
8-
97
CREATE OR REPLACE FUNCTION cube_in(cstring)
108
RETURNS cube
119
AS 'MODULE_PATHNAME'

contrib/cube/expected/cube.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
-- does not depend on contents of cube.sql.
77
--
88
\set ECHO none
9-
psql:cube.sql:12: NOTICE: ProcedureCreate: type cube is not yet defined
10-
psql:cube.sql:17: NOTICE: Argument type "cube" is only a shell
9+
psql:cube.sql:10: NOTICE: ProcedureCreate: type cube is not yet defined
10+
psql:cube.sql:15: NOTICE: Argument type "cube" is only a shell
1111
--
1212
-- testing the input and output functions
1313
--

contrib/dbase/dbf2pg.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -861,8 +861,6 @@ main(int argc, char **argv)
861861

862862
PQexec(conn, "SET search_path = public");
863863

864-
PQexec(conn, "SET autocommit TO 'on'");
865-
866864
/* Substitute field names */
867865
do_substitute(subarg, dbh);
868866

contrib/dblink/expected/dblink.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ WHERE t.a > 7;
190190
ERROR: dblink: no connection available
191191
-- put more data into our slave table, first using arbitrary connection syntax
192192
-- but truncate the actual return value so we can use diff to check for success
193-
SELECT substr(dblink_exec('dbname=regression','SET autocommit TO ''on'';INSERT INTO foo VALUES(10,''k'',''{"a10","b10","c10"}'')'),1,6);
193+
SELECT substr(dblink_exec('dbname=regression','INSERT INTO foo VALUES(10,''k'',''{"a10","b10","c10"}'')'),1,6);
194194
substr
195195
--------
196196
INSERT
@@ -205,7 +205,7 @@ SELECT dblink_connect('dbname=regression');
205205

206206
-- put more data into our slave table, using persistent connection syntax
207207
-- but truncate the actual return value so we can use diff to check for success
208-
SELECT substr(dblink_exec('SET autocommit TO ''on'';INSERT INTO foo VALUES(11,''l'',''{"a11","b11","c11"}'')'),1,6);
208+
SELECT substr(dblink_exec('INSERT INTO foo VALUES(11,''l'',''{"a11","b11","c11"}'')'),1,6);
209209
substr
210210
--------
211211
INSERT
@@ -231,7 +231,7 @@ FROM dblink('SELECT * FROM foo') AS t(a int, b text, c text[]);
231231
(12 rows)
232232

233233
-- change some data
234-
SELECT dblink_exec('SET autocommit TO ''on'';UPDATE foo SET f3[2] = ''b99'' WHERE f1 = 11');
234+
SELECT dblink_exec('UPDATE foo SET f3[2] = ''b99'' WHERE f1 = 11');
235235
dblink_exec
236236
-------------
237237
UPDATE 1
@@ -247,7 +247,7 @@ WHERE a = 11;
247247
(1 row)
248248

249249
-- delete some data
250-
SELECT dblink_exec('SET autocommit TO ''on'';DELETE FROM foo WHERE f1 = 11');
250+
SELECT dblink_exec('DELETE FROM foo WHERE f1 = 11');
251251
dblink_exec
252252
-------------
253253
DELETE 1

contrib/dblink/sql/dblink.sql

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ SET search_path = public;
88
-- Turn off echoing so that expected file does not depend on
99
-- contents of dblink.sql.
1010
\set ECHO none
11-
SET autocommit TO 'on';
1211
\i dblink.sql
1312
\set ECHO all
1413

@@ -113,29 +112,29 @@ WHERE t.a > 7;
113112

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

118117
-- create a persistent connection
119118
SELECT dblink_connect('dbname=regression');
120119

121120
-- put more data into our slave table, using persistent connection syntax
122121
-- but truncate the actual return value so we can use diff to check for success
123-
SELECT substr(dblink_exec('SET autocommit TO ''on'';INSERT INTO foo VALUES(11,''l'',''{"a11","b11","c11"}'')'),1,6);
122+
SELECT substr(dblink_exec('INSERT INTO foo VALUES(11,''l'',''{"a11","b11","c11"}'')'),1,6);
124123

125124
-- let's see it
126125
SELECT *
127126
FROM dblink('SELECT * FROM foo') AS t(a int, b text, c text[]);
128127

129128
-- change some data
130-
SELECT dblink_exec('SET autocommit TO ''on'';UPDATE foo SET f3[2] = ''b99'' WHERE f1 = 11');
129+
SELECT dblink_exec('UPDATE foo SET f3[2] = ''b99'' WHERE f1 = 11');
131130

132131
-- let's see it
133132
SELECT *
134133
FROM dblink('SELECT * FROM foo') AS t(a int, b text, c text[])
135134
WHERE a = 11;
136135

137136
-- delete some data
138-
SELECT dblink_exec('SET autocommit TO ''on'';DELETE FROM foo WHERE f1 = 11');
137+
SELECT dblink_exec('DELETE FROM foo WHERE f1 = 11');
139138

140139
-- let's see it
141140
SELECT *

0 commit comments

Comments
 (0)