mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-27 08:39:28 +08:00
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:
parent
47a4e2ed1c
commit
1e100176c4
25
src/test/regress/expected/update.out
Normal file
25
src/test/regress/expected/update.out
Normal 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;
|
@ -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
|
||||
|
@ -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
|
||||
|
19
src/test/regress/sql/update.sql
Normal file
19
src/test/regress/sql/update.sql
Normal 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;
|
Loading…
Reference in New Issue
Block a user