From 72725ba30caa11b438305eaf75e08a1c760c762b Mon Sep 17 00:00:00 2001 From: Marco Slot Date: Mon, 23 Jan 2017 16:49:25 +0100 Subject: [PATCH] Use bigserial instead of BIGINT in sequence error --- src/backend/distributed/metadata/metadata_sync.c | 7 ++++--- src/test/regress/expected/multi_metadata_sync.out | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/backend/distributed/metadata/metadata_sync.c b/src/backend/distributed/metadata/metadata_sync.c index b69ec3139..7068f231c 100644 --- a/src/backend/distributed/metadata/metadata_sync.c +++ b/src/backend/distributed/metadata/metadata_sync.c @@ -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."))); } } diff --git a/src/test/regress/expected/multi_metadata_sync.out b/src/test/regress/expected/multi_metadata_sync.out index 310e52aba..089193c52 100644 --- a/src/test/regress/expected/multi_metadata_sync.out +++ b/src/test/regress/expected/multi_metadata_sync.out @@ -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);