mirror of
https://github.com/postgres/postgres.git
synced 2025-12-07 12:02:30 +03:00
Reports missing values as bad.
BAD: INSERT INTO tab (col1, col2) VALUES ('val1');
GOOD: INSERT INTO tab (col1, col2) VALUES ('val1', 'val2');
Regress tests against DEFAULT and normal values as they're managed
slightly different.
Rod Taylor
This commit is contained in:
@@ -17,4 +17,24 @@ select * from inserttest;
|
||||
| 7 | testing
|
||||
(4 rows)
|
||||
|
||||
--
|
||||
-- insert with similar expression / target_list values (all fail)
|
||||
--
|
||||
insert into inserttest (col1, col2, col3) values (DEFAULT, DEFAULT);
|
||||
ERROR: INSERT has more target columns than expressions
|
||||
insert into inserttest (col1, col2, col3) values (1, 2);
|
||||
ERROR: INSERT has more target columns than expressions
|
||||
insert into inserttest (col1) values (1, 2);
|
||||
ERROR: INSERT has more expressions than target columns
|
||||
insert into inserttest (col1) values (DEFAULT, DEFAULT);
|
||||
ERROR: INSERT has more expressions than target columns
|
||||
select * from inserttest;
|
||||
col1 | col2 | col3
|
||||
------+------+---------
|
||||
| 3 | testing
|
||||
| 5 | testing
|
||||
| 5 | test
|
||||
| 7 | testing
|
||||
(4 rows)
|
||||
|
||||
drop table inserttest;
|
||||
|
||||
@@ -8,5 +8,15 @@ insert into inserttest (col1, col2, col3) values (DEFAULT, 5, DEFAULT);
|
||||
insert into inserttest values (DEFAULT, 5, 'test');
|
||||
insert into inserttest values (DEFAULT, 7);
|
||||
|
||||
select * from inserttest;
|
||||
|
||||
--
|
||||
-- insert with similar expression / target_list values (all fail)
|
||||
--
|
||||
insert into inserttest (col1, col2, col3) values (DEFAULT, DEFAULT);
|
||||
insert into inserttest (col1, col2, col3) values (1, 2);
|
||||
insert into inserttest (col1) values (1, 2);
|
||||
insert into inserttest (col1) values (DEFAULT, DEFAULT);
|
||||
|
||||
select * from inserttest;
|
||||
drop table inserttest;
|
||||
|
||||
Reference in New Issue
Block a user