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.
This commit is contained in:
Tom Lane 2003-05-14 03:26:03 +00:00
parent d9b679c13a
commit f85f43dfb5
99 changed files with 277 additions and 536 deletions

View File

@ -1,5 +1,5 @@
#!/usr/bin/perl
# $Id: adddepend,v 1.3 2002/12/02 00:28:29 tgl Exp $
# $Id: adddepend,v 1.4 2003/05/14 03:25:55 tgl Exp $
# Project exists to assist PostgreSQL users with their structural upgrade
# 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);
# We want to control commits
$dbh->{'AutoCommit'} = 0;
# turn on autocommit
# control where things get created
my $sql = qq{
SET search_path = public;
};
my $sth = $dbh->prepare($sql);
$sth->execute();
# turn on autocommit
my $sql2 = qq{
SET autocommit TO 'on';
};
my $sth2 = $dbh->prepare($sql2);
$sth2->execute();
END {
$dbh->disconnect() if $dbh;
}

View File

@ -6,8 +6,6 @@
-- Adjust this setting to control where the objects get created.
SET search_path = public;
SET autocommit TO 'on';
CREATE OR REPLACE FUNCTION array_texteq(_text, text)
RETURNS bool
AS 'MODULE_PATHNAME'

View File

@ -1,8 +1,6 @@
-- Adjust this setting to control where the objects get created.
SET search_path = public;
SET autocommit TO 'on';
-- create type of int2 key
CREATE FUNCTION int2key_in(cstring)
RETURNS int2key

View File

@ -3,18 +3,18 @@
-- does not depend on contents of btree_gist.sql.
--
\set ECHO none
psql:btree_gist.sql:10: NOTICE: ProcedureCreate: type int2key is not yet defined
psql:btree_gist.sql:15: NOTICE: Argument type "int2key" is only a shell
psql:btree_gist.sql:27: NOTICE: ProcedureCreate: type int4key is not yet defined
psql:btree_gist.sql:32: NOTICE: Argument type "int4key" is only a shell
psql:btree_gist.sql:44: NOTICE: ProcedureCreate: type int8key is not yet defined
psql:btree_gist.sql:49: NOTICE: Argument type "int8key" is only a shell
psql:btree_gist.sql:61: NOTICE: ProcedureCreate: type float4key is not yet defined
psql:btree_gist.sql:66: NOTICE: Argument type "float4key" is only a shell
psql:btree_gist.sql:79: NOTICE: ProcedureCreate: type float8key is not yet defined
psql:btree_gist.sql:84: NOTICE: Argument type "float8key" is only a shell
psql:btree_gist.sql:394: NOTICE: ProcedureCreate: type tskey is not yet defined
psql:btree_gist.sql:399: NOTICE: Argument type "tskey" is only a shell
psql:btree_gist.sql:8: NOTICE: ProcedureCreate: type int2key is not yet defined
psql:btree_gist.sql:13: NOTICE: Argument type "int2key" is only a shell
psql:btree_gist.sql:25: NOTICE: ProcedureCreate: type int4key is not yet defined
psql:btree_gist.sql:30: NOTICE: Argument type "int4key" is only a shell
psql:btree_gist.sql:42: NOTICE: ProcedureCreate: type int8key is not yet defined
psql:btree_gist.sql:47: NOTICE: Argument type "int8key" is only a shell
psql:btree_gist.sql:59: NOTICE: ProcedureCreate: type float4key is not yet defined
psql:btree_gist.sql:64: NOTICE: Argument type "float4key" is only a shell
psql:btree_gist.sql:77: NOTICE: ProcedureCreate: type float8key is not yet defined
psql:btree_gist.sql:82: NOTICE: Argument type "float8key" is only a shell
psql:btree_gist.sql:392: NOTICE: ProcedureCreate: type tskey is not yet defined
psql:btree_gist.sql:397: NOTICE: Argument type "tskey" is only a shell
CREATE TABLE int4tmp (b int4);
\copy int4tmp from 'data/test_btree.data'
CREATE TABLE int8tmp (b int8);

View File

@ -4,7 +4,7 @@
-- darcy@druid.net
-- http://www.druid.net/darcy/
--
-- $Header: /cvsroot/pgsql/contrib/chkpass/chkpass.sql.in,v 1.3 2002/10/18 18:41:19 momjian Exp $
-- $Header: /cvsroot/pgsql/contrib/chkpass/chkpass.sql.in,v 1.4 2003/05/14 03:25:55 tgl Exp $
--
-- best viewed with tabs set to 4
--
@ -16,8 +16,6 @@
-- Adjust this setting to control where the objects get created.
SET search_path = public;
SET autocommit TO 'on';
CREATE FUNCTION chkpass_in(cstring)
RETURNS chkpass
AS 'MODULE_PATHNAME'

View File

@ -4,8 +4,6 @@
-- Adjust this setting to control where the objects get created.
SET search_path = public;
SET autocommit TO 'on';
CREATE OR REPLACE FUNCTION cube_in(cstring)
RETURNS cube
AS 'MODULE_PATHNAME'

View File

@ -6,8 +6,8 @@
-- does not depend on contents of cube.sql.
--
\set ECHO none
psql:cube.sql:12: NOTICE: ProcedureCreate: type cube is not yet defined
psql:cube.sql:17: NOTICE: Argument type "cube" is only a shell
psql:cube.sql:10: NOTICE: ProcedureCreate: type cube is not yet defined
psql:cube.sql:15: NOTICE: Argument type "cube" is only a shell
--
-- testing the input and output functions
--

View File

@ -861,8 +861,6 @@ main(int argc, char **argv)
PQexec(conn, "SET search_path = public");
PQexec(conn, "SET autocommit TO 'on'");
/* Substitute field names */
do_substitute(subarg, dbh);

View File

@ -190,7 +190,7 @@ WHERE t.a > 7;
ERROR: dblink: no connection available
-- 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
SELECT substr(dblink_exec('dbname=regression','SET autocommit TO ''on'';INSERT INTO foo VALUES(10,''k'',''{"a10","b10","c10"}'')'),1,6);
SELECT substr(dblink_exec('dbname=regression','INSERT INTO foo VALUES(10,''k'',''{"a10","b10","c10"}'')'),1,6);
substr
--------
INSERT
@ -205,7 +205,7 @@ SELECT dblink_connect('dbname=regression');
-- 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
SELECT substr(dblink_exec('SET autocommit TO ''on'';INSERT INTO foo VALUES(11,''l'',''{"a11","b11","c11"}'')'),1,6);
SELECT substr(dblink_exec('INSERT INTO foo VALUES(11,''l'',''{"a11","b11","c11"}'')'),1,6);
substr
--------
INSERT
@ -231,7 +231,7 @@ FROM dblink('SELECT * FROM foo') AS t(a int, b text, c text[]);
(12 rows)
-- change some data
SELECT dblink_exec('SET autocommit TO ''on'';UPDATE foo SET f3[2] = ''b99'' WHERE f1 = 11');
SELECT dblink_exec('UPDATE foo SET f3[2] = ''b99'' WHERE f1 = 11');
dblink_exec
-------------
UPDATE 1
@ -247,7 +247,7 @@ WHERE a = 11;
(1 row)
-- delete some data
SELECT dblink_exec('SET autocommit TO ''on'';DELETE FROM foo WHERE f1 = 11');
SELECT dblink_exec('DELETE FROM foo WHERE f1 = 11');
dblink_exec
-------------
DELETE 1

View File

@ -8,7 +8,6 @@ SET search_path = public;
-- Turn off echoing so that expected file does not depend on
-- contents of dblink.sql.
\set ECHO none
SET autocommit TO 'on';
\i dblink.sql
\set ECHO all
@ -113,21 +112,21 @@ WHERE t.a > 7;
-- 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
SELECT substr(dblink_exec('dbname=regression','SET autocommit TO ''on'';INSERT INTO foo VALUES(10,''k'',''{"a10","b10","c10"}'')'),1,6);
SELECT substr(dblink_exec('dbname=regression','INSERT INTO foo VALUES(10,''k'',''{"a10","b10","c10"}'')'),1,6);
-- create a persistent connection
SELECT dblink_connect('dbname=regression');
-- 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
SELECT substr(dblink_exec('SET autocommit TO ''on'';INSERT INTO foo VALUES(11,''l'',''{"a11","b11","c11"}'')'),1,6);
SELECT substr(dblink_exec('INSERT INTO foo VALUES(11,''l'',''{"a11","b11","c11"}'')'),1,6);
-- let's see it
SELECT *
FROM dblink('SELECT * FROM foo') AS t(a int, b text, c text[]);
-- change some data
SELECT dblink_exec('SET autocommit TO ''on'';UPDATE foo SET f3[2] = ''b99'' WHERE f1 = 11');
SELECT dblink_exec('UPDATE foo SET f3[2] = ''b99'' WHERE f1 = 11');
-- let's see it
SELECT *
@ -135,7 +134,7 @@ FROM dblink('SELECT * FROM foo') AS t(a int, b text, c text[])
WHERE a = 11;
-- delete some data
SELECT dblink_exec('SET autocommit TO ''on'';DELETE FROM foo WHERE f1 = 11');
SELECT dblink_exec('DELETE FROM foo WHERE f1 = 11');
-- let's see it
SELECT *

View File

@ -1,8 +1,6 @@
-- Adjust this setting to control where the objects get created.
SET search_path = public;
SET autocommit TO 'on';
CREATE TRIGGER "MyTableName_Trig"
AFTER INSERT OR DELETE OR UPDATE ON "MyTableName"
FOR EACH ROW EXECUTE PROCEDURE "recordchange" ();

View File

@ -33,7 +33,7 @@
#
#
##############################################################################
# $Id: DBMirror.pl,v 1.5 2002/12/05 21:03:51 momjian Exp $
# $Id: DBMirror.pl,v 1.6 2003/05/14 03:25:55 tgl Exp $
#
##############################################################################
@ -135,15 +135,6 @@ sub Main() {
die;
}
my $setQuery2;
$setQuery2 = "SET autocommit TO 'on'";
my $setResult2 = $masterConn->exec($setQuery2);
if($setResult2->resultStatus!=PGRES_COMMAND_OK) {
logErrorMessage($masterConn->errorMessage . "\n" .
$setQuery2);
die;
}
my $firstTime = 1;
while(1) {
if($firstTime == 0) {
@ -158,7 +149,6 @@ sub Main() {
sendQueryToSlaves(undef,"SET autocommit TO 'on'");
sendQueryToSlaves(undef,"SET TRANSACTION ISOLATION LEVEL SERIALIZABLE");
sendQueryToSlaves(undef,"SET CONSTRAINTS ALL DEFERRED");

View File

@ -1,6 +1,4 @@
SET autocommit TO 'on';
CREATE FUNCTION "recordchange" () RETURNS trigger AS
'/usr/local/pgsql/lib/pending.so', 'recordchange' LANGUAGE 'C';

View File

@ -16,7 +16,7 @@
# GNU General Public License for more details.
#
##############################################################################
# $Id: clean_pending.pl,v 1.2 2002/10/18 18:41:19 momjian Exp $
# $Id: clean_pending.pl,v 1.3 2003/05/14 03:25:55 tgl Exp $
##############################################################################
@ -69,10 +69,6 @@ unless($dbConn->status == PGRES_CONNECTION_OK) {
printf("Can't connect to database\n");
die;
}
my $setresult = $dbConn->exec("SET autocommit TO 'on'");
unless($setresult->resultStatus == PGRES_COMMAND_OK) {
die $dbConn->errorMessage;
}
my $result = $dbConn->exec("BEGIN");
unless($result->resultStatus == PGRES_COMMAND_OK) {
die $dbConn->errorMessage;

View File

@ -1,8 +1,6 @@
-- Adjust this setting to control where the objects get created.
SET search_path = public;
SET autocommit TO 'on';
-- The earth functions rely on contrib/cube having been installed and loaded.
-- earth() returns the radius of the earth in meters. This is the only

View File

@ -6,8 +6,8 @@
-- does not depend on contents of earthdistance.sql or cube.sql.
--
\set ECHO none
psql:../cube/cube.sql:12: NOTICE: ProcedureCreate: type cube is not yet defined
psql:../cube/cube.sql:17: NOTICE: Argument type "cube" is only a shell
psql:../cube/cube.sql:10: NOTICE: ProcedureCreate: type cube is not yet defined
psql:../cube/cube.sql:15: NOTICE: Argument type "cube" is only a shell
--
-- The radius of the Earth we are using.
--

View File

@ -3,7 +3,7 @@
*
* Copyright 2002 by PostgreSQL Global Development Group
*
* $Header: /cvsroot/pgsql/contrib/findoidjoins/Attic/findoidjoins.c,v 1.19 2002/10/18 18:41:20 momjian Exp $
* $Header: /cvsroot/pgsql/contrib/findoidjoins/Attic/findoidjoins.c,v 1.20 2003/05/14 03:25:56 tgl Exp $
*/
#include "postgres_fe.h"
@ -49,7 +49,6 @@ main(int argc, char **argv)
appendPQExpBuffer(&sql, "%s",
"SET search_path = public;"
"SET autocommit TO 'on';"
"SELECT c.relname, (SELECT nspname FROM "
"pg_catalog.pg_namespace n WHERE n.oid = c.relnamespace) AS nspname "
"FROM pg_catalog.pg_class c "

View File

@ -167,7 +167,6 @@ sub main {
}
PQexec($PG_CONN, "SET search_path = public");
PQexec($PG_CONN, "SET autocommit TO 'on'");
PQexec($PG_CONN, "begin");
$query = "declare C cursor for select (\"";

View File

@ -1,8 +1,6 @@
-- Adjust this setting to control where the objects get created.
SET search_path = public;
SET autocommit TO 'on';
CREATE OR REPLACE FUNCTION fti() RETURNS trigger AS
'MODULE_PATHNAME', 'fti'
LANGUAGE 'C' VOLATILE CALLED ON NULL INPUT;

View File

@ -1,6 +1,4 @@
-- Adjust this setting to control where the objects get created.
SET search_path = public;
SET autocommit TO 'on';
DROP FUNCTION fti() CASCADE;

View File

@ -1,8 +1,6 @@
-- Adjust this setting to control where the objects get created.
SET search_path = public;
SET autocommit TO 'on';
CREATE FUNCTION levenshtein (text,text)
RETURNS int
AS 'MODULE_PATHNAME','levenshtein'

View File

@ -1,8 +1,6 @@
-- Adjust this setting to control where the objects get created.
SET search_path = public;
SET autocommit TO 'on';
-- Internal function for the aggregate
-- Is called for each item in an aggregation
CREATE OR REPLACE FUNCTION int_agg_state (int4, int4)

View File

@ -6,8 +6,6 @@
-- opclasses get created.
SET search_path = public;
SET autocommit TO 'on';
-- Query type
CREATE FUNCTION bqarr_in(cstring)
RETURNS query_int

View File

@ -3,8 +3,8 @@
-- does not depend on contents of seg.sql.
--
\set ECHO none
psql:_int.sql:15: NOTICE: ProcedureCreate: type query_int is not yet defined
psql:_int.sql:20: NOTICE: Argument type "query_int" is only a shell
psql:_int.sql:13: NOTICE: ProcedureCreate: type query_int is not yet defined
psql:_int.sql:18: NOTICE: Argument type "query_int" is only a shell
SELECT intset(1234);
intset
--------

View File

@ -1,14 +1,12 @@
--
-- PostgreSQL code for ISSNs.
--
-- $Id: isbn_issn.sql.in,v 1.7 2002/10/18 18:41:20 momjian Exp $
-- $Id: isbn_issn.sql.in,v 1.8 2003/05/14 03:25:56 tgl Exp $
--
-- Adjust this setting to control where the objects get created.
SET search_path = public;
SET autocommit TO 'on';
--
-- Input and output functions and the type itself:
--
@ -124,7 +122,7 @@ CREATE OPERATOR <> (
--
-- PostgreSQL code for ISBNs.
--
-- $Id: isbn_issn.sql.in,v 1.7 2002/10/18 18:41:20 momjian Exp $
-- $Id: isbn_issn.sql.in,v 1.8 2003/05/14 03:25:56 tgl Exp $
--
--
-- Input and output functions and the type itself:

View File

@ -1,7 +1,7 @@
--
-- PostgreSQL code for LargeObjects
--
-- $Id: lo.sql.in,v 1.9 2002/12/31 10:22:03 inoue Exp $
-- $Id: lo.sql.in,v 1.10 2003/05/14 03:25:56 tgl Exp $
--
--
-- Create the data type
@ -12,8 +12,6 @@
-- Adjust this setting to control where the objects get created.
SET search_path = public;
SET autocommit TO 'on';
CREATE FUNCTION lo_in(cstring)
RETURNS lo
AS 'MODULE_PATHNAME'

View File

@ -6,8 +6,6 @@
-- Adjust this setting to control where the objects get created.
SET search_path = public;
SET autocommit TO 'on';
-- remove our test table
DROP TABLE a;

View File

@ -1,12 +1,12 @@
\set ECHO none
psql:ltree.sql:9: NOTICE: ProcedureCreate: type ltree is not yet defined
psql:ltree.sql:14: NOTICE: Argument type "ltree" is only a shell
psql:ltree.sql:301: NOTICE: ProcedureCreate: type lquery is not yet defined
psql:ltree.sql:306: NOTICE: Argument type "lquery" is only a shell
psql:ltree.sql:412: NOTICE: ProcedureCreate: type ltxtquery is not yet defined
psql:ltree.sql:417: NOTICE: Argument type "ltxtquery" is only a shell
psql:ltree.sql:479: NOTICE: ProcedureCreate: type ltree_gist is not yet defined
psql:ltree.sql:484: NOTICE: Argument type "ltree_gist" is only a shell
psql:ltree.sql:7: NOTICE: ProcedureCreate: type ltree is not yet defined
psql:ltree.sql:12: NOTICE: Argument type "ltree" is only a shell
psql:ltree.sql:299: NOTICE: ProcedureCreate: type lquery is not yet defined
psql:ltree.sql:304: NOTICE: Argument type "lquery" is only a shell
psql:ltree.sql:410: NOTICE: ProcedureCreate: type ltxtquery is not yet defined
psql:ltree.sql:415: NOTICE: Argument type "ltxtquery" is only a shell
psql:ltree.sql:477: NOTICE: ProcedureCreate: type ltree_gist is not yet defined
psql:ltree.sql:482: NOTICE: Argument type "ltree_gist" is only a shell
SELECT ''::ltree;
ltree
-------

View File

@ -1,8 +1,6 @@
-- Adjust this setting to control where the objects get created.
SET search_path = public;
SET autocommit TO 'on';
CREATE FUNCTION ltree_in(cstring)
RETURNS ltree
AS 'MODULE_PATHNAME'

View File

@ -13,8 +13,6 @@
-- Adjust this setting to control where the objects get created.
SET search_path = public;
SET autocommit TO 'on';
CREATE OR REPLACE FUNCTION backend_pid()
RETURNS int4
AS 'MODULE_PATHNAME'

View File

@ -1,8 +1,6 @@
-- Adjust this setting to control where the objects get created.
SET search_path = public;
SET autocommit TO 'on';
CREATE OR REPLACE FUNCTION noup ()
RETURNS trigger
AS 'MODULE_PATHNAME'

View File

@ -247,8 +247,6 @@ sql_conn(const char *dbName, struct options * my_opts)
sql_exec(conn, "SET search_path = public;", 0);
sql_exec(conn, "SET autocommit TO 'on';", 0);
/* return the conn if good */
return conn;
}

View File

@ -1,7 +1,7 @@
/* -------------------------------------------------------------------------
* pg_dumplo
*
* $Header: /cvsroot/pgsql/contrib/pg_dumplo/Attic/main.c,v 1.15 2003/01/09 18:27:39 tgl Exp $
* $Header: /cvsroot/pgsql/contrib/pg_dumplo/Attic/main.c,v 1.16 2003/05/14 03:25:56 tgl Exp $
*
* Karel Zak 1999-2000
* -------------------------------------------------------------------------
@ -191,8 +191,6 @@ main(int argc, char **argv)
PQexec(pgLO->conn, "SET search_path = public");
PQexec(pgLO->conn, "SET autocommit TO 'on'");
PQexec(pgLO->conn, "BEGIN");
switch (pgLO->action)

View File

@ -1,5 +1,5 @@
/*
* $Header: /cvsroot/pgsql/contrib/pgbench/pgbench.c,v 1.22 2002/10/20 19:38:10 tgl Exp $
* $Header: /cvsroot/pgsql/contrib/pgbench/pgbench.c,v 1.23 2003/05/14 03:25:56 tgl Exp $
*
* pgbench: a simple TPC-B like benchmark program for PostgreSQL
* written by Tatsuo Ishii
@ -147,13 +147,6 @@ doConnect()
exit(1);
}
PQclear(res);
res = PQexec(con, "SET autocommit TO 'on'");
if (PQresultStatus(res) != PGRES_COMMAND_OK)
{
fprintf(stderr, "%s", PQerrorMessage(con));
exit(1);
}
PQclear(res);
return (con);
}

View File

@ -1,8 +1,6 @@
-- Adjust this setting to control where the objects get created.
SET search_path = public;
SET autocommit TO 'on';
CREATE OR REPLACE FUNCTION digest(text, text)
RETURNS bytea
AS 'MODULE_PATHNAME', 'pg_digest'

View File

@ -1,8 +1,6 @@
-- Adjust this setting to control where the objects get created.
SET search_path = public;
SET autocommit TO 'on';
DROP TYPE pgstattuple_type CASCADE;
CREATE TYPE pgstattuple_type AS (
table_len BIGINT, -- physical table length in bytes

View File

@ -1,6 +1,6 @@
#!/bin/sh
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- #
# Package : reindexdb Version : $Revision: 1.3 $
# Package : reindexdb Version : $Revision: 1.4 $
# Date : 05/08/2002 Author : Shaun Thomas
# Req : psql, sh, perl, sed Type : Utility
#
@ -193,11 +193,11 @@ fi
# If index was set, reindex that index.
if [ "$index" ]; then
$PSQL $PSQLOPT $ECHOOPT -c "SET autocommit TO 'on';REINDEX INDEX $index" -d $dbname
$PSQL $PSQLOPT $ECHOOPT -c "REINDEX INDEX $index" -d $dbname
# Ok, no index. Is there a specific table to reindex?
elif [ "$table" ]; then
$PSQL $PSQLOPT $ECHOOPT -c "SET autocommit TO 'on';REINDEX TABLE \"$table\"" -d $dbname
$PSQL $PSQLOPT $ECHOOPT -c "REINDEX TABLE \"$table\"" -d $dbname
# No specific table, no specific index, either we have a specific database,
# or were told to do all databases. Do it!
@ -213,9 +213,9 @@ else
# Ok, reindex every table in the database. Use the same method
# we used to get a list of databases, and get a list of tables in this
# database that we may reindex.
tables=`$PSQL $PSQLOPT -q -t -A -d $db -c "SET autocommit TO 'on';$sql"`
tables=`$PSQL $PSQLOPT -q -t -A -d $db -c "$sql"`
for tab in $tables; do
$PSQL $PSQLOPT $ECHOOPT -c "SET autocommit TO 'on';REINDEX TABLE \"$tab\"" -d $db
$PSQL $PSQLOPT $ECHOOPT -c "REINDEX TABLE \"$tab\"" -d $db
done
done

View File

@ -32,13 +32,6 @@ my $setsql = qq{
my $sth = $dbi->prepare($setsql);
$sth->execute();
my $setsql2 = qq{
SET autocommit TO 'on';
};
my $sth2 = $dbi->prepare($setsql2);
$sth2->execute();
my $sql;
my $notice;
my $sss = '(3000,3000,2990,2990)';

View File

@ -1,8 +1,6 @@
-- Adjust this setting to control where the objects get created.
SET search_path = public;
SET autocommit TO 'on';
--
--
--

View File

@ -6,8 +6,8 @@
-- does not depend on contents of seg.sql.
--
\set ECHO none
psql:seg.sql:12: NOTICE: ProcedureCreate: type seg is not yet defined
psql:seg.sql:17: NOTICE: Argument type "seg" is only a shell
psql:seg.sql:10: NOTICE: ProcedureCreate: type seg is not yet defined
psql:seg.sql:15: NOTICE: Argument type "seg" is only a shell
--
-- testing the input and output functions
--
@ -395,25 +395,25 @@ SELECT '100(+-)1'::seg AS seg;
SELECT ''::seg AS seg;
ERROR: seg_in: can't parse an empty string
SELECT 'ABC'::seg AS seg;
ERROR: parse error at or near position 1, character ('A', \101), input: 'ABC'
ERROR: syntax error at or near position 1, character ('A', \101), input: 'ABC'
SELECT '1ABC'::seg AS seg;
ERROR: parse error at or near position 2, character ('A', \101), input: '1ABC'
ERROR: syntax error at or near position 2, character ('A', \101), input: '1ABC'
SELECT '1.'::seg AS seg;
ERROR: parse error at or near position 2, character ('.', \056), input: '1.'
ERROR: syntax error at or near position 2, character ('.', \056), input: '1.'
SELECT '1.....'::seg AS seg;
ERROR: parse error at or near position 6, character ('.', \056), input: '1.....'
ERROR: syntax error at or near position 6, character ('.', \056), input: '1.....'
SELECT '.1'::seg AS seg;
ERROR: parse error at or near position 2, character ('1', \061), input: '.1'
ERROR: syntax error at or near position 2, character ('1', \061), input: '.1'
SELECT '1..2.'::seg AS seg;
ERROR: parse error at or near position 5, character ('.', \056), input: '1..2.'
ERROR: syntax error at or near position 5, character ('.', \056), input: '1..2.'
SELECT '1 e7'::seg AS seg;
ERROR: parse error at or near position 3, character ('e', \145), input: '1 e7'
ERROR: syntax error at or near position 3, character ('e', \145), input: '1 e7'
SELECT '1e700'::seg AS seg;
ERROR: numeric value 1e700 unrepresentable

View File

@ -4,8 +4,6 @@
-- Adjust this setting to control where the objects get created.
SET search_path = public;
SET autocommit TO 'on';
CREATE FUNCTION seg_in(cstring)
RETURNS seg
AS 'MODULE_PATHNAME'

View File

@ -1,8 +1,6 @@
-- Adjust this setting to control where the objects get created.
SET search_path = public;
SET autocommit TO 'on';
CREATE OR REPLACE FUNCTION autoinc()
RETURNS trigger
AS 'MODULE_PATHNAME'

View File

@ -1,8 +1,6 @@
-- Adjust this setting to control where the objects get created.
SET search_path = public;
SET autocommit TO 'on';
CREATE OR REPLACE FUNCTION insert_username()
RETURNS trigger
AS 'MODULE_PATHNAME'

View File

@ -1,8 +1,6 @@
-- Adjust this setting to control where the objects get created.
SET search_path = public;
SET autocommit TO 'on';
CREATE OR REPLACE FUNCTION moddatetime()
RETURNS trigger
AS 'MODULE_PATHNAME'

View File

@ -1,8 +1,6 @@
-- Adjust this setting to control where the objects get created.
SET search_path = public;
SET autocommit TO 'on';
CREATE OR REPLACE FUNCTION check_primary_key()
RETURNS trigger
AS 'MODULE_PATHNAME'

View File

@ -1,8 +1,6 @@
-- Adjust this setting to control where the objects get created.
SET search_path = public;
SET autocommit TO 'on';
CREATE OR REPLACE FUNCTION timetravel()
RETURNS trigger
AS 'MODULE_PATHNAME'

View File

@ -1,8 +1,6 @@
-- Adjust this setting to control where the objects get created.
SET search_path = public;
SET autocommit TO 'on';
CREATE OR REPLACE FUNCTION normal_rand(int4, float8, float8, int4)
RETURNS setof float8
AS 'MODULE_PATHNAME','normal_rand'

View File

@ -3,14 +3,14 @@
-- does not depend on contents of seg.sql.
--
\set ECHO none
psql:tsearch.sql:11: NOTICE: ProcedureCreate: type txtidx is not yet defined
psql:tsearch.sql:16: NOTICE: Argument type "txtidx" is only a shell
psql:tsearch.sql:40: NOTICE: ProcedureCreate: type query_txt is not yet defined
psql:tsearch.sql:45: NOTICE: Argument type "query_txt" is only a shell
psql:tsearch.sql:57: NOTICE: ProcedureCreate: type mquery_txt is not yet defined
psql:tsearch.sql:63: NOTICE: Argument type "mquery_txt" is only a shell
psql:tsearch.sql:158: NOTICE: ProcedureCreate: type gtxtidx is not yet defined
psql:tsearch.sql:163: NOTICE: Argument type "gtxtidx" is only a shell
psql:tsearch.sql:9: NOTICE: ProcedureCreate: type txtidx is not yet defined
psql:tsearch.sql:14: NOTICE: Argument type "txtidx" is only a shell
psql:tsearch.sql:38: NOTICE: ProcedureCreate: type query_txt is not yet defined
psql:tsearch.sql:43: NOTICE: Argument type "query_txt" is only a shell
psql:tsearch.sql:55: NOTICE: ProcedureCreate: type mquery_txt is not yet defined
psql:tsearch.sql:61: NOTICE: Argument type "mquery_txt" is only a shell
psql:tsearch.sql:156: NOTICE: ProcedureCreate: type gtxtidx is not yet defined
psql:tsearch.sql:161: NOTICE: Argument type "gtxtidx" is only a shell
--txtidx
SELECT '1'::txtidx;
txtidx

View File

@ -1,8 +1,6 @@
-- Adjust this setting to control where the objects get created.
SET search_path = public;
SET autocommit TO 'on';
-- TXTIDX type
CREATE FUNCTION txtidx_in(cstring)

View File

@ -12,8 +12,6 @@
-- Adjust this setting to control where the objects get created.
SET search_path = public;
SET autocommit TO 'on';
CREATE OR REPLACE FUNCTION user_lock(int4,int4,int4)
RETURNS int4
AS 'MODULE_PATHNAME'

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/contrib/vacuumlo/vacuumlo.c,v 1.19 2002/12/10 01:57:16 momjian Exp $
* $Header: /cvsroot/pgsql/contrib/vacuumlo/vacuumlo.c,v 1.20 2003/05/14 03:25:57 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -218,17 +218,6 @@ vacuumlo(char *database, struct _param * param)
}
PQclear(res);
res = PQexec(conn, "SET autocommit TO 'on'");
if (PQresultStatus(res) != PGRES_COMMAND_OK)
{
fprintf(stderr, "Failed to set autocommit on:\n");
fprintf(stderr, "%s", PQerrorMessage(conn));
PQclear(res);
PQfinish(conn);
return -1;
}
PQclear(res);
/*
* First we create and populate the LO temp table
*/

View File

@ -3,8 +3,6 @@
-- Adjust this setting to control where the objects get created.
SET search_path TO public;
SET autocommit TO on;
CREATE OR REPLACE FUNCTION pgxml_parse(text) RETURNS boolean
AS 'MODULE_PATHNAME' LANGUAGE c STRICT;

View File

@ -3,8 +3,6 @@
-- Adjust this setting to control where the objects get created.
SET search_path TO public;
SET autocommit TO on;
CREATE OR REPLACE FUNCTION pgxml_parse(text) RETURNS boolean
AS 'MODULE_PATHNAME' LANGUAGE c STRICT;

View File

@ -1,5 +1,5 @@
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/libpq.sgml,v 1.122 2003/04/28 19:30:49 tgl Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/libpq.sgml,v 1.123 2003/05/14 03:25:58 tgl Exp $
-->
<chapter id="libpq">
@ -866,8 +866,13 @@ returned by the server.
maintain the <structname>PGresult</structname> abstraction. Use the accessor functions below to get
at the contents of <structname>PGresult</structname>. Avoid directly referencing the fields of the
<structname>PGresult</structname> structure because they are subject to change in the future.
If <quote>autocommit</quote> is on, multiple queries sent in a single
function call are processed in a single transaction.
</para>
<para>
Multiple queries sent in a single
function call are processed in a single transaction, unless there are explicit
BEGIN/COMMIT commands included in the query string to divide it into multiple
transactions.
</para>
<variablelist>

View File

@ -1,5 +1,5 @@
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/begin.sgml,v 1.23 2003/04/15 13:25:08 petere Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/begin.sgml,v 1.24 2003/05/14 03:26:00 tgl Exp $
PostgreSQL documentation
-->
@ -98,12 +98,6 @@ BEGIN [ WORK | TRANSACTION ]
<xref linkend="SQL-ROLLBACK" endterm="SQL-ROLLBACK-TITLE">
to terminate a transaction.
</para>
<para>
If you turn the configuration parameter <varname>autocommit</> off,
then <command>BEGIN</> is not required: any SQL command
automatically starts a transaction.
</para>
</refsect1>
<refsect1>

View File

@ -1,5 +1,5 @@
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.88 2003/03/25 16:15:43 petere Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.89 2003/05/14 03:26:00 tgl Exp $
PostgreSQL documentation
-->
@ -88,9 +88,11 @@ PostgreSQL documentation
select * from foo;" | psql</literal>.
</para>
<para>
If <quote>autocommit</quote> is on, multiple queries in a single
string are processed in a single transaction.
If the command string contains multiple SQL commands, they are
processed in a single transaction, unless there are explicit
BEGIN/COMMIT commands included in the string to divide it into
multiple transactions. This is different from the behavior when
the same string is fed to psql's standard input.
</para>
</listitem>
</varlistentry>

View File

@ -1,5 +1,5 @@
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.75 2003/05/04 02:23:16 petere Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/set.sgml,v 1.76 2003/05/14 03:26:00 tgl Exp $
PostgreSQL documentation
-->
@ -55,12 +55,6 @@ SET [ SESSION | LOCAL ] TIME ZONE { <replaceable class="PARAMETER">timezone</rep
seen until the end of the transaction, but afterwards (if the transaction
is committed) the <command>SET</command> value will take effect.
</para>
<para>
Even with <varname>autocommit</> set to <literal>off</>, <command>SET</>
does not start a new transaction block. See the
<varname>autocommit</> section in <xref linkend="runtime-config"> for details.
</para>
</refsect1>
<refsect1>

View File

@ -1,5 +1,5 @@
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/show.sgml,v 1.26 2003/05/04 02:23:16 petere Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/show.sgml,v 1.27 2003/05/14 03:26:00 tgl Exp $
PostgreSQL documentation
-->
@ -37,12 +37,6 @@ SHOW ALL
<command>postmaster</command>. See <xref
linkend="runtime-config"> for details.
</para>
<para>
Even with <varname>autocommit</> set to <literal>off</>, <command>SHOW</>
does not start a new transaction block. See the
<varname>autocommit</> section in <xref linkend="runtime-config"> for details.
</para>
</refsect1>
<refsect1>

View File

@ -1,5 +1,5 @@
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/release.sgml,v 1.186 2003/03/21 01:58:04 tgl Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/release.sgml,v 1.187 2003/05/14 03:25:59 tgl Exp $
-->
<appendix id="release">
@ -24,6 +24,8 @@ CDATA means the content is "SGML-free", so you can write without
worries about funny characters.
-->
<literallayout><![CDATA[
New frontend/backend protocol supports many long-requested features
SET AUTOCOMMIT TO OFF is no longer supported
Reimplementation of NUMERIC datatype for more speed
New regular expression package, many more regexp features (most of Perl5)
Can now do EXPLAIN ... EXECUTE to see plan used for a prepared query

View File

@ -1,5 +1,5 @@
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.178 2003/05/04 02:23:16 petere Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.179 2003/05/14 03:26:00 tgl Exp $
-->
<Chapter Id="runtime">
@ -1289,56 +1289,6 @@ SET ENABLE_SEQSCAN TO OFF;
<title>General Operation</title>
<variablelist>
<varlistentry>
<term><varname>AUTOCOMMIT</varname> (<type>boolean</type>)</term>
<indexterm><primary>autocommit</></>
<listitem>
<para>
If set to true, <productname>PostgreSQL</productname> will
automatically do a <command>COMMIT</> after each successful command
that is not inside an explicit transaction block (that is, unless a
<command>BEGIN</> with no matching <command>COMMIT</> has been
given).
If set to false, <productname>PostgreSQL</productname> will
commit only upon receiving an explicit
<command>COMMIT</> command. This mode can also be thought of as
implicitly issuing <command>BEGIN</> whenever a command is
received that is not already inside a transaction block. The
default is true, for compatibility with historical
<productname>PostgreSQL</productname> behavior. However, for
maximum compatibility with the SQL specification, set it to
false.
</para>
<note>
<para>
Even with <varname>autocommit</> set to false, <command>SET</>,
<command>SHOW</>, and <command>RESET</> do not start new
transaction blocks. They are run in their own transactions.
Once another command is issued, a transaction block
begins and any <command>SET</>, <command>SHOW</>, or
<command>RESET</> commands are considered to be part of the
transaction, i.e., they are committed or rolled back depending
on the completion status of the transaction. To execute a
<command>SET</>, <command>SHOW</>, or <command>RESET</>
command at the start of a transaction block, use <command>BEGIN</>
first.
</para>
</note>
<note>
<para>
As of <productname>PostgreSQL</productname> 7.3, setting
<varname>autocommit</> to false is not well-supported.
This is a new feature and is not yet handled by all client
libraries and applications. Before making it the default
setting in your installation, test carefully.
</para>
</note>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>AUSTRALIAN_TIMEZONES</varname> (<type>boolean</type>)</term>
<indexterm><primary>Australian time zones</></>

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.147 2003/05/02 20:54:33 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.148 2003/05/14 03:26:00 tgl Exp $
*
* NOTES
* Transaction aborts can now occur two ways:
@ -212,15 +212,11 @@ int XactIsoLevel;
bool DefaultXactReadOnly = false;
bool XactReadOnly;
bool autocommit = true;
int CommitDelay = 0; /* precommit delay in microseconds */
int CommitSiblings = 5; /* number of concurrent xacts needed to
* sleep */
static bool suppressChain = false;
static void (*_RollbackFunc) (void *) = NULL;
static void *_RollbackData = NULL;
@ -1125,23 +1121,12 @@ CleanupTransaction(void)
/*
* StartTransactionCommand
*
* preventChain, if true, forces autocommit behavior at the next
* CommitTransactionCommand call.
*/
void
StartTransactionCommand(bool preventChain)
StartTransactionCommand(void)
{
TransactionState s = CurrentTransactionState;
/*
* Remember if caller wants to prevent autocommit-off chaining. This
* is only allowed if not already in a transaction block.
*/
suppressChain = preventChain;
if (preventChain && s->blockState != TBLOCK_DEFAULT)
elog(ERROR, "StartTransactionCommand: can't prevent chain");
switch (s->blockState)
{
/*
@ -1217,44 +1202,20 @@ StartTransactionCommand(bool preventChain)
/*
* CommitTransactionCommand
*
* forceCommit = true forces autocommit behavior even when autocommit is off.
*/
void
CommitTransactionCommand(bool forceCommit)
CommitTransactionCommand(void)
{
TransactionState s = CurrentTransactionState;
switch (s->blockState)
{
/*
* If we aren't in a transaction block, and we are doing
* autocommit, just do our usual transaction commit. But if
* we aren't doing autocommit, start a transaction block
* automatically by switching to INPROGRESS state. (We handle
* this choice here, and not earlier, so that an explicit
* BEGIN issued in autocommit-off mode won't issue strange
* warnings.)
*
* Autocommit mode is forced by either a true forceCommit
* parameter to me, or a true preventChain parameter to the
* preceding StartTransactionCommand call, or a
* PreventTransactionChain call during the transaction.
* (The parameters could be omitted, but it turns out most
* callers of StartTransactionCommand/CommitTransactionCommand
* want to force autocommit, so making them all call
* PreventTransactionChain would just be extra notation.)
* If we aren't in a transaction block, just do our usual
* transaction commit.
*/
case TBLOCK_DEFAULT:
if (autocommit || forceCommit || suppressChain)
CommitTransaction();
else
{
BeginTransactionBlock();
Assert(s->blockState == TBLOCK_INPROGRESS);
/* This code must match the TBLOCK_INPROGRESS case below: */
CommandCounterIncrement();
}
break;
/*
@ -1323,10 +1284,7 @@ AbortCurrentTransaction(void)
*/
case TBLOCK_DEFAULT:
AbortTransaction();
if (autocommit || suppressChain)
CleanupTransaction();
else
s->blockState = TBLOCK_ABORT;
break;
/*
@ -1396,9 +1354,7 @@ AbortCurrentTransaction(void)
* If we have already started a transaction block, issue an error; also issue
* an error if we appear to be running inside a user-defined function (which
* could issue more commands and possibly cause a failure after the statement
* completes). In autocommit-off mode, we allow the statement if a block is
* not already started, and force the statement to be autocommitted despite
* the mode.
* completes).
*
* stmtNode: pointer to parameter block for statement; this is used in
* a very klugy way to determine whether we are inside a function.
@ -1428,14 +1384,7 @@ PreventTransactionChain(void *stmtNode, const char *stmtType)
/* If we got past IsTransactionBlock test, should be in default state */
if (CurrentTransactionState->blockState != TBLOCK_DEFAULT)
elog(ERROR, "PreventTransactionChain: can't prevent chain");
/* okay to set the flag */
suppressChain = true;
/* If we're in autocommit-off node, generate a notice */
if (!autocommit)
{
/* translator: %s represents an SQL statement name */
elog(NOTICE, "%s will be committed automatically", stmtType);
}
/* all okay */
}
/*
@ -1470,12 +1419,6 @@ RequireTransactionChain(void *stmtNode, const char *stmtType)
*/
if (!MemoryContextContains(QueryContext, stmtNode))
return;
/*
* If we are in autocommit-off mode then it's okay, because this
* statement will itself start a transaction block.
*/
if (!autocommit && !suppressChain)
return;
/* translator: %s represents an SQL statement name */
elog(ERROR, "%s may only be used in begin/end transaction blocks",
stmtType);
@ -1507,10 +1450,7 @@ BeginTransactionBlock(void)
s->blockState = TBLOCK_BEGIN;
/*
* do begin processing. NOTE: if you put anything here, check that it
* behaves properly in both autocommit-on and autocommit-off modes. In
* the latter case we will already have done some work in the new
* transaction.
* do begin processing here. Nothing to do at present.
*/
/*

View File

@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootparse.y,v 1.55 2002/11/11 22:19:21 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootparse.y,v 1.56 2003/05/14 03:26:00 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -55,7 +55,7 @@
static void
do_start()
{
StartTransactionCommand(true);
StartTransactionCommand();
elog(DEBUG3, "start transaction");
}
@ -63,7 +63,7 @@ do_start()
static void
do_end()
{
CommitTransactionCommand(true);
CommitTransactionCommand();
elog(DEBUG3, "commit transaction");
if (isatty(0))
{

View File

@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.156 2003/05/08 14:49:03 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.157 2003/05/14 03:26:00 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -479,7 +479,7 @@ BootstrapMain(int argc, char *argv[])
SetProcessingMode(BootstrapProcessing);
/* clean up processing */
StartTransactionCommand(true);
StartTransactionCommand();
cleanup();
/* not reached, here to make compiler happy */
@ -851,7 +851,7 @@ cleanup()
}
if (boot_reldesc != NULL)
closerel(NULL);
CommitTransactionCommand(true);
CommitTransactionCommand();
proc_exit(Warnings);
}

View File

@ -13,7 +13,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/namespace.c,v 1.50 2003/04/24 21:16:42 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/namespace.c,v 1.51 2003/05/14 03:26:01 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -1711,11 +1711,11 @@ RemoveTempRelationsCallback(void)
{
/* Need to ensure we have a usable transaction. */
AbortOutOfAnyTransaction();
StartTransactionCommand(true);
StartTransactionCommand();
RemoveTempRelations(myTempNamespace);
CommitTransactionCommand(true);
CommitTransactionCommand();
}
}

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.93 2003/04/22 00:08:06 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.94 2003/05/14 03:26:01 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -399,9 +399,9 @@ Async_UnlistenOnExit(void)
*/
AbortOutOfAnyTransaction();
/* Now we can do the unlisten */
StartTransactionCommand(true);
StartTransactionCommand();
Async_UnlistenAll();
CommitTransactionCommand(true);
CommitTransactionCommand();
}
/*
@ -769,7 +769,7 @@ ProcessIncomingNotify(void)
notifyInterruptOccurred = 0;
StartTransactionCommand(true);
StartTransactionCommand();
lRel = heap_openr(ListenerRelationName, AccessExclusiveLock);
tdesc = RelationGetDescr(lRel);
@ -823,7 +823,7 @@ ProcessIncomingNotify(void)
*/
heap_close(lRel, NoLock);
CommitTransactionCommand(true);
CommitTransactionCommand();
/*
* Must flush the notify messages to ensure frontend gets them

View File

@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.108 2003/05/02 20:54:33 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.109 2003/05/14 03:26:01 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -205,7 +205,7 @@ cluster(ClusterStmt *stmt)
rvs = get_tables_to_cluster(cluster_context);
/* Commit to get out of starting transaction */
CommitTransactionCommand(true);
CommitTransactionCommand();
/* Ok, now that we've got them all, cluster them one by one */
foreach (rv, rvs)
@ -213,14 +213,14 @@ cluster(ClusterStmt *stmt)
RelToCluster *rvtc = (RelToCluster *) lfirst(rv);
/* Start a new transaction for each relation. */
StartTransactionCommand(true);
StartTransactionCommand();
SetQuerySnapshot(); /* might be needed for functional index */
cluster_rel(rvtc, true);
CommitTransactionCommand(true);
CommitTransactionCommand();
}
/* Start a new transaction for the cleanup work. */
StartTransactionCommand(true);
StartTransactionCommand();
/* Clean up working storage */
MemoryContextDelete(cluster_context);

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/indexcmds.c,v 1.98 2003/05/02 20:54:33 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/indexcmds.c,v 1.99 2003/05/14 03:26:01 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -769,17 +769,16 @@ ReindexDatabase(const char *dbname, bool force, bool all)
heap_close(relationRelation, AccessShareLock);
/* Now reindex each rel in a separate transaction */
CommitTransactionCommand(true);
CommitTransactionCommand();
for (i = 0; i < relcnt; i++)
{
StartTransactionCommand(true);
StartTransactionCommand();
SetQuerySnapshot(); /* might be needed for functional index */
if (reindex_relation(relids[i], force))
elog(NOTICE, "relation %u was reindexed", relids[i]);
CommitTransactionCommand(true);
CommitTransactionCommand();
}
/* Tell xact.c not to chain the upcoming commit */
StartTransactionCommand(true);
StartTransactionCommand();
MemoryContextDelete(private_context);
}

View File

@ -13,7 +13,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.252 2003/05/02 20:54:33 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.253 2003/05/14 03:26:01 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -275,7 +275,7 @@ vacuum(VacuumStmt *vacstmt)
}
/* matches the StartTransaction in PostgresMain() */
CommitTransactionCommand(true);
CommitTransactionCommand();
}
/*
@ -303,7 +303,7 @@ vacuum(VacuumStmt *vacstmt)
*/
if (vacstmt->vacuum)
{
StartTransactionCommand(true);
StartTransactionCommand();
SetQuerySnapshot(); /* might be needed for functional index */
}
else
@ -312,7 +312,7 @@ vacuum(VacuumStmt *vacstmt)
analyze_rel(relid, vacstmt);
if (vacstmt->vacuum)
CommitTransactionCommand(true);
CommitTransactionCommand();
else
{
MemoryContextSwitchTo(old_context);
@ -330,11 +330,9 @@ vacuum(VacuumStmt *vacstmt)
/*
* This matches the CommitTransaction waiting for us in
* PostgresMain(). We tell xact.c not to chain the upcoming
* commit, so that a VACUUM doesn't start a transaction block,
* even when autocommit is off.
* PostgresMain().
*/
StartTransactionCommand(true);
StartTransactionCommand();
/*
* If it was a database-wide VACUUM, print FSM usage statistics
@ -729,7 +727,7 @@ vacuum_rel(Oid relid, VacuumStmt *vacstmt, char expected_relkind)
bool result;
/* Begin a transaction for vacuuming this relation */
StartTransactionCommand(true);
StartTransactionCommand();
SetQuerySnapshot(); /* might be needed for functional index */
/*
@ -746,7 +744,7 @@ vacuum_rel(Oid relid, VacuumStmt *vacstmt, char expected_relkind)
ObjectIdGetDatum(relid),
0, 0, 0))
{
CommitTransactionCommand(true);
CommitTransactionCommand();
return true; /* okay 'cause no data there */
}
@ -778,7 +776,7 @@ vacuum_rel(Oid relid, VacuumStmt *vacstmt, char expected_relkind)
elog(WARNING, "Skipping \"%s\" --- only table or database owner can VACUUM it",
RelationGetRelationName(onerel));
relation_close(onerel, lmode);
CommitTransactionCommand(true);
CommitTransactionCommand();
return false;
}
@ -791,7 +789,7 @@ vacuum_rel(Oid relid, VacuumStmt *vacstmt, char expected_relkind)
elog(WARNING, "Skipping \"%s\" --- can not process indexes, views or special system tables",
RelationGetRelationName(onerel));
relation_close(onerel, lmode);
CommitTransactionCommand(true);
CommitTransactionCommand();
return false;
}
@ -805,7 +803,7 @@ vacuum_rel(Oid relid, VacuumStmt *vacstmt, char expected_relkind)
if (isOtherTempNamespace(RelationGetNamespace(onerel)))
{
relation_close(onerel, lmode);
CommitTransactionCommand(true);
CommitTransactionCommand();
return true; /* assume no long-lived data in temp tables */
}
@ -843,7 +841,7 @@ vacuum_rel(Oid relid, VacuumStmt *vacstmt, char expected_relkind)
/*
* Complete the transaction and free all temporary memory used.
*/
CommitTransactionCommand(true);
CommitTransactionCommand();
/*
* If the relation has a secondary toast rel, vacuum that too while we

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.343 2003/05/12 16:48:17 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.344 2003/05/14 03:26:01 tgl Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
@ -85,8 +85,6 @@ sigjmp_buf Warn_restart;
bool Warn_restart_ready = false;
bool InError = false;
extern bool autocommit;
/*
* Flags for expensive function optimization -- JMH 3/9/92
*/
@ -148,7 +146,7 @@ static int InteractiveBackend(StringInfo inBuf);
static int SocketBackend(StringInfo inBuf);
static int ReadCommand(StringInfo inBuf);
static void start_xact_command(void);
static void finish_xact_command(bool forceCommit);
static void finish_xact_command(void);
static void SigHupHandler(SIGNAL_ARGS);
static void FloatExceptionHandler(SIGNAL_ARGS);
@ -861,20 +859,15 @@ exec_simple_query(const char *query_string)
PortalDrop(portal, false);
if (IsA(parsetree, TransactionStmt) ||
IsA(parsetree, VariableSetStmt) ||
IsA(parsetree, VariableShowStmt) ||
IsA(parsetree, VariableResetStmt))
if (IsA(parsetree, TransactionStmt))
{
/*
* If this was a transaction control statement or a variable
* set/show/reset statement, commit it. We will start a
* new xact command for the next command (if any).
* If this was a transaction control statement, commit it.
* We will start a new xact command for the next command (if any).
*/
finish_xact_command(true);
finish_xact_command();
}
else if (lnext(parsetree_item) == NIL || !autocommit)
else if (lnext(parsetree_item) == NIL)
{
/*
* If this is the last parsetree of the query string, close down
@ -886,7 +879,7 @@ exec_simple_query(const char *query_string)
* historical Postgres behavior, we do not force a transaction
* boundary between queries appearing in a single query string.
*/
finish_xact_command(false);
finish_xact_command();
}
else
{
@ -907,6 +900,11 @@ exec_simple_query(const char *query_string)
EndCommand(completionTag, dest);
} /* end loop over parsetrees */
/*
* Close down transaction statement, if one is open.
*/
finish_xact_command();
/*
* If there were no parsetrees, return EmptyQueryResponse message.
*/
@ -915,11 +913,6 @@ exec_simple_query(const char *query_string)
QueryContext = NULL;
/*
* Close down transaction statement, if one is open.
*/
finish_xact_command(false);
/*
* Finish up monitoring.
*/
@ -1531,7 +1524,7 @@ exec_execute_message(const char *portal_name, long max_rows)
* If this was a transaction control statement, commit it. We will
* start a new xact command for the next command (if any).
*/
finish_xact_command(true);
finish_xact_command();
}
else
{
@ -1657,7 +1650,7 @@ start_xact_command(void)
if (!xact_started)
{
elog(DEBUG2, "StartTransactionCommand");
StartTransactionCommand(false);
StartTransactionCommand();
/* Set statement timeout running, if any */
if (StatementTimeout > 0)
@ -1668,7 +1661,7 @@ start_xact_command(void)
}
static void
finish_xact_command(bool forceCommit)
finish_xact_command(void)
{
if (xact_started)
{
@ -1681,7 +1674,7 @@ finish_xact_command(bool forceCommit)
/* Now commit the command */
elog(DEBUG2, "CommitTransactionCommand");
CommitTransactionCommand(forceCommit);
CommitTransactionCommand();
#ifdef SHOW_MEMORY_STATS
/* Print mem stats at each commit for leak tracking */
@ -2532,7 +2525,7 @@ PostgresMain(int argc, char *argv[], const char *username)
if (!IsUnderPostmaster)
{
puts("\nPOSTGRES backend interactive interface ");
puts("$Revision: 1.343 $ $Date: 2003/05/12 16:48:17 $\n");
puts("$Revision: 1.344 $ $Date: 2003/05/14 03:26:01 $\n");
}
/*
@ -2810,7 +2803,7 @@ PostgresMain(int argc, char *argv[], const char *username)
}
/* commit the function-invocation transaction */
finish_xact_command(false);
finish_xact_command();
send_rfq = true;
break;
@ -2894,7 +2887,7 @@ PostgresMain(int argc, char *argv[], const char *username)
case 'S': /* sync */
pq_getmsgend(input_message);
finish_xact_command(false);
finish_xact_command();
send_rfq = true;
break;

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.120 2003/04/25 19:45:08 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.121 2003/05/14 03:26:02 tgl Exp $
*
*
*-------------------------------------------------------------------------
@ -334,7 +334,7 @@ InitPostgres(const char *dbname, const char *username)
/* start a new transaction here before access to db */
if (!bootstrap)
StartTransactionCommand(true);
StartTransactionCommand();
/*
* It's now possible to do real access to the system catalogs.
@ -420,7 +420,7 @@ InitPostgres(const char *dbname, const char *username)
/* close the transaction we started above */
if (!bootstrap)
CommitTransactionCommand(true);
CommitTransactionCommand();
}
/*

View File

@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.123 2003/05/06 20:26:27 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.124 2003/05/14 03:26:02 tgl Exp $
*
*--------------------------------------------------------------------
*/
@ -69,7 +69,6 @@ extern bool Log_connections;
extern int PreAuthDelay;
extern int AuthenticationTimeout;
extern int CheckPointTimeout;
extern bool autocommit;
extern int CommitDelay;
extern int CommitSiblings;
extern char *preload_libraries_string;
@ -92,6 +91,7 @@ static const char *assign_min_error_statement(const char *newval, bool doit,
bool interactive);
static const char *assign_msglvl(int *var, const char *newval,
bool doit, bool interactive);
static bool assign_phony_autocommit(bool newval, bool doit, bool interactive);
/*
@ -134,6 +134,7 @@ int client_min_messages = NOTICE;
static char *log_min_error_statement_str;
static char *log_min_messages_str;
static char *client_min_messages_str;
static bool phony_autocommit;
static double phony_random_seed;
static char *client_encoding_string;
static char *datestyle_string;
@ -526,8 +527,12 @@ static struct config_bool
false, NULL, NULL
},
{
{"autocommit", PGC_USERSET}, &autocommit,
true, NULL, NULL
/*
* This var doesn't do anything; it's just here so that we won't
* choke on SET AUTOCOMMIT TO ON from 7.3-vintage clients.
*/
{"autocommit", PGC_USERSET, GUC_NO_SHOW_ALL}, &phony_autocommit,
true, assign_phony_autocommit, NULL
},
{
{"default_transaction_read_only", PGC_USERSET}, &DefaultXactReadOnly,
@ -3429,6 +3434,18 @@ assign_msglvl(int *var, const char *newval, bool doit, bool interactive)
return newval; /* OK */
}
static bool
assign_phony_autocommit(bool newval, bool doit, bool interactive)
{
if (!newval)
{
if (doit && interactive)
elog(ERROR, "SET AUTOCOMMIT TO OFF is no longer supported");
return false;
}
return true;
}
#include "guc-file.c"

View File

@ -198,7 +198,6 @@
#
# Misc
#
#autocommit = true
#dynamic_library_path = '$libdir'
#search_path = '$user,public' # schema names
#datestyle = 'iso, us'

View File

@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.71 2003/05/03 22:18:59 tgl Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.72 2003/05/14 03:26:02 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -206,7 +206,6 @@ RestoreArchive(Archive *AHX, RestoreOptions *ropt)
sav = SetOutput(AH, ropt->filename, ropt->compression);
ahprintf(AH, "--\n-- PostgreSQL database dump\n--\n\n");
ahprintf(AH, "SET autocommit TO 'on';\n\n");
/*
* Drop the items at the start, in reverse order
@ -2122,7 +2121,6 @@ _reconnectAsUser(ArchiveHandle *AH, const char *dbname, const char *user)
dbname ? fmtId(dbname) : "-");
appendPQExpBuffer(qry, " %s\n\n",
fmtId(user));
appendPQExpBuffer(qry, "SET autocommit TO 'on';\n\n");
ahprintf(AH, qry->data);

View File

@ -5,7 +5,7 @@
* Implements the basic DB functions used by the archiver.
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.46 2003/02/14 19:40:42 momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.47 2003/05/14 03:26:02 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -61,12 +61,7 @@ _check_database_version(ArchiveHandle *AH, bool ignoreVersion)
myversion = _parse_version(AH, PG_VERSION);
/*
* Autocommit could be off. We turn it on later but we have to check
* the database version first.
*/
res = PQexec(conn, "BEGIN;SELECT version();");
res = PQexec(conn, "SELECT version();");
if (!res ||
PQresultStatus(res) != PGRES_TUPLES_OK ||
PQntuples(res) != 1)
@ -77,12 +72,6 @@ _check_database_version(ArchiveHandle *AH, bool ignoreVersion)
PQclear(res);
res = PQexec(conn, "COMMIT;");
if (!res ||
PQresultStatus(res) != PGRES_COMMAND_OK)
die_horribly(AH, modulename, "could not get version from server: %s", PQerrorMessage(conn));
PQclear(res);
AH->public.remoteVersion = remoteversion;
if (myversion != remoteversion
@ -216,18 +205,6 @@ _connectDB(ArchiveHandle *AH, const char *reqdb, const char *requser)
/* check for version mismatch */
_check_database_version(AH, true);
/* Turn autocommit on */
if (AH->public.remoteVersion >= 70300)
{
PGresult *res;
res = PQexec(AH->connection, "SET autocommit TO 'on'");
if (!res || PQresultStatus(res) != PGRES_COMMAND_OK)
die_horribly(AH, NULL, "SET autocommit TO 'on' failed: %s",
PQerrorMessage(AH->connection));
PQclear(res);
}
PQsetNoticeProcessor(newConn, notice_processor, NULL);
return newConn;
@ -301,18 +278,6 @@ ConnectDatabase(Archive *AHX,
/* check for version mismatch */
_check_database_version(AH, ignoreVersion);
/* Turn autocommit on */
if (AH->public.remoteVersion >= 70300)
{
PGresult *res;
res = PQexec(AH->connection, "SET autocommit TO 'on'");
if (!res || PQresultStatus(res) != PGRES_COMMAND_OK)
die_horribly(AH, NULL, "SET autocommit TO 'on' failed: %s",
PQerrorMessage(AH->connection));
PQclear(res);
}
PQsetNoticeProcessor(AH->connection, notice_processor, NULL);
return AH->connection;

View File

@ -6,7 +6,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.17 2003/04/04 20:42:12 momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dumpall.c,v 1.18 2003/05/14 03:26:02 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -188,7 +188,6 @@ main(int argc, char *argv[])
printf("-- PostgreSQL database cluster dump\n");
printf("--\n\n");
printf("\\connect \"template1\"\n\n");
printf("SET autocommit TO 'on';\n\n");
dumpUsers(conn);
dumpGroups(conn);
@ -550,8 +549,7 @@ dumpDatabases(PGconn *conn)
if (verbose)
fprintf(stderr, _("%s: dumping database \"%s\"...\n"), progname, dbname);
printf("\\connect %s\n", fmtId(dbname));
printf("SET autocommit TO 'on';\n\n");
printf("\\connect %s\n\n", fmtId(dbname));
ret = runPgDump(dbname);
if (ret != 0)
{
@ -677,14 +675,6 @@ connectDatabase(const char *dbname, const char *pghost, const char *pgport,
}
PQclear(res);
if (server_version >= 70300)
{
PGresult *res;
res = executeQuery(conn, "SET autocommit TO 'on';SELECT 1;");
PQclear(res);
}
return conn;
}

View File

@ -3,7 +3,7 @@
*
* Copyright 2000-2002 by PostgreSQL Global Development Group
*
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.95 2003/04/04 20:40:45 momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.96 2003/05/14 03:26:02 tgl Exp $
*/
#include "postgres_fe.h"
#include "command.h"
@ -1460,12 +1460,8 @@ test_superuser(const char *username)
if (!username)
return false;
/*
* Use begin/commit to avoid starting a transaction block if server
* has autocommit off by default.
*/
initPQExpBuffer(&buf);
printfPQExpBuffer(&buf, "BEGIN; SELECT usesuper FROM pg_catalog.pg_user WHERE usename = '%s'; COMMIT", username);
printfPQExpBuffer(&buf, "SELECT usesuper FROM pg_catalog.pg_user WHERE usename = '%s'", username);
res = PSQLexec(buf.data, true);
termPQExpBuffer(&buf);

View File

@ -3,7 +3,7 @@
*
* Copyright 2000-2002 by PostgreSQL Global Development Group
*
* $Header: /cvsroot/pgsql/src/bin/psql/tab-complete.c,v 1.76 2003/04/03 20:18:16 tgl Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/tab-complete.c,v 1.77 2003/05/14 03:26:02 tgl Exp $
*/
/*----------------------------------------------------------------------
@ -493,7 +493,6 @@ psql_completion(char *text, int start, int end)
* backend/utils/misc/guc.c.
*/
"australian_timezones",
"autocommit",
"client_encoding",
"client_min_messages",
"commit_delay",

View File

@ -11,7 +11,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/clusterdb,v 1.10 2003/03/20 18:53:18 momjian Exp $
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/clusterdb,v 1.11 2003/05/14 03:26:03 tgl Exp $
#
#-------------------------------------------------------------------------
@ -157,10 +157,10 @@ for db in $dbname
do
[ "$alldb" ] && echo "Clustering $db"
if [ -z "$table" ]; then
${PATHNAME}psql $PSQLOPT $ECHOOPT -c "SET autocommit TO 'on';CLUSTER" -d $db
${PATHNAME}psql $PSQLOPT $ECHOOPT -c "CLUSTER" -d $db
[ "$?" -ne 0 ] && exit 1
else
${PATHNAME}psql $PSQLOPT $ECHOOPT -c "SET autocommit TO 'on';CLUSTER $table" -d $db
${PATHNAME}psql $PSQLOPT $ECHOOPT -c "CLUSTER $table" -d $db
[ "$?" -ne 0 ] && exit 1
fi
done

View File

@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Header: /cvsroot/pgsql/src/bin/scripts/createdb.c,v 1.1 2003/03/18 22:19:46 petere Exp $
* $Header: /cvsroot/pgsql/src/bin/scripts/createdb.c,v 1.2 2003/05/14 03:26:03 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -143,7 +143,7 @@ main(int argc, char *argv[])
initPQExpBuffer(&sql);
appendPQExpBuffer(&sql, "SET autocommit TO on;\nCREATE DATABASE %s",
appendPQExpBuffer(&sql, "CREATE DATABASE %s",
fmtId(dbname));
if (owner)
@ -181,7 +181,7 @@ main(int argc, char *argv[])
if (comment)
{
printfPQExpBuffer(&sql, "SET autocommit TO on;\nCOMMENT ON DATABASE %s IS ", fmtId(dbname));
printfPQExpBuffer(&sql, "COMMENT ON DATABASE %s IS ", fmtId(dbname));
appendStringLiteral(&sql, comment, false);
appendPQExpBuffer(&sql, ";\n");

View File

@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Header: /cvsroot/pgsql/src/bin/scripts/createlang.c,v 1.1 2003/03/18 22:19:46 petere Exp $
* $Header: /cvsroot/pgsql/src/bin/scripts/createlang.c,v 1.2 2003/05/14 03:26:03 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -237,7 +237,7 @@ main(int argc, char *argv[])
/*
* Create the call handler and the language
*/
printfPQExpBuffer(&sql, "SET autocommit TO on;\n");
resetPQExpBuffer(&sql);
if (!handlerexists)
appendPQExpBuffer(&sql,

View File

@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Header: /cvsroot/pgsql/src/bin/scripts/createuser.c,v 1.1 2003/03/18 22:19:46 petere Exp $
* $Header: /cvsroot/pgsql/src/bin/scripts/createuser.c,v 1.2 2003/05/14 03:26:03 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -185,7 +185,7 @@ main(int argc, char *argv[])
initPQExpBuffer(&sql);
printfPQExpBuffer(&sql, "SET autocommit TO on;\nCREATE USER %s", fmtId(newuser));
printfPQExpBuffer(&sql, "CREATE USER %s", fmtId(newuser));
if (sysid)
appendPQExpBuffer(&sql, " SYSID %s", sysid);
if (encrypted == +1)

View File

@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Header: /cvsroot/pgsql/src/bin/scripts/dropdb.c,v 1.1 2003/03/18 22:19:46 petere Exp $
* $Header: /cvsroot/pgsql/src/bin/scripts/dropdb.c,v 1.2 2003/05/14 03:26:03 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -113,7 +113,7 @@ main(int argc, char *argv[])
initPQExpBuffer(&sql);
appendPQExpBuffer(&sql, "SET autocommit TO on;\nDROP DATABASE %s;\n",
appendPQExpBuffer(&sql, "DROP DATABASE %s;\n",
fmtId(dbname));
conn = connectDatabase("template1", host, port, username, password, progname);

View File

@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Header: /cvsroot/pgsql/src/bin/scripts/droplang.c,v 1.1 2003/03/18 22:19:47 petere Exp $
* $Header: /cvsroot/pgsql/src/bin/scripts/droplang.c,v 1.2 2003/05/14 03:26:03 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -215,8 +215,7 @@ main(int argc, char *argv[])
/*
* Drop the language
*/
printfPQExpBuffer(&sql, "SET autocommit TO on;\n");
appendPQExpBuffer(&sql, "DROP LANGUAGE \"%s\";\n", langname);
printfPQExpBuffer(&sql, "DROP LANGUAGE \"%s\";\n", langname);
if (!keephandler)
appendPQExpBuffer(&sql, "DROP FUNCTION \"%s\" ();\n", handler);
if (echo)

View File

@ -5,7 +5,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Header: /cvsroot/pgsql/src/bin/scripts/dropuser.c,v 1.1 2003/03/18 22:19:47 petere Exp $
* $Header: /cvsroot/pgsql/src/bin/scripts/dropuser.c,v 1.2 2003/05/14 03:26:03 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -113,7 +113,7 @@ main(int argc, char *argv[])
}
initPQExpBuffer(&sql);
appendPQExpBuffer(&sql, "SET autocommit TO on;\nDROP USER %s;\n", fmtId(dropuser));
appendPQExpBuffer(&sql, "DROP USER %s;\n", fmtId(dropuser));
conn = connectDatabase("template1", host, port, username, password, progname);

View File

@ -12,7 +12,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/vacuumdb,v 1.26 2002/10/18 22:05:36 petere Exp $
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/vacuumdb,v 1.27 2003/05/14 03:26:03 tgl Exp $
#
#-------------------------------------------------------------------------
@ -172,7 +172,7 @@ fi
for db in $dbname
do
[ "$alldb" -a "$quiet" -ne 1 ] && echo "Vacuuming $db"
${PATHNAME}psql $PSQLOPT $ECHOOPT -c "SET autocommit TO 'on';VACUUM $full $verbose $analyze $table" -d $db
${PATHNAME}psql $PSQLOPT $ECHOOPT -c "VACUUM $full $verbose $analyze $table" -d $db
if [ "$?" -ne 0 ]; then
echo "$CMDNAME: vacuum $table $db failed" 1>&2
exit 1

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: xact.h,v 1.51 2003/05/12 23:08:50 tgl Exp $
* $Id: xact.h,v 1.52 2003/05/14 03:26:03 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -119,8 +119,8 @@ extern AbsoluteTime GetCurrentTransactionStartTimeUsec(int *usec);
extern bool TransactionIdIsCurrentTransactionId(TransactionId xid);
extern bool CommandIdIsCurrentCommandId(CommandId cid);
extern void CommandCounterIncrement(void);
extern void StartTransactionCommand(bool preventChain);
extern void CommitTransactionCommand(bool forceCommit);
extern void StartTransactionCommand(void);
extern void CommitTransactionCommand(void);
extern void AbortCurrentTransaction(void);
extern void BeginTransactionBlock(void);
extern void EndTransactionBlock(void);

View File

@ -996,7 +996,6 @@ ERROR: Relation "test" has no column "........pg.dropped.1........"
copy test from stdin;
ERROR: Extra data after last expected column
CONTEXT: COPY FROM, line 1
SET autocommit TO 'on';
select * from test;
b | c
---+---

View File

@ -46,7 +46,6 @@ CONTEXT: COPY FROM, line 1
COPY x from stdin;
ERROR: Extra data after last expected column
CONTEXT: COPY FROM, line 1
SET autocommit TO 'on';
-- various COPY options: delimiters, oids, NULL string
COPY x (b, c, d, e) from stdin with oids delimiter ',' null 'x';
-- check results of copy in

View File

@ -41,7 +41,6 @@ INSERT INTO basictest values ('88', 'haha', 'short', '123.1212'); -- Truncate
COPY basictest (testvarchar) FROM stdin; -- fail
ERROR: value too long for type character varying(5)
CONTEXT: COPY FROM, line 1
SET autocommit TO 'on';
COPY basictest (testvarchar) FROM stdin;
select * from basictest;
testint4 | testtext | testvarchar | testnumeric
@ -129,7 +128,6 @@ INSERT INTO nulltest values ('a', 'b', 'c', NULL, 'd'); -- Good
COPY nulltest FROM stdin; --fail
ERROR: Domain dcheck does not allow NULL values
CONTEXT: COPY FROM, line 1
SET autocommit TO 'on';
-- Last row is bad
COPY nulltest FROM stdin;
ERROR: CopyFrom: rejected due to CHECK constraint "nulltest_col5" on "nulltest"

View File

@ -105,6 +105,14 @@ WHERE ambulkdelete != 0 AND
------+--------------
(0 rows)
SELECT ctid, amvacuumcleanup
FROM pg_catalog.pg_am fk
WHERE amvacuumcleanup != 0 AND
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_proc pk WHERE pk.oid = fk.amvacuumcleanup);
ctid | amvacuumcleanup
------+-----------------
(0 rows)
SELECT ctid, amcostestimate
FROM pg_catalog.pg_am fk
WHERE amcostestimate != 0 AND
@ -225,6 +233,22 @@ WHERE reltoastidxid != 0 AND
------+---------------
(0 rows)
SELECT ctid, connamespace
FROM pg_catalog.pg_constraint fk
WHERE connamespace != 0 AND
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_namespace pk WHERE pk.oid = fk.connamespace);
ctid | connamespace
------+--------------
(0 rows)
SELECT ctid, contypid
FROM pg_catalog.pg_constraint fk
WHERE contypid != 0 AND
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_type pk WHERE pk.oid = fk.contypid);
ctid | contypid
------+----------
(0 rows)
SELECT ctid, connamespace
FROM pg_catalog.pg_conversion fk
WHERE connamespace != 0 AND
@ -553,3 +577,11 @@ WHERE typsend != 0 AND
------+---------
(0 rows)
SELECT ctid, typbasetype
FROM pg_catalog.pg_type fk
WHERE typbasetype != 0 AND
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_type pk WHERE pk.oid = fk.typbasetype);
ctid | typbasetype
------+-------------
(0 rows)

View File

@ -220,7 +220,6 @@ ERROR: atest2: permission denied
-- privileges on functions, languages
-- switch to superuser
\c -
SET autocommit TO 'on';
REVOKE ALL PRIVILEGES ON LANGUAGE sql FROM PUBLIC;
GRANT USAGE ON LANGUAGE sql TO regressuser1; -- ok
GRANT USAGE ON LANGUAGE c TO PUBLIC; -- fail
@ -271,7 +270,6 @@ SELECT testfunc1(5); -- ok
DROP FUNCTION testfunc1(int); -- fail
ERROR: testfunc1: must be owner
\c -
SET autocommit TO 'on';
DROP FUNCTION testfunc1(int); -- ok
-- restore to sanity
GRANT ALL PRIVILEGES ON LANGUAGE sql TO PUBLIC;
@ -295,7 +293,6 @@ select has_table_privilege(1,'rule');
ERROR: pg_class_aclcheck: relation 1 not found
-- superuser
\c -
SET autocommit TO 'on';
select has_table_privilege(current_user,'pg_shadow','select');
has_table_privilege
---------------------
@ -586,7 +583,6 @@ SELECT has_table_privilege('regressuser1', 'atest4', 'SELECT WITH GRANT OPTION')
-- clean up
\c regression
SET autocommit TO 'on';
DROP FUNCTION testfunc2(int);
DROP FUNCTION testfunc4(boolean);
DROP VIEW atestv1;

View File

@ -43,7 +43,6 @@ DROP TABLE temptest;
-- test temp table deletion
CREATE TEMP TABLE temptest(col int);
\c regression
SET autocommit TO 'on';
SELECT * FROM temptest;
ERROR: Relation "temptest" does not exist
-- Test ON COMMIT DELETE ROWS

View File

@ -1,5 +1,5 @@
#! /bin/sh
# $Header: /cvsroot/pgsql/src/test/regress/Attic/pg_regress.sh,v 1.30 2003/04/28 04:29:12 tgl Exp $
# $Header: /cvsroot/pgsql/src/test/regress/Attic/pg_regress.sh,v 1.31 2003/05/14 03:26:03 tgl Exp $
me=`basename $0`
: ${TMPDIR=/tmp}
@ -477,7 +477,7 @@ fi
# ----------
message "dropping regression test user accounts"
"$bindir/psql" $psql_options -c 'SET autocommit TO on;DROP GROUP regressgroup1; DROP GROUP regressgroup2; DROP USER regressuser1, regressuser2, regressuser3, regressuser4;' $dbname 2>/dev/null
"$bindir/psql" $psql_options -c 'DROP GROUP regressgroup1; DROP GROUP regressgroup2; DROP USER regressuser1, regressuser2, regressuser3, regressuser4;' $dbname 2>/dev/null
if [ $? -eq 2 ]; then
echo "$me: could not drop user accounts"
(exit 2); exit
@ -550,7 +550,6 @@ do
$ECHO_N "test $formatted ... $ECHO_C"
(cat <<EOF
SET autocommit TO 'on';
\\set ECHO all
EOF
cat "$inputdir/sql/$1.sql") | \
@ -561,7 +560,6 @@ EOF
for name do
(
(cat <<EOF
SET autocommit TO 'on';
\\set ECHO all
EOF
cat "$inputdir/sql/$name.sql") | \

View File

@ -717,7 +717,6 @@ copy test("........pg.dropped.1........") to stdout;
copy test from stdin;
10 11 12
\.
SET autocommit TO 'on';
select * from test;
copy test from stdin;
21 22

View File

@ -71,7 +71,6 @@ COPY x from stdin;
2002 232 40 50 60 70 80
\.
SET autocommit TO 'on';
-- various COPY options: delimiters, oids, NULL string
COPY x (b, c, d, e) from stdin with oids delimiter ',' null 'x';
500000,x,45,80,90

View File

@ -41,8 +41,6 @@ COPY basictest (testvarchar) FROM stdin; -- fail
notsoshorttext
\.
SET autocommit TO 'on';
COPY basictest (testvarchar) FROM stdin;
short
\.
@ -106,8 +104,6 @@ COPY nulltest FROM stdin; --fail
a b \N d \N
\.
SET autocommit TO 'on';
-- Last row is bad
COPY nulltest FROM stdin;
a b c \N c

View File

@ -53,6 +53,10 @@ SELECT ctid, ambulkdelete
FROM pg_catalog.pg_am fk
WHERE ambulkdelete != 0 AND
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_proc pk WHERE pk.oid = fk.ambulkdelete);
SELECT ctid, amvacuumcleanup
FROM pg_catalog.pg_am fk
WHERE amvacuumcleanup != 0 AND
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_proc pk WHERE pk.oid = fk.amvacuumcleanup);
SELECT ctid, amcostestimate
FROM pg_catalog.pg_am fk
WHERE amcostestimate != 0 AND
@ -114,6 +118,14 @@ FROM pg_catalog.pg_class fk
WHERE reltoastidxid != 0 AND
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_class pk WHERE pk.oid = fk.reltoastidxid);
SELECT ctid, connamespace
FROM pg_catalog.pg_constraint fk
WHERE connamespace != 0 AND
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_namespace pk WHERE pk.oid = fk.connamespace);
SELECT ctid, contypid
FROM pg_catalog.pg_constraint fk
WHERE contypid != 0 AND
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_type pk WHERE pk.oid = fk.contypid);
SELECT ctid, connamespace
FROM pg_catalog.pg_conversion fk
WHERE connamespace != 0 AND
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_namespace pk WHERE pk.oid = fk.connamespace);
@ -277,3 +289,7 @@ SELECT ctid, typsend
FROM pg_catalog.pg_type fk
WHERE typsend != 0 AND
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_proc pk WHERE pk.oid = fk.typsend);
SELECT ctid, typbasetype
FROM pg_catalog.pg_type fk
WHERE typbasetype != 0 AND
NOT EXISTS(SELECT 1 FROM pg_catalog.pg_type pk WHERE pk.oid = fk.typbasetype);

View File

@ -147,7 +147,6 @@ SELECT * FROM atestv2; -- fail (even though regressuser2 can access underlying a
-- switch to superuser
\c -
SET autocommit TO 'on';
REVOKE ALL PRIVILEGES ON LANGUAGE sql FROM PUBLIC;
GRANT USAGE ON LANGUAGE sql TO regressuser1; -- ok
@ -184,7 +183,6 @@ SELECT testfunc1(5); -- ok
DROP FUNCTION testfunc1(int); -- fail
\c -
SET autocommit TO 'on';
DROP FUNCTION testfunc1(int); -- ok
-- restore to sanity
@ -203,7 +201,6 @@ select has_table_privilege(1,'rule');
-- superuser
\c -
SET autocommit TO 'on';
select has_table_privilege(current_user,'pg_shadow','select');
select has_table_privilege(current_user,'pg_shadow','insert');
@ -323,7 +320,6 @@ SELECT has_table_privilege('regressuser1', 'atest4', 'SELECT WITH GRANT OPTION')
-- clean up
\c regression
SET autocommit TO 'on';
DROP FUNCTION testfunc2(int);
DROP FUNCTION testfunc4(boolean);

View File

@ -48,7 +48,6 @@ DROP TABLE temptest;
CREATE TEMP TABLE temptest(col int);
\c regression
SET autocommit TO 'on';
SELECT * FROM temptest;