Fix sequence test in cs_CZ locale

Rename some objects so that sorted output becomes less locale-dependent.
This commit is contained in:
Peter Eisentraut 2017-01-30 13:28:28 -05:00
parent d711532b2e
commit 46aae5949f
2 changed files with 22 additions and 22 deletions

View File

@ -31,14 +31,14 @@ DROP TABLE sequence_test_table;
---
--- 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);
CREATE TABLE serialTest1 (f1 text, f2 serial);
INSERT INTO serialTest1 VALUES ('foo');
INSERT INTO serialTest1 VALUES ('bar');
INSERT INTO serialTest1 VALUES ('force', 100);
INSERT INTO serialTest1 VALUES ('wrong', NULL);
ERROR: null value in column "f2" violates not-null constraint
DETAIL: Failing row contains (wrong, null).
SELECT * FROM serialTest;
SELECT * FROM serialTest1;
f1 | f2
-------+-----
foo | 1
@ -230,9 +230,9 @@ SELECT last_value, log_cnt IN (31, 32) AS log_cnt_ok, is_called FROM foo_seq_new
DROP SEQUENCE foo_seq_new;
-- renaming serial sequences
ALTER TABLE serialtest_f2_seq RENAME TO serialtest_f2_foo;
INSERT INTO serialTest VALUES ('more');
SELECT * FROM serialTest;
ALTER TABLE serialtest1_f2_seq RENAME TO serialtest1_f2_foo;
INSERT INTO serialTest1 VALUES ('more');
SELECT * FROM serialTest1;
f1 | f2
-------+-----
foo | 1
@ -445,12 +445,12 @@ SELECT * FROM information_schema.sequences
regression | public | sequence_test2 | bigint | 64 | 2 | 0 | 32 | 5 | 36 | 4 | YES
regression | public | sequence_test3 | bigint | 64 | 2 | 0 | 1 | 1 | 9223372036854775807 | 1 | NO
regression | public | sequence_test4 | bigint | 64 | 2 | 0 | -1 | -9223372036854775808 | -1 | -1 | NO
regression | public | serialtest1_f2_foo | bigint | 64 | 2 | 0 | 1 | 1 | 9223372036854775807 | 1 | NO
regression | public | serialtest2_f2_seq | bigint | 64 | 2 | 0 | 1 | 1 | 9223372036854775807 | 1 | NO
regression | public | serialtest2_f3_seq | bigint | 64 | 2 | 0 | 1 | 1 | 9223372036854775807 | 1 | NO
regression | public | serialtest2_f4_seq | bigint | 64 | 2 | 0 | 1 | 1 | 9223372036854775807 | 1 | NO
regression | public | serialtest2_f5_seq | bigint | 64 | 2 | 0 | 1 | 1 | 9223372036854775807 | 1 | NO
regression | public | serialtest2_f6_seq | bigint | 64 | 2 | 0 | 1 | 1 | 9223372036854775807 | 1 | NO
regression | public | serialtest_f2_foo | bigint | 64 | 2 | 0 | 1 | 1 | 9223372036854775807 | 1 | NO
(9 rows)
SELECT schemaname, sequencename, start_value, min_value, max_value, increment_by, cycle, cache_size, last_value
@ -462,12 +462,12 @@ WHERE sequencename ~ ANY(ARRAY['sequence_test', 'serialtest'])
public | sequence_test2 | 32 | 5 | 36 | 4 | t | 1 | 5
public | sequence_test3 | 1 | 1 | 9223372036854775807 | 1 | f | 1 |
public | sequence_test4 | -1 | -9223372036854775808 | -1 | -1 | f | 1 | -1
public | serialtest1_f2_foo | 1 | 1 | 9223372036854775807 | 1 | f | 1 | 3
public | serialtest2_f2_seq | 1 | 1 | 9223372036854775807 | 1 | f | 1 | 2
public | serialtest2_f3_seq | 1 | 1 | 9223372036854775807 | 1 | f | 1 | 2
public | serialtest2_f4_seq | 1 | 1 | 9223372036854775807 | 1 | f | 1 | 2
public | serialtest2_f5_seq | 1 | 1 | 9223372036854775807 | 1 | f | 1 | 2
public | serialtest2_f6_seq | 1 | 1 | 9223372036854775807 | 1 | f | 1 | 2
public | serialtest_f2_foo | 1 | 1 | 9223372036854775807 | 1 | f | 1 | 3
(9 rows)
SELECT * FROM pg_sequence_parameters('sequence_test4'::regclass);
@ -716,7 +716,7 @@ ALTER SEQUENCE sequence_test2 START WITH 1;
ERROR: must be owner of relation sequence_test2
ROLLBACK;
-- Sequences should get wiped out as well:
DROP TABLE serialTest, serialTest2;
DROP TABLE serialTest1, serialTest2;
-- Make sure sequences are gone:
SELECT * FROM information_schema.sequences WHERE sequence_name IN
('sequence_test2', 'serialtest2_f2_seq', 'serialtest2_f3_seq',

View File

@ -23,14 +23,14 @@ DROP TABLE sequence_test_table;
--- test creation of SERIAL column
---
CREATE TABLE serialTest (f1 text, f2 serial);
CREATE TABLE serialTest1 (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);
INSERT INTO serialTest1 VALUES ('foo');
INSERT INTO serialTest1 VALUES ('bar');
INSERT INTO serialTest1 VALUES ('force', 100);
INSERT INTO serialTest1 VALUES ('wrong', NULL);
SELECT * FROM serialTest;
SELECT * FROM serialTest1;
-- test smallserial / bigserial
CREATE TABLE serialTest2 (f1 text, f2 serial, f3 smallserial, f4 serial2,
@ -111,9 +111,9 @@ SELECT last_value, log_cnt IN (31, 32) AS log_cnt_ok, is_called FROM foo_seq_new
DROP SEQUENCE foo_seq_new;
-- renaming serial sequences
ALTER TABLE serialtest_f2_seq RENAME TO serialtest_f2_foo;
INSERT INTO serialTest VALUES ('more');
SELECT * FROM serialTest;
ALTER TABLE serialtest1_f2_seq RENAME TO serialtest1_f2_foo;
INSERT INTO serialTest1 VALUES ('more');
SELECT * FROM serialTest1;
--
-- Check dependencies of serial and ordinary sequences
@ -353,7 +353,7 @@ ALTER SEQUENCE sequence_test2 START WITH 1;
ROLLBACK;
-- Sequences should get wiped out as well:
DROP TABLE serialTest, serialTest2;
DROP TABLE serialTest1, serialTest2;
-- Make sure sequences are gone:
SELECT * FROM information_schema.sequences WHERE sequence_name IN