mirror of
https://github.com/postgres/postgres.git
synced 2025-07-21 16:02:15 +03:00
More improvements of error messages about mismatching relkind
Follow-up to 2ed532ee8c
, 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 <michael@paquier.xyz>
Discussion: https://www.postgresql.org/message-id/c9ba5c6a-4bd5-e12c-1b3c-edbcaedbf392@enterprisedb.com
This commit is contained in:
@ -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)));
|
||||
}
|
||||
|
Reference in New Issue
Block a user