Re: BUG #17439: DROP FUNCTION functionName(); drops associated generated column without using CASCADE

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #17439: DROP FUNCTION functionName(); drops associated generated column without using CASCADE
Дата
Msg-id 453334.1647397423@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #17439: DROP FUNCTION functionName(); drops associated generated column without using CASCADE  (Kevin Humphreys <kmanh999@gmail.com>)
Ответы Re: BUG #17439: DROP FUNCTION functionName(); drops associated generated column without using CASCADE  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-bugs
Kevin Humphreys <kmanh999@gmail.com> writes:
> Thanks for deep-diving into this Tom! I don't have any experience with the
> internal workings of Postgres but if I am understanding correctly:
> - This is definitely a bug and not intended or expected behavior and goes
> against SQL specifications

Looks like a bug to me.  The aspect of this that a drop of a table
column causes silent drop of dependent generated columns is clearly
intentional, but AFAICS that's based on a misreading of the spec.
I suspect that the fact that it carries over to other dependencies
of the generation expression was just failure to consider that case.

> - This is a non-trivial fix
> - This is a fix that can not be back-ported to Postgres 13?
> - This is a fix that can be made to Postgres 14?

Yes, yes, no.  I don't think we'd risk trying to change this for
any released branch, because redefining catalog contents in
existing installations carries all sorts of hazards.  Given that
it's been wrong since v12 and you're the first to complain,
I judge that fixing it in released branches is not worth taking
such risks for.  We should definitely endeavor to get it fixed
for v15 though.

> Is there any recommendation you would have for mitigation besides not
> dropping functions that may be used by generated columns?

I don't see any good user-level workaround :-(.

            regards, tom lane



В списке pgsql-bugs по дате отправления:

Предыдущее
От: Kevin Humphreys
Дата:
Сообщение: Re: BUG #17439: DROP FUNCTION functionName(); drops associated generated column without using CASCADE
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: BUG #17439: DROP FUNCTION functionName(); drops associated generated column without using CASCADE