mirror of https://github.com/postgres/postgres
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 ConwayREL7_4_STABLE
parent
47a4e2ed1c
commit
1e100176c4
@ -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; |
@ -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