Skip to content
Snippets Groups Projects
Commit 1e100176 authored by Bruce Momjian's avatar Bruce Momjian
Browse files

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
parent 47a4e2ed
No related branches found
No related tags found
No related merge requests found
--
-- 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 ...@@ -60,7 +60,7 @@ ignore: random
# ---------- # ----------
# The fourth group of parallel test # 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: privileges
test: misc test: misc
......
# $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. # This should probably be in an order similar to parallel_schedule.
test: boolean test: boolean
test: char test: char
...@@ -72,6 +72,7 @@ test: portals ...@@ -72,6 +72,7 @@ test: portals
test: arrays test: arrays
test: btree_index test: btree_index
test: hash_index test: hash_index
test: update
test: privileges test: privileges
test: misc test: misc
test: select_views test: select_views
......
--
-- 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;
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment