Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc6c4177

Browse files
committed
Update alternative expected file for recent sequence test changes.
1 parent6aab24d commitc6c4177

File tree

1 file changed

+103
-5
lines changed

1 file changed

+103
-5
lines changed

‎src/test/regress/expected/sequence_1.out

Lines changed: 103 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,84 @@ SELECT * FROM serialTest;
1616
force | 100
1717
(3 rows)
1818

19+
-- test smallserial / bigserial
20+
CREATE TABLE serialTest2 (f1 text, f2 serial, f3 smallserial, f4 serial2,
21+
f5 bigserial, f6 serial8);
22+
NOTICE: CREATE TABLE will create implicit sequence "serialtest2_f2_seq" for serial column "serialtest2.f2"
23+
NOTICE: CREATE TABLE will create implicit sequence "serialtest2_f3_seq" for serial column "serialtest2.f3"
24+
NOTICE: CREATE TABLE will create implicit sequence "serialtest2_f4_seq" for serial column "serialtest2.f4"
25+
NOTICE: CREATE TABLE will create implicit sequence "serialtest2_f5_seq" for serial column "serialtest2.f5"
26+
NOTICE: CREATE TABLE will create implicit sequence "serialtest2_f6_seq" for serial column "serialtest2.f6"
27+
INSERT INTO serialTest2 (f1)
28+
VALUES ('test_defaults');
29+
INSERT INTO serialTest2 (f1, f2, f3, f4, f5, f6)
30+
VALUES ('test_max_vals', 2147483647, 32767, 32767, 9223372036854775807,
31+
9223372036854775807),
32+
('test_min_vals', -2147483648, -32768, -32768, -9223372036854775808,
33+
-9223372036854775808);
34+
-- All these INSERTs should fail:
35+
INSERT INTO serialTest2 (f1, f3)
36+
VALUES ('bogus', -32769);
37+
ERROR: smallint out of range
38+
INSERT INTO serialTest2 (f1, f4)
39+
VALUES ('bogus', -32769);
40+
ERROR: smallint out of range
41+
INSERT INTO serialTest2 (f1, f3)
42+
VALUES ('bogus', 32768);
43+
ERROR: smallint out of range
44+
INSERT INTO serialTest2 (f1, f4)
45+
VALUES ('bogus', 32768);
46+
ERROR: smallint out of range
47+
INSERT INTO serialTest2 (f1, f5)
48+
VALUES ('bogus', -9223372036854775809);
49+
ERROR: bigint out of range
50+
INSERT INTO serialTest2 (f1, f6)
51+
VALUES ('bogus', -9223372036854775809);
52+
ERROR: bigint out of range
53+
INSERT INTO serialTest2 (f1, f5)
54+
VALUES ('bogus', 9223372036854775808);
55+
ERROR: bigint out of range
56+
INSERT INTO serialTest2 (f1, f6)
57+
VALUES ('bogus', 9223372036854775808);
58+
ERROR: bigint out of range
59+
SELECT * FROM serialTest2 ORDER BY f2 ASC;
60+
f1 | f2 | f3 | f4 | f5 | f6
61+
---------------+-------------+--------+--------+----------------------+----------------------
62+
test_min_vals | -2147483648 | -32768 | -32768 | -9223372036854775808 | -9223372036854775808
63+
test_defaults | 1 | 1 | 1 | 1 | 1
64+
test_max_vals | 2147483647 | 32767 | 32767 | 9223372036854775807 | 9223372036854775807
65+
(3 rows)
66+
67+
SELECT nextval('serialTest2_f2_seq');
68+
nextval
69+
---------
70+
2
71+
(1 row)
72+
73+
SELECT nextval('serialTest2_f3_seq');
74+
nextval
75+
---------
76+
2
77+
(1 row)
78+
79+
SELECT nextval('serialTest2_f4_seq');
80+
nextval
81+
---------
82+
2
83+
(1 row)
84+
85+
SELECT nextval('serialTest2_f5_seq');
86+
nextval
87+
---------
88+
2
89+
(1 row)
90+
91+
SELECT nextval('serialTest2_f6_seq');
92+
nextval
93+
---------
94+
2
95+
(1 row)
96+
1997
-- basic sequence operations using both text and oid references
2098
CREATE SEQUENCE sequence_test;
2199
SELECT nextval('sequence_test'::text);
@@ -221,11 +299,19 @@ SELECT nextval('sequence_test2');
221299
(1 row)
222300

223301
-- Information schema
224-
SELECT * FROM information_schema.sequences WHERE sequence_name IN ('sequence_test2');
225-
sequence_catalog | sequence_schema | sequence_name | data_type | numeric_precision | numeric_precision_radix | numeric_scale | start_value | minimum_value | maximum_value | increment | cycle_option
226-
------------------+-----------------+----------------+-----------+-------------------+-------------------------+---------------+-------------+---------------+---------------+-----------+--------------
227-
regression | public | sequence_test2 | bigint | 64 | 2 | 0 | 32 | 5 | 36 | 4 | YES
228-
(1 row)
302+
SELECT * FROM information_schema.sequences WHERE sequence_name IN
303+
('sequence_test2', 'serialtest2_f2_seq', 'serialtest2_f3_seq',
304+
'serialtest2_f4_seq', 'serialtest2_f5_seq', 'serialtest2_f6_seq')
305+
ORDER BY sequence_name ASC;
306+
sequence_catalog | sequence_schema | sequence_name | data_type | numeric_precision | numeric_precision_radix | numeric_scale | start_value | minimum_value | maximum_value | increment | cycle_option
307+
------------------+-----------------+--------------------+-----------+-------------------+-------------------------+---------------+-------------+---------------+---------------------+-----------+--------------
308+
regression | public | sequence_test2 | bigint | 64 | 2 | 0 | 32 | 5 | 36 | 4 | YES
309+
regression | public | serialtest2_f2_seq | bigint | 64 | 2 | 0 | 1 | 1 | 9223372036854775807 | 1 | NO
310+
regression | public | serialtest2_f3_seq | bigint | 64 | 2 | 0 | 1 | 1 | 9223372036854775807 | 1 | NO
311+
regression | public | serialtest2_f4_seq | bigint | 64 | 2 | 0 | 1 | 1 | 9223372036854775807 | 1 | NO
312+
regression | public | serialtest2_f5_seq | bigint | 64 | 2 | 0 | 1 | 1 | 9223372036854775807 | 1 | NO
313+
regression | public | serialtest2_f6_seq | bigint | 64 | 2 | 0 | 1 | 1 | 9223372036854775807 | 1 | NO
314+
(6 rows)
229315

230316
-- Test comments
231317
COMMENT ON SEQUENCE asdf IS 'won''t work';
@@ -289,5 +375,17 @@ REVOKE ALL ON seq3 FROM seq_user;
289375
SELECT lastval();
290376
ERROR: permission denied for sequence seq3
291377
ROLLBACK;
378+
-- Sequences should get wiped out as well:
379+
DROP TABLE serialTest, serialTest2;
380+
-- Make sure sequences are gone:
381+
SELECT * FROM information_schema.sequences WHERE sequence_name IN
382+
('sequence_test2', 'serialtest2_f2_seq', 'serialtest2_f3_seq',
383+
'serialtest2_f4_seq', 'serialtest2_f5_seq', 'serialtest2_f6_seq')
384+
ORDER BY sequence_name ASC;
385+
sequence_catalog | sequence_schema | sequence_name | data_type | numeric_precision | numeric_precision_radix | numeric_scale | start_value | minimum_value | maximum_value | increment | cycle_option
386+
------------------+-----------------+----------------+-----------+-------------------+-------------------------+---------------+-------------+---------------+---------------+-----------+--------------
387+
regression | public | sequence_test2 | bigint | 64 | 2 | 0 | 32 | 5 | 36 | 4 | YES
388+
(1 row)
389+
292390
DROP USER seq_user;
293391
DROP SEQUENCE seq;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp