Block compression policy with dist hypertable

Issue: #2193
This commit is contained in:
Dmitry Simonenko 2020-09-08 14:08:14 +03:00
parent 0641f9dba2
commit f30d15a997
3 changed files with 20 additions and 0 deletions

View File

@ -118,6 +118,15 @@ policy_compression_add(PG_FUNCTION_ARGS)
/* check if this is a table with compression enabled */
hypertable = ts_hypertable_cache_get_cache_and_entry(ht_oid, CACHE_FLAG_NONE, &hcache);
if (hypertable_is_distributed(hypertable))
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("add_compression_policy not implemented for distributed hypertable"),
errdetail(
"Current version doesn't implement support for add_compression_policy() on "
"distributed hypertables.")));
if (!TS_HYPERTABLE_HAS_COMPRESSION(hypertable))
{
ts_cache_release(hcache);

View File

@ -319,3 +319,9 @@ SELECT * FROM hypertable_detailed_size('compressed'::regclass) ORDER BY node_nam
16384 | 65536 | 0 | 81920 | db_dist_compression_3
(3 rows)
-- Test compression policy with distributed hypertable
--
\set ON_ERROR_STOP 0
SELECT add_compression_policy('compressed', '60d'::interval);
ERROR: add_compression_policy not implemented for distributed hypertable
\set ON_ERROR_STOP 1

View File

@ -100,3 +100,8 @@ SELECT * FROM chunks_detailed_size('compressed'::regclass)
ORDER BY chunk_name, node_name;
SELECT * FROM hypertable_detailed_size('compressed'::regclass) ORDER BY node_name;
-- Test compression policy with distributed hypertable
--
\set ON_ERROR_STOP 0
SELECT add_compression_policy('compressed', '60d'::interval);
\set ON_ERROR_STOP 1