CREATE TABLE hw_cstore_alter_t1(a int, b text) WITH(orientation=column);
CREATE INDEX ON hw_cstore_alter_t1(a);
CREATE ROLE cstore_role PASSWORD 'gauss@123';
ALTER TABLE hw_cstore_alter_t1 OWNER TO cstore_role;
DROP TABLE hw_cstore_alter_t1;
CREATE TABLE hw_cstore_alter_t3 ( a int , b int ) with ( orientation = column ) ;
CREATE TABLE hw_cstore_alter_t4 ( c int, d int ) inherits ( hw_cstore_alter_t3 ) with ( orientation = column ) ;
DROP TABLE IF EXISTS hw_cstore_alter_t3;
DROP TABLE IF EXISTS hw_cstore_alter_t4;
CREATE TABLE hw_cstore_alter_t2(a int , b bigint, c char(10), d decimal(20,2) ) with (orientation = column);
INSERT INTO hw_cstore_alter_t2 VALUES(1, 2, 'text', 3);
ALTER TABLE hw_cstore_alter_t2 RENAME a TO a1;
SELECT a1 FROM hw_cstore_alter_t2;
ALTER TABLE hw_cstore_alter_t2 RENAME COLUMN b TO b1;
SELECT b1 FROM hw_cstore_alter_t2;
ALTER TABLE IF EXISTS hw_cstore_alter_t2 RENAME c TO c1;
SELECT c1 FROM hw_cstore_alter_t2;
ALTER TABLE hw_cstore_alter_t2 RENAME d TO a1;
SELECT d FROM hw_cstore_alter_t2;
ALTER TABLE hw_cstore_alter_t3 RENAME a TO a1;
ALTER TABLE hw_cstore_alter_t2 RENAME d TO xmin;
ALTER TABLE hw_cstore_alter_t2 RENAME d TO abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij1234;
SELECT abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij1234 FROM hw_cstore_alter_t2;
SELECT abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij123 FROM hw_cstore_alter_t2;
ALTER TABLE hw_cstore_alter_t2 RENAME abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij1234
TO abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij123;
CREATE INDEX idx_hw_cstore_alter_t2 ON hw_cstore_alter_t2(c1);
ALTER INDEX idx_hw_cstore_alter_t2 RENAME TO idx1_hw_cstore_alter_t2;
select count(1) from pg_class where relname = 'idx1_hw_cstore_alter_t2';
ALTER INDEX IF EXISTS idx1_hw_cstore_alter_t2 RENAME TO idx2_hw_cstore_alter_t2;
select count(1) from pg_class where relname = 'idx2_hw_cstore_alter_t2';
ALTER INDEX idx2_hw_cstore_alter_t2 RENAME TO hw_cstore_alter_t2;
ALTER INDEX idx2_hw_cstore_alter_t2 RENAME TO idx3_abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij1234;
ALTER INDEX idx3_abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij1234 RENAME TO idx2_hw_cstore_alter_t2;
select count(1) from pg_class where relname = 'idx2_hw_cstore_alter_t2';
DROP TABLE hw_cstore_alter_t2;
CREATE TEMP TABLE hw_cstore_alter_t10 (a int , b int , c int ) with (orientation = column);
ALTER TABLE hw_cstore_alter_t10 RENAME a to b;
ALTER TABLE hw_cstore_alter_t10 RENAME a to xmin;
ALTER TABLE hw_cstore_alter_t10 RENAME a to a1;
SELECT a1 FROM hw_cstore_alter_t10;
ALTER TABLE hw_cstore_alter_t10 RENAME a1 TO abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij1234;
SELECT abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij1234 FROM hw_cstore_alter_t10;
SELECT abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij123 FROM hw_cstore_alter_t10;
ALTER TABLE hw_cstore_alter_t10 RENAME abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij1234
TO abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij123;
CREATE INDEX idx1_hw_cstore_alter_t10 ON hw_cstore_alter_t10(b);
\d+ idx1_hw_cstore_alter_t10
ALTER INDEX idx1_hw_cstore_alter_t10 RENAME TO idx2_hw_cstore_alter_t10;
DROP TABLE hw_cstore_alter_t10;
CREATE TEMP TABLE hw_cstore_alter_t11 (a int, b int, c decimal(20, 0) ) with (orientation = column)
PARTITION BY RANGE(a)(
PARTITION p1 values less than (10),
PARTITION p2 values less than (20),
PARTITION p3 values less than (30)
);
CREATE TEMP TABLE hw_cstore_alter_t12(a int , b int , c int ) with (compression = 'high');
CREATE TEMP TABLE hw_cstore_alter_t12(a int , b int , c int ) with (max_batchrow = 60000);
CREATE TEMP TABLE hw_cstore_alter_t12(a int , b int , c int ) with (deltarow_threshold = 9999);
CREATE TEMP TABLE hw_cstore_alter_t12(a int , b int , c int ) with (partial_cluster_rows = 600000);
CREATE TEMP TABLE hw_cstore_alter_t12(a int , b int , c int ) with (internal_mask = 1024);
CREATE TEMP TABLE hw_cstore_alter_t12(a int , b int , c int ) with (compression = 'yes', fillfactor=70);
ALTER TABLE hw_cstore_alter_t12 SET (compression = 'yes');
ALTER TABLE hw_cstore_alter_t12 SET (compression = 'no');
ALTER TABLE hw_cstore_alter_t12 SET (compression = 'low');
ALTER TABLE hw_cstore_alter_t12 SET (compression = 'middle');
ALTER TABLE hw_cstore_alter_t12 SET (compression = 'high');
ALTER TABLE hw_cstore_alter_t12 RESET (compression);
ALTER TABLE hw_cstore_alter_t12 SET (max_batchrow = 10000);
ALTER TABLE hw_cstore_alter_t12 RESET (max_batchrow);
ALTER TABLE hw_cstore_alter_t12 SET (deltarow_threshold = 9999);
ALTER TABLE hw_cstore_alter_t12 RESET (deltarow_threshold);
ALTER TABLE hw_cstore_alter_t12 SET (partial_cluster_rows = 600000);
ALTER TABLE hw_cstore_alter_t12 RESET (partial_cluster_rows);
ALTER TABLE hw_cstore_alter_t12 SET (ORIENTATION = COLUMN);
ALTER TABLE hw_cstore_alter_t12 SET (ORIENTATION = ROW);
ALTER TABLE hw_cstore_alter_t12 RESET (ORIENTATION);
ALTER TABLE hw_cstore_alter_t12 SET (internal_mask = 0);
ALTER TABLE hw_cstore_alter_t12 RESET (internal_mask);
DROP TABLE hw_cstore_alter_t12;
CREATE TEMP TABLE hw_cstore_alter_t13(a int , b int , c int );
DROP TABLE hw_cstore_alter_t13;
CREATE TEMP TABLE hw_cstore_alter_t14(a int , b int , c int ) with ( orientation = row );
CREATE INDEX idx1_hw_cstore_alter_t14 ON hw_cstore_alter_t14(b);
ALTER INDEX idx1_hw_cstore_alter_t14 SET (fillfactor = 70);
ALTER INDEX idx1_hw_cstore_alter_t14 RESET (fillfactor);
ALTER INDEX idx1_hw_cstore_alter_t14 SET (compression = 'yes');
ALTER INDEX idx1_hw_cstore_alter_t14 RESET (compression);
ALTER INDEX idx1_hw_cstore_alter_t14 SET (autovacuum_enabled = true);
ALTER INDEX idx1_hw_cstore_alter_t14 RESET (autovacuum_enabled);
ALTER INDEX idx1_hw_cstore_alter_t14 SET (security_barrier = true);
ALTER INDEX idx1_hw_cstore_alter_t14 RESET (security_barrier);
ALTER INDEX idx1_hw_cstore_alter_t14 SET (max_batchrow=10000);
ALTER INDEX idx1_hw_cstore_alter_t14 RESET (max_batchrow);
ALTER INDEX idx1_hw_cstore_alter_t14 SET (orientation = column);
ALTER INDEX idx1_hw_cstore_alter_t14 RESET (orientation);
ALTER INDEX idx1_hw_cstore_alter_t14 SET (internal_mask = 0);
ALTER INDEX idx1_hw_cstore_alter_t14 RESET (internal_mask);
ALTER INDEX idx1_hw_cstore_alter_t14 SET (partial_cluster_rows = 600000);
ALTER INDEX idx1_hw_cstore_alter_t14 RESET (partial_cluster_rows);
ALTER INDEX idx1_hw_cstore_alter_t14 SET (deltarow_threshold = 5000);
ALTER INDEX idx1_hw_cstore_alter_t14 RESET (deltarow_threshold);
DROP INDEX idx1_hw_cstore_alter_t14;
drop TABLE hw_cstore_alter_t14;
CREATE TEMP TABLE hw_cstore_alter_t15 (a int, b int, c int);
ALTER TABLE hw_cstore_alter_t15 ALTER COLUMN a SET (n_distinct_inherited = 7);
ALTER TABLE hw_cstore_alter_t15 ALTER COLUMN a RESET (n_distinct_inherited);
ALTER TABLE hw_cstore_alter_t15 ALTER COLUMN a SET (n_distinct = 7);
ALTER TABLE hw_cstore_alter_t15 ALTER COLUMN a RESET (n_distinct);
ALTER TABLE hw_cstore_alter_t15 ALTER COLUMN a RESET (n_distinct, n_distinct_inherited);
DROP TABLE hw_cstore_alter_t15;
CREATE TEMP TABLE hw_cstore_alter_t16 (a int, b int, c int) with (internal_mask = 1024);
CREATE TEMP TABLE hw_cstore_alter_t16 (a int, b int, c int) WITH (orientation = column);
ALTER TABLE hw_cstore_alter_t16 ALTER COLUMN a SET (n_distinct_inherited = 7);
ALTER TABLE hw_cstore_alter_t16 ALTER COLUMN a RESET (n_distinct_inherited);
ALTER TABLE hw_cstore_alter_t16 ALTER COLUMN a SET (n_distinct = 7);
ALTER TABLE hw_cstore_alter_t16 ALTER COLUMN a RESET (n_distinct);
ALTER TABLE hw_cstore_alter_t16 ALTER COLUMN a RESET (n_distinct, n_distinct_inherited);
ALTER TABLE hw_cstore_alter_t16 ALTER COLUMN a SET STORAGE PLAIN;
ALTER TABLE hw_cstore_alter_t16 ALTER COLUMN a SET STORAGE EXTERNAL;
ALTER TABLE hw_cstore_alter_t16 ALTER COLUMN a SET STORAGE EXTENDED;
ALTER TABLE hw_cstore_alter_t16 ALTER COLUMN a SET STORAGE MAIN;
ALTER TABLE hw_cstore_alter_t16 SET WITH OIDS;
ALTER TABLE hw_cstore_alter_t16 SET WITHOUT OIDS;
ALTER TABLE hw_cstore_alter_t16 SET (ORIENTATION = ROW);
ALTER TABLE hw_cstore_alter_t16 RESET (ORIENTATION);
ALTER TABLE hw_cstore_alter_t16 SET (internal_mask = 0);
ALTER TABLE hw_cstore_alter_t16 RESET (internal_mask);
ALTER TABLE hw_cstore_alter_t16 SET (FILLFACTOR = 70);
ALTER TABLE hw_cstore_alter_t16 RESET (FILLFACTOR);
ALTER TABLE hw_cstore_alter_t16 SET (autovacuum_enabled = true);
ALTER TABLE hw_cstore_alter_t16 RESET (autovacuum_enabled);
ALTER TABLE hw_cstore_alter_t16 SET (security_barrier);
ALTER TABLE hw_cstore_alter_t16 RESET (security_barrier);
\d+ hw_cstore_alter_t16
CREATE INDEX idx1_hw_cstore_alter_t16 ON hw_cstore_alter_t16(b) with (compression = 'low');
CREATE INDEX idx1_hw_cstore_alter_t16 ON hw_cstore_alter_t16(b) with (fillfactor = 100);
CREATE INDEX idx1_hw_cstore_alter_t16 ON hw_cstore_alter_t16(b) with (autovacuum_enabled = true);
CREATE INDEX idx1_hw_cstore_alter_t16 ON hw_cstore_alter_t16(b) with (security_barrier = on);
CREATE INDEX idx1_hw_cstore_alter_t16 ON hw_cstore_alter_t16(b) with (internal_mask = 0);
CREATE INDEX idx1_hw_cstore_alter_t16 ON hw_cstore_alter_t16(b) with (orientation = column);
CREATE INDEX idx1_hw_cstore_alter_t16 ON hw_cstore_alter_t16(b) with (max_batchrow = 60000, deltarow_threshold = 9999, partial_cluster_rows = 600000);
ALTER INDEX idx1_hw_cstore_alter_t16 SET (ORIENTATION = ROW);
ALTER INDEX idx1_hw_cstore_alter_t16 RESET (ORIENTATION);
ALTER INDEX idx1_hw_cstore_alter_t16 SET (compression = 'yes');
ALTER INDEX idx1_hw_cstore_alter_t16 RESET (compression);
ALTER INDEX idx1_hw_cstore_alter_t16 SET (internal_mask = 0);
ALTER INDEX idx1_hw_cstore_alter_t16 RESET (internal_mask);
ALTER INDEX idx1_hw_cstore_alter_t16 SET (max_batchrow = 60000);
ALTER INDEX idx1_hw_cstore_alter_t16 RESET (max_batchrow);
ALTER INDEX idx1_hw_cstore_alter_t16 SET (deltarow_threshold = 5000);
ALTER INDEX idx1_hw_cstore_alter_t16 RESET (deltarow_threshold);
ALTER INDEX idx1_hw_cstore_alter_t16 SET (partial_cluster_rows = 700000);
ALTER INDEX idx1_hw_cstore_alter_t16 RESET (partial_cluster_rows);
ALTER INDEX idx1_hw_cstore_alter_t16 SET (security_barrier = false);
ALTER INDEX idx1_hw_cstore_alter_t16 RESET (security_barrier);
ALTER INDEX idx1_hw_cstore_alter_t16 SET (FILLFACTOR = 70);
ALTER INDEX idx1_hw_cstore_alter_t16 RESET (FILLFACTOR);
ALTER TABLE idx1_hw_cstore_alter_t16 SET (autovacuum_enabled = true);
ALTER INDEX idx1_hw_cstore_alter_t16 RESET (autovacuum_enabled);
DROP INDEX idx1_hw_cstore_alter_t16;
DROP TABLE hw_cstore_alter_t16;
CREATE USER hw_user_u1 password 'GAUSS@123';
CREATE TABLE hw_cstore_alter_t17 (a int, b int, c int) with (orientation = column) distribute by hash(a)
partition by range (a)
(
partition p1 values less than (1000),
partition p2 values less than (2000),
partition p3 values less than (maxvalue)
);
CREATE INDEX idx1_hw_cstore_alter_t17 on hw_cstore_alter_t17 using PSORT (a) local;
ALTER TABLE hw_cstore_alter_t17 owner to hw_user_u1;
DROP TABLE hw_cstore_alter_t17;
DROP USER hw_user_u1;
CREATE USER hw_user_u2 password 'GAUSS@123';
CREATE TABLE hw_cstore_alter_t18 (a int, b int, c int) with (orientation = column) distribute by hash(a)
partition by range (a)
(
partition p1 values less than (1000),
partition p2 values less than (2000),
partition p3 values less than (maxvalue)
);
CREATE INDEX idx1_hw_cstore_alter_t18 on hw_cstore_alter_t18 using PSORT (a) local;
ALTER TABLE hw_cstore_alter_t18 owner to hw_user_u2;
DROP USER hw_user_u2 cascade;