From a6f42e49486341a45d4310348f70e22ef0062bde Mon Sep 17 00:00:00 2001 From: Marco Slot Date: Wed, 21 Jun 2017 16:08:46 +0200 Subject: [PATCH] Clarify error message when copying NULL value into table --- src/backend/distributed/commands/multi_copy.c | 2 +- src/test/regress/expected/multi_insert_select.out | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/backend/distributed/commands/multi_copy.c b/src/backend/distributed/commands/multi_copy.c index c6f01ae0b..4e2db236d 100644 --- a/src/backend/distributed/commands/multi_copy.c +++ b/src/backend/distributed/commands/multi_copy.c @@ -1874,7 +1874,7 @@ CitusCopyDestReceiverReceive(TupleTableSlot *slot, DestReceiver *dest) relationName); ereport(ERROR, (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED), - errmsg("the partition column of table %s should have a value", + errmsg("the partition column of table %s cannot be NULL", qualifiedTableName))); } diff --git a/src/test/regress/expected/multi_insert_select.out b/src/test/regress/expected/multi_insert_select.out index ebb863fe6..33296cbe9 100644 --- a/src/test/regress/expected/multi_insert_select.out +++ b/src/test/regress/expected/multi_insert_select.out @@ -1060,7 +1060,7 @@ FROM raw_events_first; DEBUG: cannot perform distributed INSERT INTO ... SELECT becuase the partition columns in the source table and subquery do not match DETAIL: The target table's partition column should correspond to a partition column in the subquery. DEBUG: Collecting INSERT ... SELECT results on coordinator -ERROR: the partition column of table public.raw_events_second should have a value +ERROR: the partition column of table public.raw_events_second cannot be NULL INSERT INTO raw_events_second (user_id) SELECT user_id * 2 @@ -1094,7 +1094,7 @@ DEBUG: cannot perform distributed INSERT INTO ... SELECT because the partition DETAIL: Subquery contains an aggregation in the same position as the target table's partition column. HINT: Ensure the target table's partition column has a corresponding simple column reference to a distributed table's partition column in the subquery. DEBUG: Collecting INSERT ... SELECT results on coordinator -ERROR: the partition column of table public.agg_events should have a value +ERROR: the partition column of table public.agg_events cannot be NULL INSERT INTO agg_events (value_3_agg, value_4_agg, @@ -1112,7 +1112,7 @@ GROUP BY user_id, DEBUG: cannot perform distributed INSERT INTO ... SELECT becuase the partition columns in the source table and subquery do not match DETAIL: The target table's partition column should correspond to a partition column in the subquery. DEBUG: Collecting INSERT ... SELECT results on coordinator -ERROR: the partition column of table public.agg_events should have a value +ERROR: the partition column of table public.agg_events cannot be NULL -- tables should be co-located INSERT INTO agg_events (user_id) SELECT