diff options
author | Tom Lane | 2024-05-02 21:36:31 +0000 |
---|---|---|
committer | Tom Lane | 2024-05-02 21:36:31 +0000 |
commit | 91e7115b177b0523f9757574b8a329ebe10c0af7 (patch) | |
tree | 1c8c27c73a678f5654a0bd786cdcbf4c636754ef | |
parent | d45597f72fe53a53f6271d5ba4e7acf8fc9308a1 (diff) |
Throw a more on-point error for publications depending on columns.
Same as 42b041243, except that the trouble case is a publication
WHERE clause that depends on a column.
Again reported by Alexander Lakhin. Back-patch to v15 where
we added publication WHERE clauses.
Discussion: https://postgr.es/m/[email protected]
-rw-r--r-- | src/backend/commands/tablecmds.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index c31783373f0..3309332f1ae 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -46,6 +46,7 @@ #include "catalog/pg_opclass.h" #include "catalog/pg_policy.h" #include "catalog/pg_proc.h" +#include "catalog/pg_publication_rel.h" #include "catalog/pg_rewrite.h" #include "catalog/pg_statistic_ext.h" #include "catalog/pg_tablespace.h" @@ -14227,6 +14228,21 @@ RememberAllDependentForRebuilding(AlteredTableInfo *tab, AlterTableType subtype, RememberStatisticsForRebuilding(foundObject.objectId, tab); break; + case PublicationRelRelationId: + + /* + * Column reference in a PUBLICATION ... FOR TABLE ... WHERE + * clause. Same issues as above. FIXME someday. + */ + if (subtype == AT_AlterColumnType) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot alter type of a column used by a publication WHERE clause"), + errdetail("%s depends on column \"%s\"", + getObjectDescription(&foundObject, false), + colName))); + break; + default: /* |