mirror of https://github.com/citusdata/citus.git
Fix error checks and messages
parent
c6705ebbd1
commit
aad741a2e2
|
@ -52,8 +52,8 @@ static void ErrorIfNotSuitableToConvertTimeseriesTable(Oid relationId,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* create_timeseries_table gets a table name, partition interval
|
* create_timeseries_table gets a table name, partition interval
|
||||||
* optional pre and post make partition counts, compression and retention threshold
|
* optional post and pre make interval count, start_from time,
|
||||||
* then it creates a timeseries table.
|
* compression and retention threshold then it creates a timeseries table.
|
||||||
*/
|
*/
|
||||||
Datum
|
Datum
|
||||||
create_timeseries_table(PG_FUNCTION_ARGS)
|
create_timeseries_table(PG_FUNCTION_ARGS)
|
||||||
|
@ -69,8 +69,10 @@ create_timeseries_table(PG_FUNCTION_ARGS)
|
||||||
|
|
||||||
if (!PG_ARGISNULL(3) && !PG_ARGISNULL(4))
|
if (!PG_ARGISNULL(3) && !PG_ARGISNULL(4))
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errmsg("either premakeintervalcount or startfrom "
|
ereport(ERROR, (errmsg("either premake_interval_count or start_from "
|
||||||
"should be provided")));
|
"should be provided")));
|
||||||
|
|
||||||
|
PG_RETURN_VOID();
|
||||||
}
|
}
|
||||||
|
|
||||||
Oid relationId = PG_GETARG_OID(0);
|
Oid relationId = PG_GETARG_OID(0);
|
||||||
|
@ -135,8 +137,8 @@ ErrorIfNotSuitableToConvertTimeseriesTable(Oid relationId, Interval *partitionIn
|
||||||
PartitionKey partitionKey = RelationGetPartitionKey(pgPartitionedTableRelation);
|
PartitionKey partitionKey = RelationGetPartitionKey(pgPartitionedTableRelation);
|
||||||
|
|
||||||
/* Table related checks */
|
/* Table related checks */
|
||||||
if (!PartitionedTable(relationId) || partitionKey->strategy !=
|
if (!PartitionedTable(relationId) ||
|
||||||
PARTITION_STRATEGY_RANGE)
|
partitionKey->strategy != PARTITION_STRATEGY_RANGE)
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errmsg("table must be partitioned by range to convert "
|
ereport(ERROR, (errmsg("table must be partitioned by range to convert "
|
||||||
"it to timeseries table")));
|
"it to timeseries table")));
|
||||||
|
@ -225,8 +227,6 @@ InitiateTimeseriesTablePartitions(Oid relationId, bool useStartFrom)
|
||||||
SPI_finish();
|
SPI_finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: If result is not true, error out! (Check metadata tables after erroring out!) */
|
|
||||||
|
|
||||||
SPI_execute(initiateTimeseriesPartitionsCommand->data, readOnly, 0);
|
SPI_execute(initiateTimeseriesPartitionsCommand->data, readOnly, 0);
|
||||||
SPI_finish();
|
SPI_finish();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue