mirror of https://github.com/postgres/postgres
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/548a47bc-87ae-b3df-c6a2-60b9966f808b@gmail.com
This commit is contained in:
parent
da55e4cd1f
commit
5f4a1a0a77
|
@ -12816,6 +12816,20 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
|
|||
RememberStatisticsForRebuilding(foundObject.objectId, tab);
|
||||
break;
|
||||
|
||||
case OCLASS_PUBLICATION_REL:
|
||||
|
||||
/*
|
||||
* Column reference in a PUBLICATION ... FOR TABLE ... WHERE
|
||||
* clause. Same issues as above. FIXME someday.
|
||||
*/
|
||||
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;
|
||||
|
||||
case OCLASS_TYPE:
|
||||
case OCLASS_CAST:
|
||||
case OCLASS_COLLATION:
|
||||
|
@ -12845,7 +12859,6 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel,
|
|||
case OCLASS_PARAMETER_ACL:
|
||||
case OCLASS_PUBLICATION:
|
||||
case OCLASS_PUBLICATION_NAMESPACE:
|
||||
case OCLASS_PUBLICATION_REL:
|
||||
case OCLASS_SUBSCRIPTION:
|
||||
case OCLASS_TRANSFORM:
|
||||
|
||||
|
|
Loading…
Reference in New Issue