From 81d5995b4b78017ef9e5c6f151361d1fb949924c Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 21 Jul 2021 07:40:05 +0200 Subject: More improvements of error messages about mismatching relkind Follow-up to 2ed532ee8c474e9767e76e1f3251cc3a0224358c, a few error messages in the logical replication area currently only deal with tables, but if we're anticipating more relkinds such as sequences being handled, then these messages also fall into the category affected by the previous patch, so adjust them too. Reviewed-by: Michael Paquier Discussion: https://www.postgresql.org/message-id/c9ba5c6a-4bd5-e12c-1b3c-edbcaedbf392@enterprisedb.com --- src/backend/executor/execReplication.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'src/backend/executor/execReplication.c') diff --git a/src/backend/executor/execReplication.c b/src/backend/executor/execReplication.c index 1e285e0349f..574d7d27fd9 100644 --- a/src/backend/executor/execReplication.c +++ b/src/backend/executor/execReplication.c @@ -608,22 +608,10 @@ void CheckSubscriptionRelkind(char relkind, const char *nspname, const char *relname) { - /* - * Give a more specific error for foreign tables. - */ - if (relkind == RELKIND_FOREIGN_TABLE) - ereport(ERROR, - (errcode(ERRCODE_WRONG_OBJECT_TYPE), - errmsg("cannot use relation \"%s.%s\" as logical replication target", - nspname, relname), - errdetail("\"%s.%s\" is a foreign table.", - nspname, relname))); - if (relkind != RELKIND_RELATION && relkind != RELKIND_PARTITIONED_TABLE) ereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE), errmsg("cannot use relation \"%s.%s\" as logical replication target", nspname, relname), - errdetail("\"%s.%s\" is not a table.", - nspname, relname))); + errdetail_relkind_not_supported(relkind))); } -- cgit v1.2.3