Only allow columnar tables with permanent storage (#4492). (#4495)

Co-authored-by: Jeff Davis <jefdavi@microsoft.com>
pull/4506/head
jeff-davis 2021-01-13 10:37:34 -08:00 committed by GitHub
parent b49beda4c3
commit ec319faa43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 0 deletions

View File

@ -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());

View File

@ -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
--

View File

@ -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
--