From a2b698a766d46cb1ed2489d2991f0ca20e43d51e Mon Sep 17 00:00:00 2001 From: Jeff Davis Date: Thu, 19 Nov 2020 12:14:29 -0800 Subject: [PATCH] rename cstore_tableam -> columnar --- src/backend/columnar/cstore_customscan.c | 2 +- src/backend/columnar/cstore_tableam.c | 10 +++---- .../columnar/sql/columnar--9.5-1--10.0-1.sql | 6 ++--- .../downgrades/columnar--10.0-1--9.5-1.sql | 10 +++---- .../sql/udfs/columnar_handler/10.0-1.sql | 9 +++++++ .../sql/udfs/columnar_handler/latest.sql | 9 +++++++ .../cstore_ensure_objects_exist/10.0-1.sql | 12 ++++----- .../cstore_ensure_objects_exist/latest.sql | 12 ++++----- .../udfs/cstore_tableam_handler/10.0-1.sql | 9 ------- .../udfs/cstore_tableam_handler/latest.sql | 9 ------- src/include/columnar/cstore_tableam.h | 2 +- src/test/regress/expected/am_alter.out | 2 +- src/test/regress/expected/am_drop.out | 6 ++--- src/test/regress/expected/am_functions.out | 4 +-- src/test/regress/expected/am_insert.out | 4 +-- src/test/regress/expected/am_join.out | 4 +-- src/test/regress/expected/am_matview.out | 4 +-- src/test/regress/expected/am_query.out | 4 +-- src/test/regress/expected/am_recursive.out | 4 +-- src/test/regress/expected/am_rollback.out | 2 +- src/test/regress/expected/am_tableoptions.out | 26 +++++++++---------- src/test/regress/expected/am_transactions.out | 2 +- src/test/regress/expected/am_trigger.out | 8 +++--- src/test/regress/expected/am_truncate.out | 10 +++---- src/test/regress/expected/am_vacuum.out | 2 +- src/test/regress/expected/multi_extension.out | 6 ++--- .../regress/expected/multi_extension_0.out | 2 +- .../expected/upgrade_list_citus_objects.out | 6 ++--- .../expected/upgrade_list_citus_objects_0.out | 2 +- .../regress/input/am_block_filtering.source | 4 +-- src/test/regress/input/am_copyto.source | 2 +- src/test/regress/input/am_create.source | 4 +-- src/test/regress/input/am_data_types.source | 12 ++++----- src/test/regress/input/am_load.source | 2 +- .../regress/output/am_block_filtering.source | 4 +-- src/test/regress/output/am_copyto.source | 2 +- src/test/regress/output/am_create.source | 4 +-- src/test/regress/output/am_data_types.source | 12 ++++----- src/test/regress/output/am_load.source | 2 +- .../regress/spec/am_vacuum_vs_insert.spec | 2 +- .../regress/spec/am_write_concurrency.spec | 2 +- src/test/regress/sql/am_alter.sql | 2 +- src/test/regress/sql/am_drop.sql | 6 ++--- src/test/regress/sql/am_functions.sql | 4 +-- src/test/regress/sql/am_insert.sql | 4 +-- src/test/regress/sql/am_join.sql | 4 +-- src/test/regress/sql/am_matview.sql | 4 +-- src/test/regress/sql/am_query.sql | 4 +-- src/test/regress/sql/am_recursive.sql | 4 +-- src/test/regress/sql/am_rollback.sql | 2 +- src/test/regress/sql/am_tableoptions.sql | 26 +++++++++---------- src/test/regress/sql/am_transactions.sql | 2 +- src/test/regress/sql/am_trigger.sql | 8 +++--- src/test/regress/sql/am_truncate.sql | 10 +++---- src/test/regress/sql/am_vacuum.sql | 2 +- 55 files changed, 161 insertions(+), 161 deletions(-) create mode 100644 src/backend/columnar/sql/udfs/columnar_handler/10.0-1.sql create mode 100644 src/backend/columnar/sql/udfs/columnar_handler/latest.sql delete mode 100644 src/backend/columnar/sql/udfs/cstore_tableam_handler/10.0-1.sql delete mode 100644 src/backend/columnar/sql/udfs/cstore_tableam_handler/latest.sql diff --git a/src/backend/columnar/cstore_customscan.c b/src/backend/columnar/cstore_customscan.c index 5b5ffe39f..062347d52 100644 --- a/src/backend/columnar/cstore_customscan.c +++ b/src/backend/columnar/cstore_customscan.c @@ -160,7 +160,7 @@ CStoreSetRelPathlistHook(PlannerInfo *root, RelOptInfo *rel, Index rti, * into the scan of the table to minimize the data read. */ Relation relation = RelationIdGetRelation(rte->relid); - if (relation->rd_tableam == GetCstoreTableAmRoutine()) + if (relation->rd_tableam == GetColumnarTableAmRoutine()) { Path *customPath = CreateCStoreScanPath(rel, rte); diff --git a/src/backend/columnar/cstore_tableam.c b/src/backend/columnar/cstore_tableam.c index 1669b571c..c76dd7fd1 100644 --- a/src/backend/columnar/cstore_tableam.c +++ b/src/backend/columnar/cstore_tableam.c @@ -1080,7 +1080,7 @@ CStoreTableAMProcessUtility(PlannedStmt * plannedStatement, CreateTrigStmt *createTrigStmt = (CreateTrigStmt *) parseTree; Relation rel = relation_openrv(createTrigStmt->relation, AccessShareLock); - bool isCStore = rel->rd_tableam == GetCstoreTableAmRoutine(); + bool isCStore = rel->rd_tableam == GetColumnarTableAmRoutine(); relation_close(rel, AccessShareLock); if (isCStore && @@ -1187,7 +1187,7 @@ IsCStoreTableAmTable(Oid relationId) * avoid race conditions. */ Relation rel = relation_open(relationId, AccessShareLock); - bool result = rel->rd_tableam == GetCstoreTableAmRoutine(); + bool result = rel->rd_tableam == GetColumnarTableAmRoutine(); relation_close(rel, NoLock); return result; @@ -1251,15 +1251,15 @@ static const TableAmRoutine cstore_am_methods = { const TableAmRoutine * -GetCstoreTableAmRoutine(void) +GetColumnarTableAmRoutine(void) { return &cstore_am_methods; } -PG_FUNCTION_INFO_V1(cstore_tableam_handler); +PG_FUNCTION_INFO_V1(columnar_handler); Datum -cstore_tableam_handler(PG_FUNCTION_ARGS) +columnar_handler(PG_FUNCTION_ARGS) { PG_RETURN_POINTER(&cstore_am_methods); } diff --git a/src/backend/columnar/sql/columnar--9.5-1--10.0-1.sql b/src/backend/columnar/sql/columnar--9.5-1--10.0-1.sql index fe307e069..d9f9cb14b 100644 --- a/src/backend/columnar/sql/columnar--9.5-1--10.0-1.sql +++ b/src/backend/columnar/sql/columnar--9.5-1--10.0-1.sql @@ -77,7 +77,7 @@ CREATE TABLE cstore_skipnodes ( COMMENT ON TABLE cstore_skipnodes IS 'CStore per block metadata'; -CREATE VIEW cstore_options AS +CREATE VIEW columnar_options AS SELECT c.oid::regclass regclass, d.block_row_count, d.stripe_row_count, @@ -85,7 +85,7 @@ SELECT c.oid::regclass regclass, FROM pg_class c JOIN cstore.cstore_data_files d USING(relfilenode); -COMMENT ON VIEW cstore_options IS 'CStore per table settings'; +COMMENT ON VIEW columnar_options IS 'CStore per table settings'; DO $proc$ BEGIN @@ -95,7 +95,7 @@ BEGIN -- user instead to add the missing objects IF substring(current_Setting('server_version'), '\d+')::int >= 12 THEN EXECUTE $$ -#include "udfs/cstore_tableam_handler/10.0-1.sql" +#include "udfs/columnar_handler/10.0-1.sql" #include "udfs/alter_cstore_table_set/10.0-1.sql" #include "udfs/alter_cstore_table_reset/10.0-1.sql" $$; diff --git a/src/backend/columnar/sql/downgrades/columnar--10.0-1--9.5-1.sql b/src/backend/columnar/sql/downgrades/columnar--10.0-1--9.5-1.sql index ecfa18f79..5b6a9cbd7 100644 --- a/src/backend/columnar/sql/downgrades/columnar--10.0-1--9.5-1.sql +++ b/src/backend/columnar/sql/downgrades/columnar--10.0-1--9.5-1.sql @@ -7,27 +7,27 @@ BEGIN IF substring(current_Setting('server_version'), '\d+')::int >= 12 THEN EXECUTE $$ - DROP FUNCTION pg_catalog.alter_cstore_table_reset( + DROP FUNCTION pg_catalog.alter_columnar_table_reset( table_name regclass, block_row_count bool, stripe_row_count bool, compression bool); - DROP FUNCTION pg_catalog.alter_cstore_table_set( + DROP FUNCTION pg_catalog.alter_columnar_table_set( table_name regclass, block_row_count int, stripe_row_count int, compression name); - DROP ACCESS METHOD cstore_tableam; + DROP ACCESS METHOD columnar; - DROP FUNCTION cstore_tableam_handler(internal); + DROP FUNCTION columnar_handler(internal); $$; END IF; END$proc$; -DROP VIEW cstore_options; +DROP VIEW columnar_options; DROP TABLE cstore_skipnodes; DROP TABLE cstore_stripes; DROP TABLE cstore_data_files; diff --git a/src/backend/columnar/sql/udfs/columnar_handler/10.0-1.sql b/src/backend/columnar/sql/udfs/columnar_handler/10.0-1.sql new file mode 100644 index 000000000..5a3f5168b --- /dev/null +++ b/src/backend/columnar/sql/udfs/columnar_handler/10.0-1.sql @@ -0,0 +1,9 @@ +CREATE OR REPLACE FUNCTION cstore.columnar_handler(internal) + RETURNS table_am_handler + LANGUAGE C +AS 'MODULE_PATHNAME', 'columnar_handler'; + +COMMENT ON FUNCTION cstore.columnar_handler(internal) + IS 'internal function returning the handler for cstore tables'; + +CREATE ACCESS METHOD columnar TYPE TABLE HANDLER cstore.columnar_handler; diff --git a/src/backend/columnar/sql/udfs/columnar_handler/latest.sql b/src/backend/columnar/sql/udfs/columnar_handler/latest.sql new file mode 100644 index 000000000..5a3f5168b --- /dev/null +++ b/src/backend/columnar/sql/udfs/columnar_handler/latest.sql @@ -0,0 +1,9 @@ +CREATE OR REPLACE FUNCTION cstore.columnar_handler(internal) + RETURNS table_am_handler + LANGUAGE C +AS 'MODULE_PATHNAME', 'columnar_handler'; + +COMMENT ON FUNCTION cstore.columnar_handler(internal) + IS 'internal function returning the handler for cstore tables'; + +CREATE ACCESS METHOD columnar TYPE TABLE HANDLER cstore.columnar_handler; diff --git a/src/backend/columnar/sql/udfs/cstore_ensure_objects_exist/10.0-1.sql b/src/backend/columnar/sql/udfs/cstore_ensure_objects_exist/10.0-1.sql index 69b56f99a..ec9365143 100644 --- a/src/backend/columnar/sql/udfs/cstore_ensure_objects_exist/10.0-1.sql +++ b/src/backend/columnar/sql/udfs/cstore_ensure_objects_exist/10.0-1.sql @@ -16,23 +16,23 @@ BEGIN -- when postgres is version 12 or above we need to create the tableam. If the tableam -- exist we assume all objects have been created. IF substring(current_Setting('server_version'), '\d+')::int >= 12 THEN -IF NOT EXISTS (SELECT 1 FROM pg_am WHERE amname = 'cstore_tableam') THEN +IF NOT EXISTS (SELECT 1 FROM pg_am WHERE amname = 'columnar') THEN -#include "../cstore_tableam_handler/10.0-1.sql" +#include "../columnar_handler/10.0-1.sql" #include "../alter_cstore_table_set/10.0-1.sql" #include "../alter_cstore_table_reset/10.0-1.sql" -- add the missing objects to the extension - ALTER EXTENSION citus ADD FUNCTION cstore.cstore_tableam_handler(internal); - ALTER EXTENSION citus ADD ACCESS METHOD cstore_tableam; - ALTER EXTENSION citus ADD FUNCTION pg_catalog.alter_cstore_table_set( + ALTER EXTENSION citus ADD FUNCTION cstore.columnar_handler(internal); + ALTER EXTENSION citus ADD ACCESS METHOD columnar; + ALTER EXTENSION citus ADD FUNCTION pg_catalog.alter_columnar_table_set( table_name regclass, block_row_count int, stripe_row_count int, compression name); - ALTER EXTENSION citus ADD FUNCTION pg_catalog.alter_cstore_table_reset( + ALTER EXTENSION citus ADD FUNCTION pg_catalog.alter_columnar_table_reset( table_name regclass, block_row_count bool, stripe_row_count bool, diff --git a/src/backend/columnar/sql/udfs/cstore_ensure_objects_exist/latest.sql b/src/backend/columnar/sql/udfs/cstore_ensure_objects_exist/latest.sql index 69b56f99a..ec9365143 100644 --- a/src/backend/columnar/sql/udfs/cstore_ensure_objects_exist/latest.sql +++ b/src/backend/columnar/sql/udfs/cstore_ensure_objects_exist/latest.sql @@ -16,23 +16,23 @@ BEGIN -- when postgres is version 12 or above we need to create the tableam. If the tableam -- exist we assume all objects have been created. IF substring(current_Setting('server_version'), '\d+')::int >= 12 THEN -IF NOT EXISTS (SELECT 1 FROM pg_am WHERE amname = 'cstore_tableam') THEN +IF NOT EXISTS (SELECT 1 FROM pg_am WHERE amname = 'columnar') THEN -#include "../cstore_tableam_handler/10.0-1.sql" +#include "../columnar_handler/10.0-1.sql" #include "../alter_cstore_table_set/10.0-1.sql" #include "../alter_cstore_table_reset/10.0-1.sql" -- add the missing objects to the extension - ALTER EXTENSION citus ADD FUNCTION cstore.cstore_tableam_handler(internal); - ALTER EXTENSION citus ADD ACCESS METHOD cstore_tableam; - ALTER EXTENSION citus ADD FUNCTION pg_catalog.alter_cstore_table_set( + ALTER EXTENSION citus ADD FUNCTION cstore.columnar_handler(internal); + ALTER EXTENSION citus ADD ACCESS METHOD columnar; + ALTER EXTENSION citus ADD FUNCTION pg_catalog.alter_columnar_table_set( table_name regclass, block_row_count int, stripe_row_count int, compression name); - ALTER EXTENSION citus ADD FUNCTION pg_catalog.alter_cstore_table_reset( + ALTER EXTENSION citus ADD FUNCTION pg_catalog.alter_columnar_table_reset( table_name regclass, block_row_count bool, stripe_row_count bool, diff --git a/src/backend/columnar/sql/udfs/cstore_tableam_handler/10.0-1.sql b/src/backend/columnar/sql/udfs/cstore_tableam_handler/10.0-1.sql deleted file mode 100644 index 6d6a7db3f..000000000 --- a/src/backend/columnar/sql/udfs/cstore_tableam_handler/10.0-1.sql +++ /dev/null @@ -1,9 +0,0 @@ -CREATE OR REPLACE FUNCTION cstore.cstore_tableam_handler(internal) - RETURNS table_am_handler - LANGUAGE C -AS 'MODULE_PATHNAME', 'cstore_tableam_handler'; - -COMMENT ON FUNCTION cstore.cstore_tableam_handler(internal) - IS 'internal function returning the handler for cstore tables'; - -CREATE ACCESS METHOD cstore_tableam TYPE TABLE HANDLER cstore.cstore_tableam_handler; diff --git a/src/backend/columnar/sql/udfs/cstore_tableam_handler/latest.sql b/src/backend/columnar/sql/udfs/cstore_tableam_handler/latest.sql deleted file mode 100644 index 6d6a7db3f..000000000 --- a/src/backend/columnar/sql/udfs/cstore_tableam_handler/latest.sql +++ /dev/null @@ -1,9 +0,0 @@ -CREATE OR REPLACE FUNCTION cstore.cstore_tableam_handler(internal) - RETURNS table_am_handler - LANGUAGE C -AS 'MODULE_PATHNAME', 'cstore_tableam_handler'; - -COMMENT ON FUNCTION cstore.cstore_tableam_handler(internal) - IS 'internal function returning the handler for cstore tables'; - -CREATE ACCESS METHOD cstore_tableam TYPE TABLE HANDLER cstore.cstore_tableam_handler; diff --git a/src/include/columnar/cstore_tableam.h b/src/include/columnar/cstore_tableam.h index 10b9a3874..b137de899 100644 --- a/src/include/columnar/cstore_tableam.h +++ b/src/include/columnar/cstore_tableam.h @@ -7,7 +7,7 @@ #include "access/skey.h" #include "nodes/bitmapset.h" -const TableAmRoutine * GetCstoreTableAmRoutine(void); +const TableAmRoutine * GetColumnarTableAmRoutine(void); extern void cstore_tableam_init(void); extern void cstore_tableam_finish(void); diff --git a/src/test/regress/expected/am_alter.out b/src/test/regress/expected/am_alter.out index bfe4c281f..15542d932 100644 --- a/src/test/regress/expected/am_alter.out +++ b/src/test/regress/expected/am_alter.out @@ -1,7 +1,7 @@ -- -- Testing ALTER TABLE on cstore_fdw tables. -- -CREATE TABLE test_alter_table (a int, b int, c int) USING cstore_tableam; +CREATE TABLE test_alter_table (a int, b int, c int) USING columnar; WITH sample_data AS (VALUES (1, 2, 3), (4, 5, 6), diff --git a/src/test/regress/expected/am_drop.out b/src/test/regress/expected/am_drop.out index 255a97693..83b7b4360 100644 --- a/src/test/regress/expected/am_drop.out +++ b/src/test/regress/expected/am_drop.out @@ -25,7 +25,7 @@ SELECT :cstore_data_files_before_drop - count(*) FROM cstore.cstore_data_files; -- Create a cstore_fdw table under a schema and drop it. CREATE SCHEMA test_schema; -CREATE TABLE test_schema.test_table(data int) USING cstore_tableam; +CREATE TABLE test_schema.test_table(data int) USING columnar; SELECT count(*) AS cstore_data_files_before_drop FROM cstore.cstore_data_files \gset DROP SCHEMA test_schema CASCADE; NOTICE: drop cascades to table test_schema.test_table @@ -43,12 +43,12 @@ HINT: You can manually create a database and its extensions on workers. \c db_to_drop CREATE EXTENSION citus; SELECT oid::text databaseoid FROM pg_database WHERE datname = current_database() \gset -CREATE TABLE test_table(data int) USING cstore_tableam; +CREATE TABLE test_table(data int) USING columnar; DROP EXTENSION citus CASCADE; NOTICE: drop cascades to table test_table -- test database drop CREATE EXTENSION citus; SELECT oid::text databaseoid FROM pg_database WHERE datname = current_database() \gset -CREATE TABLE test_table(data int) USING cstore_tableam; +CREATE TABLE test_table(data int) USING columnar; \c :datname DROP DATABASE db_to_drop; diff --git a/src/test/regress/expected/am_functions.out b/src/test/regress/expected/am_functions.out index 288b80b6e..a4a8e9c90 100644 --- a/src/test/regress/expected/am_functions.out +++ b/src/test/regress/expected/am_functions.out @@ -1,8 +1,8 @@ -- -- Test utility functions for cstore_fdw tables. -- -CREATE TABLE empty_table (a int) USING cstore_tableam; -CREATE TABLE table_with_data (a int) USING cstore_tableam; +CREATE TABLE empty_table (a int) USING columnar; +CREATE TABLE table_with_data (a int) USING columnar; CREATE TABLE non_cstore_table (a int); COPY table_with_data FROM STDIN; SELECT pg_relation_size('empty_table') < pg_relation_size('table_with_data'); diff --git a/src/test/regress/expected/am_insert.out b/src/test/regress/expected/am_insert.out index 460c42a24..58f3ac7dc 100644 --- a/src/test/regress/expected/am_insert.out +++ b/src/test/regress/expected/am_insert.out @@ -1,7 +1,7 @@ -- -- Testing insert on cstore_fdw tables. -- -CREATE TABLE test_insert_command (a int) USING cstore_tableam; +CREATE TABLE test_insert_command (a int) USING columnar; -- test single row inserts fail select count(*) from test_insert_command; count @@ -58,7 +58,7 @@ CREATE TABLE test_long_text_hash AS SELECT int_val, md5(text_val) AS hash FROM test_long_text; CREATE TABLE test_cstore_long_text(int_val int, text_val text) -USING cstore_tableam; +USING columnar; -- store long text in cstore table INSERT INTO test_cstore_long_text SELECT * FROM test_long_text; -- drop source table to remove original text from toast diff --git a/src/test/regress/expected/am_join.out b/src/test/regress/expected/am_join.out index b55a9fd3f..32ee99de6 100644 --- a/src/test/regress/expected/am_join.out +++ b/src/test/regress/expected/am_join.out @@ -1,8 +1,8 @@ CREATE SCHEMA am_cstore_join; SET search_path TO am_cstore_join; -CREATE TABLE users (id int, name text) USING cstore_tableam; +CREATE TABLE users (id int, name text) USING columnar; INSERT INTO users SELECT a, 'name' || a FROM generate_series(0,30-1) AS a; -CREATE TABLE things (id int, user_id int, name text) USING cstore_tableam; +CREATE TABLE things (id int, user_id int, name text) USING columnar; INSERT INTO things SELECT a, a % 30, 'thing' || a FROM generate_series(1,300) AS a; -- force the nested loop to rescan the table SET enable_material TO off; diff --git a/src/test/regress/expected/am_matview.out b/src/test/regress/expected/am_matview.out index 79595b05d..6823fc682 100644 --- a/src/test/regress/expected/am_matview.out +++ b/src/test/regress/expected/am_matview.out @@ -1,9 +1,9 @@ -- -- Testing we materialized views properly -- -CREATE TABLE t(a int, b int) USING cstore_tableam; +CREATE TABLE t(a int, b int) USING columnar; INSERT INTO t SELECT floor(i / 4), 2 * i FROM generate_series(1, 10) i; -CREATE MATERIALIZED VIEW t_view(a, bsum, cnt) USING cstore_tableam AS +CREATE MATERIALIZED VIEW t_view(a, bsum, cnt) USING columnar AS SELECT a, sum(b), count(*) FROM t GROUP BY a; SELECT * FROM t_view a ORDER BY a; a | bsum | cnt diff --git a/src/test/regress/expected/am_query.out b/src/test/regress/expected/am_query.out index a72681458..211cec8a9 100644 --- a/src/test/regress/expected/am_query.out +++ b/src/test/regress/expected/am_query.out @@ -83,8 +83,8 @@ SELECT to_json(v) FROM contestant v ORDER BY rating LIMIT 1; (1 row) -- Test variables used in expressions -CREATE TABLE union_first (a int, b int) USING cstore_tableam; -CREATE TABLE union_second (a int, b int) USING cstore_tableam; +CREATE TABLE union_first (a int, b int) USING columnar; +CREATE TABLE union_second (a int, b int) USING columnar; INSERT INTO union_first SELECT a, a FROM generate_series(1, 5) a; INSERT INTO union_second SELECT a, a FROM generate_series(11, 15) a; (SELECT a*1, b FROM union_first) union all (SELECT a*1, b FROM union_second); diff --git a/src/test/regress/expected/am_recursive.out b/src/test/regress/expected/am_recursive.out index eb90dda47..c4c05d057 100644 --- a/src/test/regress/expected/am_recursive.out +++ b/src/test/regress/expected/am_recursive.out @@ -1,5 +1,5 @@ -CREATE TABLE t1(a int, b int) USING cstore_tableam; -CREATE TABLE t2(a int, b int) USING cstore_tableam; +CREATE TABLE t1(a int, b int) USING columnar; +CREATE TABLE t2(a int, b int) USING columnar; CREATE FUNCTION f(x INT) RETURNS INT AS $$ INSERT INTO t1 VALUES(x, x * 2) RETURNING b - 1; $$ LANGUAGE SQL; diff --git a/src/test/regress/expected/am_rollback.out b/src/test/regress/expected/am_rollback.out index a4c069377..a5c9a23f6 100644 --- a/src/test/regress/expected/am_rollback.out +++ b/src/test/regress/expected/am_rollback.out @@ -1,7 +1,7 @@ -- -- Testing we handle rollbacks properly -- -CREATE TABLE t(a int, b int) USING cstore_tableam; +CREATE TABLE t(a int, b int) USING columnar; BEGIN; INSERT INTO t SELECT i, i+1 FROM generate_series(1, 10) i; ROLLBACK; diff --git a/src/test/regress/expected/am_tableoptions.out b/src/test/regress/expected/am_tableoptions.out index 3b43dd53f..cdc6b3c92 100644 --- a/src/test/regress/expected/am_tableoptions.out +++ b/src/test/regress/expected/am_tableoptions.out @@ -1,9 +1,9 @@ CREATE SCHEMA am_tableoptions; SET search_path TO am_tableoptions; -CREATE TABLE table_options (a int) USING cstore_tableam; +CREATE TABLE table_options (a int) USING columnar; INSERT INTO table_options SELECT generate_series(1,100); -- show table_options settings -SELECT * FROM cstore.cstore_options +SELECT * FROM cstore.columnar_options WHERE regclass = 'table_options'::regclass; regclass | block_row_count | stripe_row_count | compression --------------------------------------------------------------------- @@ -18,7 +18,7 @@ SELECT alter_cstore_table_set('table_options', compression => 'pglz'); (1 row) -- show table_options settings -SELECT * FROM cstore.cstore_options +SELECT * FROM cstore.columnar_options WHERE regclass = 'table_options'::regclass; regclass | block_row_count | stripe_row_count | compression --------------------------------------------------------------------- @@ -33,7 +33,7 @@ SELECT alter_cstore_table_set('table_options', block_row_count => 10); (1 row) -- show table_options settings -SELECT * FROM cstore.cstore_options +SELECT * FROM cstore.columnar_options WHERE regclass = 'table_options'::regclass; regclass | block_row_count | stripe_row_count | compression --------------------------------------------------------------------- @@ -48,7 +48,7 @@ SELECT alter_cstore_table_set('table_options', stripe_row_count => 100); (1 row) -- show table_options settings -SELECT * FROM cstore.cstore_options +SELECT * FROM cstore.columnar_options WHERE regclass = 'table_options'::regclass; regclass | block_row_count | stripe_row_count | compression --------------------------------------------------------------------- @@ -58,7 +58,7 @@ WHERE regclass = 'table_options'::regclass; -- VACUUM FULL creates a new table, make sure it copies settings from the table you are vacuuming VACUUM FULL table_options; -- show table_options settings -SELECT * FROM cstore.cstore_options +SELECT * FROM cstore.columnar_options WHERE regclass = 'table_options'::regclass; regclass | block_row_count | stripe_row_count | compression --------------------------------------------------------------------- @@ -73,7 +73,7 @@ SELECT alter_cstore_table_set('table_options', stripe_row_count => 1000, block_r (1 row) -- show table_options settings -SELECT * FROM cstore.cstore_options +SELECT * FROM cstore.columnar_options WHERE regclass = 'table_options'::regclass; regclass | block_row_count | stripe_row_count | compression --------------------------------------------------------------------- @@ -86,7 +86,7 @@ SET cstore.stripe_row_count TO 10000; SET cstore.compression TO 'pglz'; -- verify setting the GUC's didn't change the settings -- show table_options settings -SELECT * FROM cstore.cstore_options +SELECT * FROM cstore.columnar_options WHERE regclass = 'table_options'::regclass; regclass | block_row_count | stripe_row_count | compression --------------------------------------------------------------------- @@ -100,7 +100,7 @@ SELECT alter_cstore_table_reset('table_options', block_row_count => true); (1 row) -- show table_options settings -SELECT * FROM cstore.cstore_options +SELECT * FROM cstore.columnar_options WHERE regclass = 'table_options'::regclass; regclass | block_row_count | stripe_row_count | compression --------------------------------------------------------------------- @@ -114,7 +114,7 @@ SELECT alter_cstore_table_reset('table_options', stripe_row_count => true); (1 row) -- show table_options settings -SELECT * FROM cstore.cstore_options +SELECT * FROM cstore.columnar_options WHERE regclass = 'table_options'::regclass; regclass | block_row_count | stripe_row_count | compression --------------------------------------------------------------------- @@ -128,7 +128,7 @@ SELECT alter_cstore_table_reset('table_options', compression => true); (1 row) -- show table_options settings -SELECT * FROM cstore.cstore_options +SELECT * FROM cstore.columnar_options WHERE regclass = 'table_options'::regclass; regclass | block_row_count | stripe_row_count | compression --------------------------------------------------------------------- @@ -140,7 +140,7 @@ SET cstore.block_row_count TO 10000; SET cstore.stripe_row_count TO 100000; SET cstore.compression TO 'none'; -- show table_options settings -SELECT * FROM cstore.cstore_options +SELECT * FROM cstore.columnar_options WHERE regclass = 'table_options'::regclass; regclass | block_row_count | stripe_row_count | compression --------------------------------------------------------------------- @@ -158,7 +158,7 @@ SELECT alter_cstore_table_reset( (1 row) -- show table_options settings -SELECT * FROM cstore.cstore_options +SELECT * FROM cstore.columnar_options WHERE regclass = 'table_options'::regclass; regclass | block_row_count | stripe_row_count | compression --------------------------------------------------------------------- diff --git a/src/test/regress/expected/am_transactions.out b/src/test/regress/expected/am_transactions.out index d2490ab7d..420f59d40 100644 --- a/src/test/regress/expected/am_transactions.out +++ b/src/test/regress/expected/am_transactions.out @@ -1,7 +1,7 @@ -- -- Testing we handle transactions properly -- -CREATE TABLE t(a int, b int) USING cstore_tableam; +CREATE TABLE t(a int, b int) USING columnar; INSERT INTO t SELECT i, 2 * i FROM generate_series(1, 3) i; SELECT * FROM t ORDER BY a; a | b diff --git a/src/test/regress/expected/am_trigger.out b/src/test/regress/expected/am_trigger.out index cd85c96bc..595650591 100644 --- a/src/test/regress/expected/am_trigger.out +++ b/src/test/regress/expected/am_trigger.out @@ -35,7 +35,7 @@ BEGIN RETURN NEW; END; $$; -create table test_tr(i int) using cstore_tableam; +create table test_tr(i int) using columnar; create trigger tr_before_stmt before insert on test_tr for each statement execute procedure trs_before(); create trigger tr_after_stmt after insert on test_tr @@ -84,7 +84,7 @@ SELECT * FROM test_tr ORDER BY i; (4 rows) drop table test_tr; -create table test_tr(i int) using cstore_tableam; +create table test_tr(i int) using columnar; -- we should be able to clean-up and continue gracefully if we -- error out in AFTER STATEMENT triggers. CREATE SEQUENCE counter START 100; @@ -126,12 +126,12 @@ create table events( PARTITION BY RANGE (event_time); create table events_p2020_11_04_102965 PARTITION OF events FOR VALUES FROM ('2020-11-04 00:00:00+01') TO ('2020-11-05 00:00:00+01') -USING cstore_tableam; +USING columnar; create table events_trigger_target( user_id bigint, avg float, __count__ bigint -) USING cstore_tableam; +) USING columnar; CREATE OR REPLACE FUNCTION user_value_by_day() RETURNS trigger LANGUAGE plpgsql diff --git a/src/test/regress/expected/am_truncate.out b/src/test/regress/expected/am_truncate.out index cfa13bef5..84ec99c01 100644 --- a/src/test/regress/expected/am_truncate.out +++ b/src/test/regress/expected/am_truncate.out @@ -10,10 +10,10 @@ SELECT substring(:'server_version', '\d+')::int > 10 AS version_above_ten; (1 row) -- CREATE a cstore_fdw table, fill with some data -- -CREATE TABLE cstore_truncate_test (a int, b int) USING cstore_tableam; -CREATE TABLE cstore_truncate_test_second (a int, b int) USING cstore_tableam; +CREATE TABLE cstore_truncate_test (a int, b int) USING columnar; +CREATE TABLE cstore_truncate_test_second (a int, b int) USING columnar; -- COMPRESSED -CREATE TABLE cstore_truncate_test_compressed (a int, b int) USING cstore_tableam; +CREATE TABLE cstore_truncate_test_compressed (a int, b int) USING columnar; CREATE TABLE cstore_truncate_test_regular (a int, b int); SELECT count(*) AS cstore_data_files_before_truncate FROM cstore.cstore_data_files \gset INSERT INTO cstore_truncate_test select a, a from generate_series(1, 10) a; @@ -155,7 +155,7 @@ SELECT :cstore_data_files_before_truncate - count(*) FROM cstore.cstore_data_fil -- test if truncation in the same transaction that created the table works properly BEGIN; -CREATE TABLE cstore_same_transaction_truncate(a int) USING cstore_tableam; +CREATE TABLE cstore_same_transaction_truncate(a int) USING columnar; INSERT INTO cstore_same_transaction_truncate SELECT * FROM generate_series(1, 100); TRUNCATE cstore_same_transaction_truncate; INSERT INTO cstore_same_transaction_truncate SELECT * FROM generate_series(20, 23); @@ -204,7 +204,7 @@ DROP TABLE cstore_truncate_test_compressed; -- test truncate with schema CREATE SCHEMA truncate_schema; -- COMPRESSED -CREATE TABLE truncate_schema.truncate_tbl (id int) USING cstore_tableam; +CREATE TABLE truncate_schema.truncate_tbl (id int) USING columnar; set cstore.compression = 'pglz'; INSERT INTO truncate_schema.truncate_tbl SELECT generate_series(1, 100); set cstore.compression to default; diff --git a/src/test/regress/expected/am_vacuum.out b/src/test/regress/expected/am_vacuum.out index 15da28fe0..3cb68bba7 100644 --- a/src/test/regress/expected/am_vacuum.out +++ b/src/test/regress/expected/am_vacuum.out @@ -1,5 +1,5 @@ SELECT count(*) AS columnar_table_count FROM cstore.cstore_data_files \gset -CREATE TABLE t(a int, b int) USING cstore_tableam; +CREATE TABLE t(a int, b int) USING columnar; SELECT count(*) FROM cstore.cstore_stripes a, pg_class b WHERE a.relfilenode=b.relfilenode AND b.relname='t'; count --------------------------------------------------------------------- diff --git a/src/test/regress/expected/multi_extension.out b/src/test/regress/expected/multi_extension.out index 08f92c034..a208e02d9 100644 --- a/src/test/regress/expected/multi_extension.out +++ b/src/test/regress/expected/multi_extension.out @@ -477,7 +477,7 @@ ALTER EXTENSION citus UPDATE TO '10.0-1'; SELECT * FROM print_extension_changes(); previous_object | current_object --------------------------------------------------------------------- - | access method cstore_tableam + | access method columnar | event trigger cstore_ddl_event_end | foreign-data wrapper cstore_fdw | function alter_cstore_table_reset(regclass,boolean,boolean,boolean) @@ -486,13 +486,13 @@ SELECT * FROM print_extension_changes(); | function cstore.cstore_ddl_event_end_trigger() | function cstore.cstore_fdw_handler() | function cstore.cstore_fdw_validator(text[],oid) - | function cstore.cstore_tableam_handler(internal) + | function cstore.columnar_handler(internal) | function cstore_table_size(regclass) | schema cstore | table cstore.cstore_data_files | table cstore.cstore_skipnodes | table cstore.cstore_stripes - | view cstore.cstore_options + | view cstore.columnar_options (16 rows) DROP TABLE prev_objects, extension_diff; diff --git a/src/test/regress/expected/multi_extension_0.out b/src/test/regress/expected/multi_extension_0.out index 9605e9d32..57811d164 100644 --- a/src/test/regress/expected/multi_extension_0.out +++ b/src/test/regress/expected/multi_extension_0.out @@ -488,7 +488,7 @@ SELECT * FROM print_extension_changes(); | table cstore.cstore_data_files | table cstore.cstore_skipnodes | table cstore.cstore_stripes - | view cstore.cstore_options + | view cstore.columnar_options (12 rows) DROP TABLE prev_objects, extension_diff; diff --git a/src/test/regress/expected/upgrade_list_citus_objects.out b/src/test/regress/expected/upgrade_list_citus_objects.out index 4eb6216fc..f0d75e7f8 100644 --- a/src/test/regress/expected/upgrade_list_citus_objects.out +++ b/src/test/regress/expected/upgrade_list_citus_objects.out @@ -16,7 +16,7 @@ WHERE refclassid = 'pg_catalog.pg_extension'::pg_catalog.regclass ORDER BY 1; description --------------------------------------------------------------------- - access method cstore_tableam + access method columnar event trigger citus_cascade_to_partition event trigger cstore_ddl_event_end foreign-data wrapper cstore_fdw @@ -85,7 +85,7 @@ ORDER BY 1; function cstore.cstore_ddl_event_end_trigger() function cstore.cstore_fdw_handler() function cstore.cstore_fdw_validator(text[],oid) - function cstore.cstore_tableam_handler(internal) + function cstore.columnar_handler(internal) function cstore_table_size(regclass) function distributed_tables_colocated(regclass,regclass) function dump_global_wait_edges() @@ -221,7 +221,7 @@ ORDER BY 1; view citus_shards_on_worker view citus_stat_statements view citus_worker_stat_activity - view cstore.cstore_options + view cstore.columnar_options view pg_dist_shard_placement (207 rows) diff --git a/src/test/regress/expected/upgrade_list_citus_objects_0.out b/src/test/regress/expected/upgrade_list_citus_objects_0.out index 03a4054e5..2c6e4a4bb 100644 --- a/src/test/regress/expected/upgrade_list_citus_objects_0.out +++ b/src/test/regress/expected/upgrade_list_citus_objects_0.out @@ -217,7 +217,7 @@ ORDER BY 1; view citus_shards_on_worker view citus_stat_statements view citus_worker_stat_activity - view cstore.cstore_options + view cstore.columnar_options view pg_dist_shard_placement (203 rows) diff --git a/src/test/regress/input/am_block_filtering.source b/src/test/regress/input/am_block_filtering.source index f93eb1988..6ec280998 100644 --- a/src/test/regress/input/am_block_filtering.source +++ b/src/test/regress/input/am_block_filtering.source @@ -32,7 +32,7 @@ $$ LANGUAGE PLPGSQL; set cstore.stripe_row_count = 2000; set cstore.block_row_count = 1000; CREATE TABLE test_block_filtering (a int) - USING cstore_tableam; + USING columnar; COPY test_block_filtering FROM '@abs_srcdir@/data/block_filtering.csv' WITH CSV; @@ -63,7 +63,7 @@ set cstore.block_row_count to default; -- Verify that we are fine with collations which use a different alphabet order CREATE TABLE collation_block_filtering_test(A text collate "da_DK") - USING cstore_tableam; + USING columnar; COPY collation_block_filtering_test FROM STDIN; A Å diff --git a/src/test/regress/input/am_copyto.source b/src/test/regress/input/am_copyto.source index bb333bacf..622fb9efa 100644 --- a/src/test/regress/input/am_copyto.source +++ b/src/test/regress/input/am_copyto.source @@ -3,7 +3,7 @@ -- CREATE TABLE test_contestant(handle TEXT, birthdate DATE, rating INT, percentile FLOAT, country CHAR(3), achievements TEXT[]) - USING cstore_tableam; + USING columnar; -- load table data from file COPY test_contestant FROM '@abs_srcdir@/data/contestants.1.csv' WITH CSV; diff --git a/src/test/regress/input/am_create.source b/src/test/regress/input/am_create.source index 6d4d5a388..038da3398 100644 --- a/src/test/regress/input/am_create.source +++ b/src/test/regress/input/am_create.source @@ -6,14 +6,14 @@ -- Create uncompressed table CREATE TABLE contestant (handle TEXT, birthdate DATE, rating INT, percentile FLOAT, country CHAR(3), achievements TEXT[]) - USING cstore_tableam; + USING columnar; -- Create compressed table with automatically determined file path -- COMPRESSED CREATE TABLE contestant_compressed (handle TEXT, birthdate DATE, rating INT, percentile FLOAT, country CHAR(3), achievements TEXT[]) - USING cstore_tableam; + USING columnar; -- Test that querying an empty table works ANALYZE contestant; diff --git a/src/test/regress/input/am_data_types.source b/src/test/regress/input/am_data_types.source index 24c661090..ddb543a69 100644 --- a/src/test/regress/input/am_data_types.source +++ b/src/test/regress/input/am_data_types.source @@ -11,7 +11,7 @@ SET intervalstyle TO 'POSTGRES_VERBOSE'; -- Test array types CREATE TABLE test_array_types (int_array int[], bigint_array bigint[], - text_array text[]) USING cstore_tableam; + text_array text[]) USING columnar; COPY test_array_types FROM '@abs_srcdir@/data/array_types.csv' WITH CSV; @@ -21,7 +21,7 @@ SELECT * FROM test_array_types; -- Test date/time types CREATE TABLE test_datetime_types (timestamp timestamp, timestamp_with_timezone timestamp with time zone, date date, time time, - interval interval) USING cstore_tableam; + interval interval) USING columnar; COPY test_datetime_types FROM '@abs_srcdir@/data/datetime_types.csv' WITH CSV; @@ -33,7 +33,7 @@ CREATE TYPE enum_type AS ENUM ('a', 'b', 'c'); CREATE TYPE composite_type AS (a int, b text); CREATE TABLE test_enum_and_composite_types (enum enum_type, - composite composite_type) USING cstore_tableam; + composite composite_type) USING columnar; COPY test_enum_and_composite_types FROM '@abs_srcdir@/data/enum_and_composite_types.csv' WITH CSV; @@ -43,7 +43,7 @@ SELECT * FROM test_enum_and_composite_types; -- Test range types CREATE TABLE test_range_types (int4range int4range, int8range int8range, - numrange numrange, tsrange tsrange) USING cstore_tableam; + numrange numrange, tsrange tsrange) USING columnar; COPY test_range_types FROM '@abs_srcdir@/data/range_types.csv' WITH CSV; @@ -52,7 +52,7 @@ SELECT * FROM test_range_types; -- Test other types CREATE TABLE test_other_types (bool boolean, bytea bytea, money money, - inet inet, bitstring bit varying(5), uuid uuid, json json) USING cstore_tableam; + inet inet, bitstring bit varying(5), uuid uuid, json json) USING columnar; COPY test_other_types FROM '@abs_srcdir@/data/other_types.csv' WITH CSV; @@ -61,7 +61,7 @@ SELECT * FROM test_other_types; -- Test null values CREATE TABLE test_null_values (a int, b int[], c composite_type) - USING cstore_tableam; + USING columnar; COPY test_null_values FROM '@abs_srcdir@/data/null_values.csv' WITH CSV; diff --git a/src/test/regress/input/am_load.source b/src/test/regress/input/am_load.source index d0ef9bfac..dbd9160d2 100644 --- a/src/test/regress/input/am_load.source +++ b/src/test/regress/input/am_load.source @@ -26,7 +26,7 @@ set cstore.compression to default; -- Test column list CREATE TABLE famous_constants (id int, name text, value real) - USING cstore_tableam; + USING columnar; COPY famous_constants (value, name, id) FROM STDIN WITH CSV; 3.141,pi,1 2.718,e,2 diff --git a/src/test/regress/output/am_block_filtering.source b/src/test/regress/output/am_block_filtering.source index 45cb702b6..ed0294de4 100644 --- a/src/test/regress/output/am_block_filtering.source +++ b/src/test/regress/output/am_block_filtering.source @@ -28,7 +28,7 @@ $$ LANGUAGE PLPGSQL; set cstore.stripe_row_count = 2000; set cstore.block_row_count = 1000; CREATE TABLE test_block_filtering (a int) - USING cstore_tableam; + USING columnar; COPY test_block_filtering FROM '@abs_srcdir@/data/block_filtering.csv' WITH CSV; -- Verify that filtered_row_count is less than 1000 for the following queries SELECT filtered_row_count('SELECT count(*) FROM test_block_filtering'); @@ -110,7 +110,7 @@ set cstore.stripe_row_count to default; set cstore.block_row_count to default; -- Verify that we are fine with collations which use a different alphabet order CREATE TABLE collation_block_filtering_test(A text collate "da_DK") - USING cstore_tableam; + USING columnar; COPY collation_block_filtering_test FROM STDIN; SELECT * FROM collation_block_filtering_test WHERE A > 'B'; a diff --git a/src/test/regress/output/am_copyto.source b/src/test/regress/output/am_copyto.source index 127bdc65d..48c43ca0a 100644 --- a/src/test/regress/output/am_copyto.source +++ b/src/test/regress/output/am_copyto.source @@ -3,7 +3,7 @@ -- CREATE TABLE test_contestant(handle TEXT, birthdate DATE, rating INT, percentile FLOAT, country CHAR(3), achievements TEXT[]) - USING cstore_tableam; + USING columnar; -- load table data from file COPY test_contestant FROM '@abs_srcdir@/data/contestants.1.csv' WITH CSV; -- export using COPY table TO ... diff --git a/src/test/regress/output/am_create.source b/src/test/regress/output/am_create.source index 47c6a6c44..23f4b874b 100644 --- a/src/test/regress/output/am_create.source +++ b/src/test/regress/output/am_create.source @@ -4,12 +4,12 @@ -- Create uncompressed table CREATE TABLE contestant (handle TEXT, birthdate DATE, rating INT, percentile FLOAT, country CHAR(3), achievements TEXT[]) - USING cstore_tableam; + USING columnar; -- Create compressed table with automatically determined file path -- COMPRESSED CREATE TABLE contestant_compressed (handle TEXT, birthdate DATE, rating INT, percentile FLOAT, country CHAR(3), achievements TEXT[]) - USING cstore_tableam; + USING columnar; -- Test that querying an empty table works ANALYZE contestant; SELECT count(*) FROM contestant; diff --git a/src/test/regress/output/am_data_types.source b/src/test/regress/output/am_data_types.source index 8431e6ca2..3c79c6cfe 100644 --- a/src/test/regress/output/am_data_types.source +++ b/src/test/regress/output/am_data_types.source @@ -7,7 +7,7 @@ SET timezone to 'GMT'; SET intervalstyle TO 'POSTGRES_VERBOSE'; -- Test array types CREATE TABLE test_array_types (int_array int[], bigint_array bigint[], - text_array text[]) USING cstore_tableam; + text_array text[]) USING columnar; COPY test_array_types FROM '@abs_srcdir@/data/array_types.csv' WITH CSV; SELECT * FROM test_array_types; int_array | bigint_array | text_array @@ -20,7 +20,7 @@ SELECT * FROM test_array_types; -- Test date/time types CREATE TABLE test_datetime_types (timestamp timestamp, timestamp_with_timezone timestamp with time zone, date date, time time, - interval interval) USING cstore_tableam; + interval interval) USING columnar; COPY test_datetime_types FROM '@abs_srcdir@/data/datetime_types.csv' WITH CSV; SELECT * FROM test_datetime_types; timestamp | timestamp_with_timezone | date | time | interval @@ -33,7 +33,7 @@ SELECT * FROM test_datetime_types; CREATE TYPE enum_type AS ENUM ('a', 'b', 'c'); CREATE TYPE composite_type AS (a int, b text); CREATE TABLE test_enum_and_composite_types (enum enum_type, - composite composite_type) USING cstore_tableam; + composite composite_type) USING columnar; COPY test_enum_and_composite_types FROM '@abs_srcdir@/data/enum_and_composite_types.csv' WITH CSV; SELECT * FROM test_enum_and_composite_types; @@ -45,7 +45,7 @@ SELECT * FROM test_enum_and_composite_types; -- Test range types CREATE TABLE test_range_types (int4range int4range, int8range int8range, - numrange numrange, tsrange tsrange) USING cstore_tableam; + numrange numrange, tsrange tsrange) USING columnar; COPY test_range_types FROM '@abs_srcdir@/data/range_types.csv' WITH CSV; SELECT * FROM test_range_types; int4range | int8range | numrange | tsrange @@ -56,7 +56,7 @@ SELECT * FROM test_range_types; -- Test other types CREATE TABLE test_other_types (bool boolean, bytea bytea, money money, - inet inet, bitstring bit varying(5), uuid uuid, json json) USING cstore_tableam; + inet inet, bitstring bit varying(5), uuid uuid, json json) USING columnar; COPY test_other_types FROM '@abs_srcdir@/data/other_types.csv' WITH CSV; SELECT * FROM test_other_types; bool | bytea | money | inet | bitstring | uuid | json @@ -67,7 +67,7 @@ SELECT * FROM test_other_types; -- Test null values CREATE TABLE test_null_values (a int, b int[], c composite_type) - USING cstore_tableam; + USING columnar; COPY test_null_values FROM '@abs_srcdir@/data/null_values.csv' WITH CSV; SELECT * FROM test_null_values; a | b | c diff --git a/src/test/regress/output/am_load.source b/src/test/regress/output/am_load.source index 5eb81a250..6c80f9889 100644 --- a/src/test/regress/output/am_load.source +++ b/src/test/regress/output/am_load.source @@ -23,7 +23,7 @@ COPY contestant_compressed FROM PROGRAM 'cat @abs_srcdir@/data/contestants.2.csv set cstore.compression to default; -- Test column list CREATE TABLE famous_constants (id int, name text, value real) - USING cstore_tableam; + USING columnar; COPY famous_constants (value, name, id) FROM STDIN WITH CSV; COPY famous_constants (name, value) FROM STDIN WITH CSV; SELECT * FROM famous_constants ORDER BY id, name; diff --git a/src/test/regress/spec/am_vacuum_vs_insert.spec b/src/test/regress/spec/am_vacuum_vs_insert.spec index 59c7274d5..dcc744059 100644 --- a/src/test/regress/spec/am_vacuum_vs_insert.spec +++ b/src/test/regress/spec/am_vacuum_vs_insert.spec @@ -1,6 +1,6 @@ setup { - CREATE TABLE test_vacuum_vs_insert (a int, b int) USING cstore_tableam; + CREATE TABLE test_vacuum_vs_insert (a int, b int) USING columnar; } teardown diff --git a/src/test/regress/spec/am_write_concurrency.spec b/src/test/regress/spec/am_write_concurrency.spec index 7b5d90a4d..4b2525bd5 100644 --- a/src/test/regress/spec/am_write_concurrency.spec +++ b/src/test/regress/spec/am_write_concurrency.spec @@ -1,6 +1,6 @@ setup { - CREATE TABLE test_insert_concurrency (a int, b int) USING cstore_tableam; + CREATE TABLE test_insert_concurrency (a int, b int) USING columnar; } teardown diff --git a/src/test/regress/sql/am_alter.sql b/src/test/regress/sql/am_alter.sql index 3b608f9cd..13f17fef2 100644 --- a/src/test/regress/sql/am_alter.sql +++ b/src/test/regress/sql/am_alter.sql @@ -2,7 +2,7 @@ -- Testing ALTER TABLE on cstore_fdw tables. -- -CREATE TABLE test_alter_table (a int, b int, c int) USING cstore_tableam; +CREATE TABLE test_alter_table (a int, b int, c int) USING columnar; WITH sample_data AS (VALUES (1, 2, 3), diff --git a/src/test/regress/sql/am_drop.sql b/src/test/regress/sql/am_drop.sql index 7958a1407..123f8025c 100644 --- a/src/test/regress/sql/am_drop.sql +++ b/src/test/regress/sql/am_drop.sql @@ -26,7 +26,7 @@ SELECT :cstore_data_files_before_drop - count(*) FROM cstore.cstore_data_files; -- Create a cstore_fdw table under a schema and drop it. CREATE SCHEMA test_schema; -CREATE TABLE test_schema.test_table(data int) USING cstore_tableam; +CREATE TABLE test_schema.test_table(data int) USING columnar; SELECT count(*) AS cstore_data_files_before_drop FROM cstore.cstore_data_files \gset DROP SCHEMA test_schema CASCADE; @@ -39,7 +39,7 @@ CREATE DATABASE db_to_drop; CREATE EXTENSION citus; SELECT oid::text databaseoid FROM pg_database WHERE datname = current_database() \gset -CREATE TABLE test_table(data int) USING cstore_tableam; +CREATE TABLE test_table(data int) USING columnar; DROP EXTENSION citus CASCADE; @@ -47,7 +47,7 @@ DROP EXTENSION citus CASCADE; CREATE EXTENSION citus; SELECT oid::text databaseoid FROM pg_database WHERE datname = current_database() \gset -CREATE TABLE test_table(data int) USING cstore_tableam; +CREATE TABLE test_table(data int) USING columnar; \c :datname diff --git a/src/test/regress/sql/am_functions.sql b/src/test/regress/sql/am_functions.sql index 1945eeb46..14e4c6f2b 100644 --- a/src/test/regress/sql/am_functions.sql +++ b/src/test/regress/sql/am_functions.sql @@ -2,8 +2,8 @@ -- Test utility functions for cstore_fdw tables. -- -CREATE TABLE empty_table (a int) USING cstore_tableam; -CREATE TABLE table_with_data (a int) USING cstore_tableam; +CREATE TABLE empty_table (a int) USING columnar; +CREATE TABLE table_with_data (a int) USING columnar; CREATE TABLE non_cstore_table (a int); COPY table_with_data FROM STDIN; diff --git a/src/test/regress/sql/am_insert.sql b/src/test/regress/sql/am_insert.sql index 5a6d7d385..cfffda616 100644 --- a/src/test/regress/sql/am_insert.sql +++ b/src/test/regress/sql/am_insert.sql @@ -2,7 +2,7 @@ -- Testing insert on cstore_fdw tables. -- -CREATE TABLE test_insert_command (a int) USING cstore_tableam; +CREATE TABLE test_insert_command (a int) USING columnar; -- test single row inserts fail select count(*) from test_insert_command; @@ -38,7 +38,7 @@ SELECT int_val, md5(text_val) AS hash FROM test_long_text; CREATE TABLE test_cstore_long_text(int_val int, text_val text) -USING cstore_tableam; +USING columnar; -- store long text in cstore table INSERT INTO test_cstore_long_text SELECT * FROM test_long_text; diff --git a/src/test/regress/sql/am_join.sql b/src/test/regress/sql/am_join.sql index 4d78dfe5b..2b7cc7388 100644 --- a/src/test/regress/sql/am_join.sql +++ b/src/test/regress/sql/am_join.sql @@ -1,10 +1,10 @@ CREATE SCHEMA am_cstore_join; SET search_path TO am_cstore_join; -CREATE TABLE users (id int, name text) USING cstore_tableam; +CREATE TABLE users (id int, name text) USING columnar; INSERT INTO users SELECT a, 'name' || a FROM generate_series(0,30-1) AS a; -CREATE TABLE things (id int, user_id int, name text) USING cstore_tableam; +CREATE TABLE things (id int, user_id int, name text) USING columnar; INSERT INTO things SELECT a, a % 30, 'thing' || a FROM generate_series(1,300) AS a; -- force the nested loop to rescan the table diff --git a/src/test/regress/sql/am_matview.sql b/src/test/regress/sql/am_matview.sql index a87b68b43..9ea0886d8 100644 --- a/src/test/regress/sql/am_matview.sql +++ b/src/test/regress/sql/am_matview.sql @@ -2,11 +2,11 @@ -- Testing we materialized views properly -- -CREATE TABLE t(a int, b int) USING cstore_tableam; +CREATE TABLE t(a int, b int) USING columnar; INSERT INTO t SELECT floor(i / 4), 2 * i FROM generate_series(1, 10) i; -CREATE MATERIALIZED VIEW t_view(a, bsum, cnt) USING cstore_tableam AS +CREATE MATERIALIZED VIEW t_view(a, bsum, cnt) USING columnar AS SELECT a, sum(b), count(*) FROM t GROUP BY a; SELECT * FROM t_view a ORDER BY a; diff --git a/src/test/regress/sql/am_query.sql b/src/test/regress/sql/am_query.sql index 7ac8c2ea4..85135370a 100644 --- a/src/test/regress/sql/am_query.sql +++ b/src/test/regress/sql/am_query.sql @@ -23,8 +23,8 @@ SELECT * FROM contestant_compressed ORDER BY handle; SELECT to_json(v) FROM contestant v ORDER BY rating LIMIT 1; -- Test variables used in expressions -CREATE TABLE union_first (a int, b int) USING cstore_tableam; -CREATE TABLE union_second (a int, b int) USING cstore_tableam; +CREATE TABLE union_first (a int, b int) USING columnar; +CREATE TABLE union_second (a int, b int) USING columnar; INSERT INTO union_first SELECT a, a FROM generate_series(1, 5) a; INSERT INTO union_second SELECT a, a FROM generate_series(11, 15) a; diff --git a/src/test/regress/sql/am_recursive.sql b/src/test/regress/sql/am_recursive.sql index 1e3d6dc06..6c7a53365 100644 --- a/src/test/regress/sql/am_recursive.sql +++ b/src/test/regress/sql/am_recursive.sql @@ -1,6 +1,6 @@ -CREATE TABLE t1(a int, b int) USING cstore_tableam; -CREATE TABLE t2(a int, b int) USING cstore_tableam; +CREATE TABLE t1(a int, b int) USING columnar; +CREATE TABLE t2(a int, b int) USING columnar; CREATE FUNCTION f(x INT) RETURNS INT AS $$ INSERT INTO t1 VALUES(x, x * 2) RETURNING b - 1; diff --git a/src/test/regress/sql/am_rollback.sql b/src/test/regress/sql/am_rollback.sql index bda02152e..91371c64b 100644 --- a/src/test/regress/sql/am_rollback.sql +++ b/src/test/regress/sql/am_rollback.sql @@ -2,7 +2,7 @@ -- Testing we handle rollbacks properly -- -CREATE TABLE t(a int, b int) USING cstore_tableam; +CREATE TABLE t(a int, b int) USING columnar; BEGIN; INSERT INTO t SELECT i, i+1 FROM generate_series(1, 10) i; diff --git a/src/test/regress/sql/am_tableoptions.sql b/src/test/regress/sql/am_tableoptions.sql index 33f26ec76..93159a49a 100644 --- a/src/test/regress/sql/am_tableoptions.sql +++ b/src/test/regress/sql/am_tableoptions.sql @@ -1,46 +1,46 @@ CREATE SCHEMA am_tableoptions; SET search_path TO am_tableoptions; -CREATE TABLE table_options (a int) USING cstore_tableam; +CREATE TABLE table_options (a int) USING columnar; INSERT INTO table_options SELECT generate_series(1,100); -- show table_options settings -SELECT * FROM cstore.cstore_options +SELECT * FROM cstore.columnar_options WHERE regclass = 'table_options'::regclass; -- test changing the compression SELECT alter_cstore_table_set('table_options', compression => 'pglz'); -- show table_options settings -SELECT * FROM cstore.cstore_options +SELECT * FROM cstore.columnar_options WHERE regclass = 'table_options'::regclass; -- test changing the block_row_count SELECT alter_cstore_table_set('table_options', block_row_count => 10); -- show table_options settings -SELECT * FROM cstore.cstore_options +SELECT * FROM cstore.columnar_options WHERE regclass = 'table_options'::regclass; -- test changing the block_row_count SELECT alter_cstore_table_set('table_options', stripe_row_count => 100); -- show table_options settings -SELECT * FROM cstore.cstore_options +SELECT * FROM cstore.columnar_options WHERE regclass = 'table_options'::regclass; -- VACUUM FULL creates a new table, make sure it copies settings from the table you are vacuuming VACUUM FULL table_options; -- show table_options settings -SELECT * FROM cstore.cstore_options +SELECT * FROM cstore.columnar_options WHERE regclass = 'table_options'::regclass; -- set all settings at the same time SELECT alter_cstore_table_set('table_options', stripe_row_count => 1000, block_row_count => 100, compression => 'none'); -- show table_options settings -SELECT * FROM cstore.cstore_options +SELECT * FROM cstore.columnar_options WHERE regclass = 'table_options'::regclass; -- reset settings one by one to the version of the GUC's @@ -50,24 +50,24 @@ SET cstore.compression TO 'pglz'; -- verify setting the GUC's didn't change the settings -- show table_options settings -SELECT * FROM cstore.cstore_options +SELECT * FROM cstore.columnar_options WHERE regclass = 'table_options'::regclass; SELECT alter_cstore_table_reset('table_options', block_row_count => true); -- show table_options settings -SELECT * FROM cstore.cstore_options +SELECT * FROM cstore.columnar_options WHERE regclass = 'table_options'::regclass; SELECT alter_cstore_table_reset('table_options', stripe_row_count => true); -- show table_options settings -SELECT * FROM cstore.cstore_options +SELECT * FROM cstore.columnar_options WHERE regclass = 'table_options'::regclass; SELECT alter_cstore_table_reset('table_options', compression => true); -- show table_options settings -SELECT * FROM cstore.cstore_options +SELECT * FROM cstore.columnar_options WHERE regclass = 'table_options'::regclass; -- verify resetting all settings at once work @@ -76,7 +76,7 @@ SET cstore.stripe_row_count TO 100000; SET cstore.compression TO 'none'; -- show table_options settings -SELECT * FROM cstore.cstore_options +SELECT * FROM cstore.columnar_options WHERE regclass = 'table_options'::regclass; SELECT alter_cstore_table_reset( @@ -86,7 +86,7 @@ SELECT alter_cstore_table_reset( compression => true); -- show table_options settings -SELECT * FROM cstore.cstore_options +SELECT * FROM cstore.columnar_options WHERE regclass = 'table_options'::regclass; -- verify edge cases diff --git a/src/test/regress/sql/am_transactions.sql b/src/test/regress/sql/am_transactions.sql index b99da0313..c7b10355f 100644 --- a/src/test/regress/sql/am_transactions.sql +++ b/src/test/regress/sql/am_transactions.sql @@ -2,7 +2,7 @@ -- Testing we handle transactions properly -- -CREATE TABLE t(a int, b int) USING cstore_tableam; +CREATE TABLE t(a int, b int) USING columnar; INSERT INTO t SELECT i, 2 * i FROM generate_series(1, 3) i; SELECT * FROM t ORDER BY a; diff --git a/src/test/regress/sql/am_trigger.sql b/src/test/regress/sql/am_trigger.sql index 3cdd53b44..5abb3a4ea 100644 --- a/src/test/regress/sql/am_trigger.sql +++ b/src/test/regress/sql/am_trigger.sql @@ -40,7 +40,7 @@ BEGIN END; $$; -create table test_tr(i int) using cstore_tableam; +create table test_tr(i int) using columnar; create trigger tr_before_stmt before insert on test_tr for each statement execute procedure trs_before(); @@ -61,7 +61,7 @@ insert into test_tr values(2),(3),(4); SELECT * FROM test_tr ORDER BY i; drop table test_tr; -create table test_tr(i int) using cstore_tableam; +create table test_tr(i int) using columnar; -- we should be able to clean-up and continue gracefully if we -- error out in AFTER STATEMENT triggers. @@ -102,13 +102,13 @@ create table events( create table events_p2020_11_04_102965 PARTITION OF events FOR VALUES FROM ('2020-11-04 00:00:00+01') TO ('2020-11-05 00:00:00+01') -USING cstore_tableam; +USING columnar; create table events_trigger_target( user_id bigint, avg float, __count__ bigint -) USING cstore_tableam; +) USING columnar; CREATE OR REPLACE FUNCTION user_value_by_day() RETURNS trigger diff --git a/src/test/regress/sql/am_truncate.sql b/src/test/regress/sql/am_truncate.sql index 50a472144..3d331d400 100644 --- a/src/test/regress/sql/am_truncate.sql +++ b/src/test/regress/sql/am_truncate.sql @@ -7,10 +7,10 @@ SHOW server_version \gset SELECT substring(:'server_version', '\d+')::int > 10 AS version_above_ten; -- CREATE a cstore_fdw table, fill with some data -- -CREATE TABLE cstore_truncate_test (a int, b int) USING cstore_tableam; -CREATE TABLE cstore_truncate_test_second (a int, b int) USING cstore_tableam; +CREATE TABLE cstore_truncate_test (a int, b int) USING columnar; +CREATE TABLE cstore_truncate_test_second (a int, b int) USING columnar; -- COMPRESSED -CREATE TABLE cstore_truncate_test_compressed (a int, b int) USING cstore_tableam; +CREATE TABLE cstore_truncate_test_compressed (a int, b int) USING columnar; CREATE TABLE cstore_truncate_test_regular (a int, b int); SELECT count(*) AS cstore_data_files_before_truncate FROM cstore.cstore_data_files \gset @@ -67,7 +67,7 @@ SELECT :cstore_data_files_before_truncate - count(*) FROM cstore.cstore_data_fil -- test if truncation in the same transaction that created the table works properly BEGIN; -CREATE TABLE cstore_same_transaction_truncate(a int) USING cstore_tableam; +CREATE TABLE cstore_same_transaction_truncate(a int) USING columnar; INSERT INTO cstore_same_transaction_truncate SELECT * FROM generate_series(1, 100); TRUNCATE cstore_same_transaction_truncate; INSERT INTO cstore_same_transaction_truncate SELECT * FROM generate_series(20, 23); @@ -99,7 +99,7 @@ DROP TABLE cstore_truncate_test_compressed; -- test truncate with schema CREATE SCHEMA truncate_schema; -- COMPRESSED -CREATE TABLE truncate_schema.truncate_tbl (id int) USING cstore_tableam; +CREATE TABLE truncate_schema.truncate_tbl (id int) USING columnar; set cstore.compression = 'pglz'; INSERT INTO truncate_schema.truncate_tbl SELECT generate_series(1, 100); set cstore.compression to default; diff --git a/src/test/regress/sql/am_vacuum.sql b/src/test/regress/sql/am_vacuum.sql index 6d248a147..c244543bb 100644 --- a/src/test/regress/sql/am_vacuum.sql +++ b/src/test/regress/sql/am_vacuum.sql @@ -1,6 +1,6 @@ SELECT count(*) AS columnar_table_count FROM cstore.cstore_data_files \gset -CREATE TABLE t(a int, b int) USING cstore_tableam; +CREATE TABLE t(a int, b int) USING columnar; SELECT count(*) FROM cstore.cstore_stripes a, pg_class b WHERE a.relfilenode=b.relfilenode AND b.relname='t';