This patch adds a new regression test for the UPDATE command. Right

now all that is tested is Rod Taylor's recent addition to allow
this syntax:

    UPDATE ... SET <col> = DEFAULT;

If anyone else would like to add more UPDATE tests, go ahead --
I just wanted to write a test for the above functionality, and
couldn't see an existing test that it would be appropriate
to add to.

Neil Conway
This commit is contained in:
Bruce Momjian 2003-08-26 18:32:23 +00:00
parent 47a4e2ed1c
commit 1e100176c4
4 changed files with 47 additions and 2 deletions

View File

@ -0,0 +1,25 @@
--
-- UPDATE ... SET <col> = DEFAULT;
--
CREATE TABLE update_test (
a INT DEFAULT 10,
b INT
);
INSERT INTO update_test VALUES (5, 10);
INSERT INTO update_test VALUES (10, 15);
SELECT * FROM update_test;
a | b
----+----
5 | 10
10 | 15
(2 rows)
UPDATE update_test SET a = DEFAULT, b = DEFAULT;
SELECT * FROM update_test;
a | b
----+---
10 |
10 |
(2 rows)
DROP TABLE update_test;

View File

@ -60,7 +60,7 @@ ignore: random
# ----------
# The fourth group of parallel test
# ----------
test: select_into select_distinct select_distinct_on select_implicit select_having subselect union case join aggregates transactions random portals arrays btree_index hash_index
test: select_into select_distinct select_distinct_on select_implicit select_having subselect union case join aggregates transactions random portals arrays btree_index hash_index update
test: privileges
test: misc

View File

@ -1,4 +1,4 @@
# $Header: /cvsroot/pgsql/src/test/regress/serial_schedule,v 1.20 2003/07/01 19:10:53 tgl Exp $
# $Header: /cvsroot/pgsql/src/test/regress/serial_schedule,v 1.21 2003/08/26 18:32:23 momjian Exp $
# This should probably be in an order similar to parallel_schedule.
test: boolean
test: char
@ -72,6 +72,7 @@ test: portals
test: arrays
test: btree_index
test: hash_index
test: update
test: privileges
test: misc
test: select_views

View File

@ -0,0 +1,19 @@
--
-- UPDATE ... SET <col> = DEFAULT;
--
CREATE TABLE update_test (
a INT DEFAULT 10,
b INT
);
INSERT INTO update_test VALUES (5, 10);
INSERT INTO update_test VALUES (10, 15);
SELECT * FROM update_test;
UPDATE update_test SET a = DEFAULT, b = DEFAULT;
SELECT * FROM update_test;
DROP TABLE update_test;