Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

+2-9
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

-2
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

-2
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

+12-12
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

+1-3
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

-2
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

+2-2
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

-2
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

+4-4
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

+4-5
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 *

contrib/dbmirror/AddTrigger.sql

-2
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 TRIGGER "MyTableName_Trig"
75
AFTER INSERT OR DELETE OR UPDATE ON "MyTableName"
86
FOR EACH ROW EXECUTE PROCEDURE "recordchange" ();

contrib/dbmirror/DBMirror.pl

+1-11
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#
3434
#
3535
##############################################################################
36-
# $Id: DBMirror.pl,v 1.5 2002/12/05 21:03:51 momjian Exp $
36+
# $Id: DBMirror.pl,v 1.6 2003/05/14 03:25:55 tgl Exp $
3737
#
3838
##############################################################################
3939

@@ -135,15 +135,6 @@ ()
135135
die;
136136
}
137137

138-
my $setQuery2;
139-
$setQuery2 = "SET autocommit TO 'on'";
140-
my $setResult2 = $masterConn->exec($setQuery2);
141-
if($setResult2->resultStatus!=PGRES_COMMAND_OK) {
142-
logErrorMessage($masterConn->errorMessage . "\n" .
143-
$setQuery2);
144-
die;
145-
}
146-
147138
my $firstTime = 1;
148139
while(1) {
149140
if($firstTime == 0) {
@@ -158,7 +149,6 @@ ()
158149

159150

160151

161-
sendQueryToSlaves(undef,"SET autocommit TO 'on'");
162152
sendQueryToSlaves(undef,"SET TRANSACTION ISOLATION LEVEL SERIALIZABLE");
163153
sendQueryToSlaves(undef,"SET CONSTRAINTS ALL DEFERRED");
164154

contrib/dbmirror/MirrorSetup.sql

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11

2-
SET autocommit TO 'on';
3-
42
CREATE FUNCTION "recordchange" () RETURNS trigger AS
53
'/usr/local/pgsql/lib/pending.so', 'recordchange' LANGUAGE 'C';
64

contrib/dbmirror/clean_pending.pl

+1-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# GNU General Public License for more details.
1717
#
1818
##############################################################################
19-
# $Id: clean_pending.pl,v 1.2 2002/10/18 18:41:19 momjian Exp $
19+
# $Id: clean_pending.pl,v 1.3 2003/05/14 03:25:55 tgl Exp $
2020
##############################################################################
2121

2222

@@ -69,10 +69,6 @@ BEGIN
6969
printf("Can't connect to database\n");
7070
die;
7171
}
72-
my $setresult = $dbConn->exec("SET autocommit TO 'on'");
73-
unless($setresult->resultStatus == PGRES_COMMAND_OK) {
74-
die $dbConn->errorMessage;
75-
}
7672
my $result = $dbConn->exec("BEGIN");
7773
unless($result->resultStatus == PGRES_COMMAND_OK) {
7874
die $dbConn->errorMessage;

contrib/earthdistance/earthdistance.sql.in

-2
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
-- The earth functions rely on contrib/cube having been installed and loaded.
75

86
-- earth() returns the radius of the earth in meters. This is the only

contrib/earthdistance/expected/earthdistance.out

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
-- does not depend on contents of earthdistance.sql or cube.sql.
77
--
88
\set ECHO none
9-
psql:../cube/cube.sql:12: NOTICE: ProcedureCreate: type cube is not yet defined
10-
psql:../cube/cube.sql:17: NOTICE: Argument type "cube" is only a shell
9+
psql:../cube/cube.sql:10: NOTICE: ProcedureCreate: type cube is not yet defined
10+
psql:../cube/cube.sql:15: NOTICE: Argument type "cube" is only a shell
1111
--
1212
-- The radius of the Earth we are using.
1313
--

contrib/findoidjoins/findoidjoins.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2002 by PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/contrib/findoidjoins/Attic/findoidjoins.c,v 1.19 2002/10/18 18:41:20 momjian Exp $
6+
* $Header: /cvsroot/pgsql/contrib/findoidjoins/Attic/findoidjoins.c,v 1.20 2003/05/14 03:25:56 tgl Exp $
77
*/
88
#include "postgres_fe.h"
99

@@ -49,7 +49,6 @@ main(int argc, char **argv)
4949

5050
appendPQExpBuffer(&sql, "%s",
5151
"SET search_path = public;"
52-
"SET autocommit TO 'on';"
5352
"SELECT c.relname, (SELECT nspname FROM "
5453
"pg_catalog.pg_namespace n WHERE n.oid = c.relnamespace) AS nspname "
5554
"FROM pg_catalog.pg_class c "

contrib/fulltextindex/fti.pl

-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ sub main {
167167
}
168168

169169
PQexec($PG_CONN, "SET search_path = public");
170-
PQexec($PG_CONN, "SET autocommit TO 'on'");
171170
PQexec($PG_CONN, "begin");
172171

173172
$query = "declare C cursor for select (\"";

contrib/fulltextindex/fti.sql.in

-2
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 OR REPLACE FUNCTION fti() RETURNS trigger AS
75
'MODULE_PATHNAME', 'fti'
86
LANGUAGE 'C' VOLATILE CALLED ON NULL INPUT;

contrib/fulltextindex/uninstall.sql

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
-- Adjust this setting to control where the objects get created.
22
SET search_path = public;
33

4-
SET autocommit TO 'on';
5-
64
DROP FUNCTION fti() CASCADE;

contrib/fuzzystrmatch/fuzzystrmatch.sql.in

-2
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 FUNCTION levenshtein (text,text)
75
RETURNS int
86
AS 'MODULE_PATHNAME','levenshtein'

contrib/intagg/int_aggregate.sql.in

-2
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
-- Internal function for the aggregate
75
-- Is called for each item in an aggregation
86
CREATE OR REPLACE FUNCTION int_agg_state (int4, int4)

contrib/intarray/_int.sql.in

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
-- opclasses get created.
77
SET search_path = public;
88

9-
SET autocommit TO 'on';
10-
119
-- Query type
1210
CREATE FUNCTION bqarr_in(cstring)
1311
RETURNS query_int

contrib/intarray/expected/_int.out

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
-- does not depend on contents of seg.sql.
44
--
55
\set ECHO none
6-
psql:_int.sql:15: NOTICE: ProcedureCreate: type query_int is not yet defined
7-
psql:_int.sql:20: NOTICE: Argument type "query_int" is only a shell
6+
psql:_int.sql:13: NOTICE: ProcedureCreate: type query_int is not yet defined
7+
psql:_int.sql:18: NOTICE: Argument type "query_int" is only a shell
88
SELECT intset(1234);
99
intset
1010
--------

contrib/isbn_issn/isbn_issn.sql.in

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
--
22
-- PostgreSQL code for ISSNs.
33
--
4-
-- $Id: isbn_issn.sql.in,v 1.7 2002/10/18 18:41:20 momjian Exp $
4+
-- $Id: isbn_issn.sql.in,v 1.8 2003/05/14 03:25:56 tgl Exp $
55
--
66

77
-- Adjust this setting to control where the objects get created.
88
SET search_path = public;
99

10-
SET autocommit TO 'on';
11-
1210
--
1311
-- Input and output functions and the type itself:
1412
--
@@ -124,7 +122,7 @@ CREATE OPERATOR <> (
124122
--
125123
-- PostgreSQL code for ISBNs.
126124
--
127-
-- $Id: isbn_issn.sql.in,v 1.7 2002/10/18 18:41:20 momjian Exp $
125+
-- $Id: isbn_issn.sql.in,v 1.8 2003/05/14 03:25:56 tgl Exp $
128126
--
129127
--
130128
-- Input and output functions and the type itself:

0 commit comments

Comments
 (0)