mirror of https://github.com/citusdata/citus.git
Allow citus size functions on replicated tables
parent
f164575524
commit
4098d33acb
|
@ -367,14 +367,6 @@ ErrorIfNotSuitableToGetSize(Oid relationId)
|
||||||
errmsg("cannot calculate the size because relation %s is not "
|
errmsg("cannot calculate the size because relation %s is not "
|
||||||
"distributed", escapedQueryString)));
|
"distributed", escapedQueryString)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsCitusTableType(relationId, HASH_DISTRIBUTED) &&
|
|
||||||
!SingleReplicatedTable(relationId))
|
|
||||||
{
|
|
||||||
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
|
||||||
errmsg("cannot calculate the size because replication factor "
|
|
||||||
"is greater than 1")));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -22,12 +22,25 @@ SELECT citus_total_relation_size('non_distributed_table');
|
||||||
ERROR: cannot calculate the size because relation 'non_distributed_table' is not distributed
|
ERROR: cannot calculate the size because relation 'non_distributed_table' is not distributed
|
||||||
DROP TABLE non_distributed_table;
|
DROP TABLE non_distributed_table;
|
||||||
-- Tests on distributed table with replication factor > 1
|
-- Tests on distributed table with replication factor > 1
|
||||||
|
VACUUM (FULL) lineitem_hash_part;
|
||||||
SELECT citus_table_size('lineitem_hash_part');
|
SELECT citus_table_size('lineitem_hash_part');
|
||||||
ERROR: cannot calculate the size because replication factor is greater than 1
|
citus_table_size
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
3801088
|
||||||
|
(1 row)
|
||||||
|
|
||||||
SELECT citus_relation_size('lineitem_hash_part');
|
SELECT citus_relation_size('lineitem_hash_part');
|
||||||
ERROR: cannot calculate the size because replication factor is greater than 1
|
citus_relation_size
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
3801088
|
||||||
|
(1 row)
|
||||||
|
|
||||||
SELECT citus_total_relation_size('lineitem_hash_part');
|
SELECT citus_total_relation_size('lineitem_hash_part');
|
||||||
ERROR: cannot calculate the size because replication factor is greater than 1
|
citus_total_relation_size
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
3801088
|
||||||
|
(1 row)
|
||||||
|
|
||||||
VACUUM (FULL) customer_copy_hash;
|
VACUUM (FULL) customer_copy_hash;
|
||||||
-- Tests on distributed tables with streaming replication.
|
-- Tests on distributed tables with streaming replication.
|
||||||
SELECT citus_table_size('customer_copy_hash');
|
SELECT citus_table_size('customer_copy_hash');
|
||||||
|
|
|
@ -20,6 +20,8 @@ SELECT citus_total_relation_size('non_distributed_table');
|
||||||
DROP TABLE non_distributed_table;
|
DROP TABLE non_distributed_table;
|
||||||
|
|
||||||
-- Tests on distributed table with replication factor > 1
|
-- Tests on distributed table with replication factor > 1
|
||||||
|
VACUUM (FULL) lineitem_hash_part;
|
||||||
|
|
||||||
SELECT citus_table_size('lineitem_hash_part');
|
SELECT citus_table_size('lineitem_hash_part');
|
||||||
SELECT citus_relation_size('lineitem_hash_part');
|
SELECT citus_relation_size('lineitem_hash_part');
|
||||||
SELECT citus_total_relation_size('lineitem_hash_part');
|
SELECT citus_total_relation_size('lineitem_hash_part');
|
||||||
|
|
Loading…
Reference in New Issue