Add a simple regress test for SERIAL --- it's not much,
but it's better than no test at all...
This commit is contained in:
parent
37a71f90b2
commit
bf023bd162
@ -149,3 +149,22 @@ INSERT INTO iportaltest (i, d, p)
|
||||
VALUES (1, 3.567, '(3.0,1.0),(4.0,2.0)'::polygon);
|
||||
INSERT INTO iportaltest (i, d, p)
|
||||
VALUES (2, 89.05, '(4.0,2.0),(3.0,1.0)'::polygon);
|
||||
---
|
||||
--- test creation of SERIAL column
|
||||
---
|
||||
CREATE TABLE serialTest (f1 text, f2 serial);
|
||||
NOTICE: CREATE TABLE will create implicit sequence 'serialtest_f2_seq' for SERIAL column 'serialtest.f2'
|
||||
NOTICE: CREATE TABLE/UNIQUE will create implicit index 'serialtest_f2_key' for table 'serialtest'
|
||||
INSERT INTO serialTest VALUES ('foo');
|
||||
INSERT INTO serialTest VALUES ('bar');
|
||||
INSERT INTO serialTest VALUES ('force', 100);
|
||||
INSERT INTO serialTest VALUES ('wrong', NULL);
|
||||
ERROR: ExecAppend: Fail to add null value in not null attribute f2
|
||||
SELECT * FROM serialTest;
|
||||
f1 | f2
|
||||
-------+-----
|
||||
foo | 1
|
||||
bar | 2
|
||||
force | 100
|
||||
(3 rows)
|
||||
|
||||
|
@ -49,8 +49,9 @@ SELECT relname, relhasindex
|
||||
pg_trigger | t
|
||||
pg_type | t
|
||||
road | t
|
||||
serialtest | t
|
||||
shighway | t
|
||||
tenk1 | t
|
||||
tenk2 | t
|
||||
(43 rows)
|
||||
(44 rows)
|
||||
|
||||
|
@ -607,6 +607,8 @@ SELECT user_relns() AS user_relns
|
||||
real_city
|
||||
reltime_tbl
|
||||
road
|
||||
serialtest
|
||||
serialtest_f2_seq
|
||||
shighway
|
||||
slow_emp4000
|
||||
street
|
||||
@ -621,7 +623,7 @@ SELECT user_relns() AS user_relns
|
||||
toyemp
|
||||
varchar_tbl
|
||||
xacttest
|
||||
(84 rows)
|
||||
(86 rows)
|
||||
|
||||
--SELECT name(equipment(hobby_construct(text 'skywalking', text 'mer'))) AS equip_name;
|
||||
--
|
||||
|
@ -228,3 +228,16 @@ INSERT INTO iportaltest (i, d, p)
|
||||
INSERT INTO iportaltest (i, d, p)
|
||||
VALUES (2, 89.05, '(4.0,2.0),(3.0,1.0)'::polygon);
|
||||
|
||||
|
||||
---
|
||||
--- test creation of SERIAL column
|
||||
---
|
||||
|
||||
CREATE TABLE serialTest (f1 text, f2 serial);
|
||||
|
||||
INSERT INTO serialTest VALUES ('foo');
|
||||
INSERT INTO serialTest VALUES ('bar');
|
||||
INSERT INTO serialTest VALUES ('force', 100);
|
||||
INSERT INTO serialTest VALUES ('wrong', NULL);
|
||||
|
||||
SELECT * FROM serialTest;
|
||||
|
Loading…
x
Reference in New Issue
Block a user