mirror of
https://github.com/postgres/postgres.git
synced 2025-12-12 02:37:31 +03:00
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:
@@ -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
|
||||
---+---
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -41,14 +41,13 @@ 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
|
||||
----------+----------+-------------+-------------
|
||||
88 | haha | short | 123.12
|
||||
88 | haha | short | 123.12
|
||||
| | short |
|
||||
88 | haha | short | 123.12
|
||||
88 | haha | short | 123.12
|
||||
| | short |
|
||||
(3 rows)
|
||||
|
||||
-- check that domains inherit operations from base types
|
||||
@@ -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"
|
||||
@@ -185,10 +183,10 @@ COPY defaulttest(col5) FROM stdin;
|
||||
select * from defaulttest;
|
||||
col1 | col2 | col3 | col4 | col5 | col6 | col7 | col8
|
||||
------+------+------+------+------+------+------+-------
|
||||
3 | 12 | 5 | 1 | 3 | 88 | 8000 | 12.12
|
||||
3 | 12 | 5 | 2 | 3 | 88 | 8000 | 12.12
|
||||
3 | 12 | 5 | 3 | 3 | 88 | 8000 | 12.12
|
||||
3 | 12 | 5 | 4 | 42 | 88 | 8000 | 12.12
|
||||
3 | 12 | 5 | 1 | 3 | 88 | 8000 | 12.12
|
||||
3 | 12 | 5 | 2 | 3 | 88 | 8000 | 12.12
|
||||
3 | 12 | 5 | 3 | 3 | 88 | 8000 | 12.12
|
||||
3 | 12 | 5 | 4 | 42 | 88 | 8000 | 12.12
|
||||
(4 rows)
|
||||
|
||||
drop sequence ddef4_seq;
|
||||
@@ -224,7 +222,7 @@ insert into domdeftest default values;
|
||||
select * from domdeftest;
|
||||
col1
|
||||
------
|
||||
3
|
||||
3
|
||||
(1 row)
|
||||
|
||||
alter domain ddef1 set default '42';
|
||||
@@ -232,8 +230,8 @@ insert into domdeftest default values;
|
||||
select * from domdeftest;
|
||||
col1
|
||||
------
|
||||
3
|
||||
42
|
||||
3
|
||||
42
|
||||
(2 rows)
|
||||
|
||||
alter domain ddef1 drop default;
|
||||
@@ -241,9 +239,9 @@ insert into domdeftest default values;
|
||||
select * from domdeftest;
|
||||
col1
|
||||
------
|
||||
3
|
||||
42
|
||||
|
||||
3
|
||||
42
|
||||
|
||||
(3 rows)
|
||||
|
||||
drop table domdeftest;
|
||||
@@ -274,8 +272,8 @@ insert into domtab (col1) values (5);
|
||||
select * from domview;
|
||||
col1
|
||||
------
|
||||
|
||||
5
|
||||
|
||||
5
|
||||
(2 rows)
|
||||
|
||||
alter domain dom set not null;
|
||||
@@ -285,8 +283,8 @@ alter domain dom drop not null;
|
||||
select * from domview;
|
||||
col1
|
||||
------
|
||||
|
||||
5
|
||||
|
||||
5
|
||||
(2 rows)
|
||||
|
||||
alter domain dom add constraint domchkgt6 check(value > 6);
|
||||
@@ -296,8 +294,8 @@ alter domain dom drop constraint domchkgt6 restrict;
|
||||
select * from domview;
|
||||
col1
|
||||
------
|
||||
|
||||
5
|
||||
|
||||
5
|
||||
(2 rows)
|
||||
|
||||
-- cleanup
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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") | \
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -48,7 +48,6 @@ DROP TABLE temptest;
|
||||
CREATE TEMP TABLE temptest(col int);
|
||||
|
||||
\c regression
|
||||
SET autocommit TO 'on';
|
||||
|
||||
SELECT * FROM temptest;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user