diff --git a/src/backend/columnar/cstore_tableam.c b/src/backend/columnar/cstore_tableam.c index d87ba612b..293935e56 100644 --- a/src/backend/columnar/cstore_tableam.c +++ b/src/backend/columnar/cstore_tableam.c @@ -557,6 +557,12 @@ cstore_relation_set_new_filenode(Relation rel, TransactionId *freezeXid, MultiXactId *minmulti) { + if (persistence != RELPERSISTENCE_PERMANENT) + { + ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("only permanent columnar tables are supported"))); + } + Oid oldRelfilenode = rel->rd_node.relNode; MarkRelfilenodeDropped(oldRelfilenode, GetCurrentSubTransactionId()); diff --git a/src/test/regress/expected/am_create.out b/src/test/regress/expected/am_create.out index 9ca01ca16..5fcd6a1a9 100644 --- a/src/test/regress/expected/am_create.out +++ b/src/test/regress/expected/am_create.out @@ -21,6 +21,12 @@ SELECT count(*) FROM contestant; 0 (1 row) +-- Should fail: unlogged tables not supported +CREATE UNLOGGED TABLE columnar_unlogged(i int) USING columnar; +ERROR: only permanent columnar tables are supported +-- Should fail: temporary tables not supported +CREATE TEMPORARY TABLE columnar_temp(i int) USING columnar; +ERROR: only permanent columnar tables are supported -- -- Utility functions to be used throughout tests -- diff --git a/src/test/regress/sql/am_create.sql b/src/test/regress/sql/am_create.sql index 611b70469..fbe71a8f4 100644 --- a/src/test/regress/sql/am_create.sql +++ b/src/test/regress/sql/am_create.sql @@ -21,6 +21,12 @@ CREATE TABLE contestant_compressed (handle TEXT, birthdate DATE, rating INT, ANALYZE contestant; SELECT count(*) FROM contestant; +-- Should fail: unlogged tables not supported +CREATE UNLOGGED TABLE columnar_unlogged(i int) USING columnar; + +-- Should fail: temporary tables not supported +CREATE TEMPORARY TABLE columnar_temp(i int) USING columnar; + -- -- Utility functions to be used throughout tests --