summaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2017-04-20 14:18:33 -0400
committerPeter Eisentraut <peter_e@gmx.net>2017-04-20 14:18:33 -0400
commit594b526bcf32e307b963ea77f10c9720d9ca423f (patch)
treea041056101ab5188323d4df292431eda3abfd5fc /src/backend
parent3a66581dd12b4108ce22fb4dad38258df39cb685 (diff)
Modify message when partitioned table is added to publication
Give a more specific error message than "xyz is not a table". Also document in CREATE PUBLICATION which kinds of relations are not supported. based on patch by Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/catalog/pg_publication.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/backend/catalog/pg_publication.c b/src/backend/catalog/pg_publication.c
index 9330e2380af..15f68a915b6 100644
--- a/src/backend/catalog/pg_publication.c
+++ b/src/backend/catalog/pg_publication.c
@@ -50,6 +50,15 @@
static void
check_publication_add_relation(Relation targetrel)
{
+ /* Give more specific error for partitioned tables */
+ if (RelationGetForm(targetrel)->relkind == RELKIND_PARTITIONED_TABLE)
+ ereport(ERROR,
+ (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+ errmsg("\"%s\" is a partitioned table",
+ RelationGetRelationName(targetrel)),
+ errdetail("Adding partitioned tables to publications is not supported."),
+ errhint("You can add the table partitions individually.")));
+
/* Must be table */
if (RelationGetForm(targetrel)->relkind != RELKIND_RELATION)
ereport(ERROR,