Merge pull request #6143 from citusdata/naisila/fix_column_rename

Renames remaining regclass to relation in columnar.options
pull/6156/head
Önder Kalacı 2022-08-10 17:25:13 +02:00 committed by GitHub
commit 6de8afec9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 15 deletions

View File

@ -6,11 +6,9 @@ SELECT substring(:'server_version', '\d+')::int >= 15 AS server_version_ge_15
\q \q
\endif \endif
CREATE TABLE alter_am(i int); CREATE TABLE alter_am(i int);
CREATE TABLE
INSERT INTO alter_am SELECT generate_series(1,1000000); INSERT INTO alter_am SELECT generate_series(1,1000000);
INSERT 0 1000000 SELECT * FROM columnar.options WHERE relation = 'alter_am'::regclass;
SELECT * FROM columnar.options WHERE regclass = 'alter_am'::regclass; relation | chunk_group_row_limit | stripe_row_limit | compression | compression_level
regclass | chunk_group_row_limit | stripe_row_limit | compression_level | compression
--------------------------------------------------------------------- ---------------------------------------------------------------------
(0 rows) (0 rows)
@ -23,11 +21,10 @@ SELECT SUM(i) FROM alter_am;
ALTER TABLE alter_am ALTER TABLE alter_am
SET ACCESS METHOD columnar, SET ACCESS METHOD columnar,
SET (columnar.compression = pglz, fillfactor = 20); SET (columnar.compression = pglz, fillfactor = 20);
ALTER TABLE SELECT * FROM columnar.options WHERE relation = 'alter_am'::regclass;
SELECT * FROM columnar.options WHERE regclass = 'alter_am'::regclass; relation | chunk_group_row_limit | stripe_row_limit | compression | compression_level
regclass | chunk_group_row_limit | stripe_row_limit | compression_level | compression
--------------------------------------------------------------------- ---------------------------------------------------------------------
alter_am | 10000 | 150000 | 3 | pglz alter_am | 10000 | 150000 | pglz | 3
(1 row) (1 row)
SELECT SUM(i) FROM alter_am; SELECT SUM(i) FROM alter_am;
@ -37,10 +34,9 @@ SELECT SUM(i) FROM alter_am;
(1 row) (1 row)
ALTER TABLE alter_am SET ACCESS METHOD heap; ALTER TABLE alter_am SET ACCESS METHOD heap;
ALTER TABLE
-- columnar options should be gone -- columnar options should be gone
SELECT * FROM columnar.options WHERE regclass = 'alter_am'::regclass; SELECT * FROM columnar.options WHERE relation = 'alter_am'::regclass;
regclass | chunk_group_row_limit | stripe_row_limit | compression_level | compression relation | chunk_group_row_limit | stripe_row_limit | compression | compression_level
--------------------------------------------------------------------- ---------------------------------------------------------------------
(0 rows) (0 rows)
@ -57,4 +53,3 @@ ALTER TABLE alter_am
ERROR: ALTER TABLE cannot alter the access method after altering storage parameters ERROR: ALTER TABLE cannot alter the access method after altering storage parameters
HINT: Specify SET ACCESS METHOD before storage parameters, or use separate ALTER TABLE commands. HINT: Specify SET ACCESS METHOD before storage parameters, or use separate ALTER TABLE commands.
DROP TABLE alter_am; DROP TABLE alter_am;
DROP TABLE

View File

@ -10,20 +10,20 @@ CREATE TABLE alter_am(i int);
INSERT INTO alter_am SELECT generate_series(1,1000000); INSERT INTO alter_am SELECT generate_series(1,1000000);
SELECT * FROM columnar.options WHERE regclass = 'alter_am'::regclass; SELECT * FROM columnar.options WHERE relation = 'alter_am'::regclass;
SELECT SUM(i) FROM alter_am; SELECT SUM(i) FROM alter_am;
ALTER TABLE alter_am ALTER TABLE alter_am
SET ACCESS METHOD columnar, SET ACCESS METHOD columnar,
SET (columnar.compression = pglz, fillfactor = 20); SET (columnar.compression = pglz, fillfactor = 20);
SELECT * FROM columnar.options WHERE regclass = 'alter_am'::regclass; SELECT * FROM columnar.options WHERE relation = 'alter_am'::regclass;
SELECT SUM(i) FROM alter_am; SELECT SUM(i) FROM alter_am;
ALTER TABLE alter_am SET ACCESS METHOD heap; ALTER TABLE alter_am SET ACCESS METHOD heap;
-- columnar options should be gone -- columnar options should be gone
SELECT * FROM columnar.options WHERE regclass = 'alter_am'::regclass; SELECT * FROM columnar.options WHERE relation = 'alter_am'::regclass;
SELECT SUM(i) FROM alter_am; SELECT SUM(i) FROM alter_am;
-- error: setting columnar options must happen after converting to columnar -- error: setting columnar options must happen after converting to columnar