~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

Viewing changes to src/test/regress/expected/insert.out

  • Committer: alvherre
  • Date: 2005-12-16 21:24:52 UTC
  • Revision ID: svn-v4:db760fc0-0f08-0410-9d63-cc6633f64896:trunk:1
Initial import of the REL8_0_3 sources from the Pgsql CVS repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--
 
2
-- insert with DEFAULT in the target_list
 
3
--
 
4
create table inserttest (col1 int4, col2 int4 NOT NULL, col3 text default 'testing');
 
5
insert into inserttest (col1, col2, col3) values (DEFAULT, DEFAULT, DEFAULT);
 
6
ERROR:  null value in column "col2" violates not-null constraint
 
7
insert into inserttest (col2, col3) values (3, DEFAULT);
 
8
insert into inserttest (col1, col2, col3) values (DEFAULT, 5, DEFAULT);
 
9
insert into inserttest values (DEFAULT, 5, 'test');
 
10
insert into inserttest values (DEFAULT, 7);
 
11
select * from inserttest;
 
12
 col1 | col2 |  col3   
 
13
------+------+---------
 
14
      |    3 | testing
 
15
      |    5 | testing
 
16
      |    5 | test
 
17
      |    7 | testing
 
18
(4 rows)
 
19
 
 
20
--
 
21
-- insert with similar expression / target_list values (all fail)
 
22
--
 
23
insert into inserttest (col1, col2, col3) values (DEFAULT, DEFAULT);
 
24
ERROR:  INSERT has more target columns than expressions
 
25
insert into inserttest (col1, col2, col3) values (1, 2);
 
26
ERROR:  INSERT has more target columns than expressions
 
27
insert into inserttest (col1) values (1, 2);
 
28
ERROR:  INSERT has more expressions than target columns
 
29
insert into inserttest (col1) values (DEFAULT, DEFAULT);
 
30
ERROR:  INSERT has more expressions than target columns
 
31
select * from inserttest;
 
32
 col1 | col2 |  col3   
 
33
------+------+---------
 
34
      |    3 | testing
 
35
      |    5 | testing
 
36
      |    5 | test
 
37
      |    7 | testing
 
38
(4 rows)
 
39
 
 
40
drop table inserttest;