mirror of https://github.com/citusdata/citus.git
Use bigserial instead of BIGINT in sequence error
parent
9f9fc09320
commit
72725ba30c
|
@ -875,7 +875,7 @@ CreateSchemaDDLCommand(Oid schemaId)
|
|||
* manner.
|
||||
*
|
||||
* Any column which depends on a sequence (and will therefore be replicated) but which is
|
||||
* not a BIGINT cannot be used for an mx table, because there aren't enough values to
|
||||
* not a bigserial cannot be used for an mx table, because there aren't enough values to
|
||||
* ensure that generated numbers are globally unique.
|
||||
*/
|
||||
static void
|
||||
|
@ -897,8 +897,9 @@ EnsureSupportedSequenceColumnType(Oid sequenceOid)
|
|||
if (columnType != INT8OID && shouldSyncMetadata && hasMetadataWorkers)
|
||||
{
|
||||
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("cannot create an mx table with columns which use "
|
||||
"sequences, but are not BIGINT")));
|
||||
errmsg("cannot create an mx table with a serial or smallserial "
|
||||
"column "),
|
||||
errdetail("Only bigserial is supported in mx tables.")));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -909,7 +909,8 @@ SELECT create_distributed_table('mx_table_with_small_sequence', 'a');
|
|||
(1 row)
|
||||
|
||||
SELECT start_metadata_sync_to_node('localhost', :worker_1_port);
|
||||
ERROR: cannot create an mx table with columns which use sequences, but are not BIGINT
|
||||
ERROR: cannot create an mx table with a serial or smallserial column
|
||||
DETAIL: Only bigserial is supported in mx tables.
|
||||
DROP TABLE mx_table_with_small_sequence;
|
||||
SELECT start_metadata_sync_to_node('localhost', :worker_1_port);
|
||||
start_metadata_sync_to_node
|
||||
|
@ -921,7 +922,8 @@ SELECT start_metadata_sync_to_node('localhost', :worker_1_port);
|
|||
-- there are metadata workers
|
||||
CREATE TABLE mx_table_with_small_sequence(a int, b SERIAL);
|
||||
SELECT create_distributed_table('mx_table_with_small_sequence', 'a');
|
||||
ERROR: cannot create an mx table with columns which use sequences, but are not BIGINT
|
||||
ERROR: cannot create an mx table with a serial or smallserial column
|
||||
DETAIL: Only bigserial is supported in mx tables.
|
||||
DROP TABLE mx_table_with_small_sequence;
|
||||
-- Create an MX table with (BIGSERIAL) sequences
|
||||
CREATE TABLE mx_table_with_sequence(a int, b BIGSERIAL, c BIGSERIAL);
|
||||
|
|
Loading…
Reference in New Issue