Re: IDENTITY/GENERATED v36 Re: Final version of IDENTITY/GENERATED patch

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: IDENTITY/GENERATED v36 Re: Final version of IDENTITY/GENERATED patch
Дата
Msg-id 23808.1175710617@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: IDENTITY/GENERATED v36 Re: Final version of IDENTITY/GENERATED patch  (Zoltan Boszormenyi <zb@cybertec.at>)
Ответы Re: IDENTITY/GENERATED v36 Re: Final version of IDENTITY/GENERATED patch
Список pgsql-patches
Zoltan Boszormenyi <zb@cybertec.at> writes:
>> Before you get too excited about making generated columns disappear
>> automatically in all these cases, consider that dropping a column
>> is not something to be done lightly --- it might contain irreplaceable
>> data.

> The standard says that the GENERATED column should be
> dropped silently if either of the referenced columns is dropped.

[ itch... ]  I think a pretty good case could be made for ignoring that
provision, on the grounds that it's a foot-gun, and that it's not very
important to follow the standard slavishly on this point because it's
hard to conceive of any application actually relying on that behavior.

You could probably implement the auto-drop behavior with some combination
of (a) AUTO rather than NORMAL dependencies from the default expression
to the stuff it depends on and (b) INTERNAL rather than AUTO dependency
from the default expression to its column.  But I really question
whether this is a good idea.

> The standard says somewhere that GENERATED columns
> can only be added to and dropped from a table.

This argument carries no weight at all --- there is plenty of stuff in
PG that is an extension of the capabilities listed in the spec.

            regards, tom lane

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

Предыдущее
От: Zoltan Boszormenyi
Дата:
Сообщение: Re: IDENTITY/GENERATED v36 Re: Final version of IDENTITY/GENERATED patch
Следующее
От: Zoltan Boszormenyi
Дата:
Сообщение: Re: IDENTITY/GENERATED v36 Re: Final version of IDENTITY/GENERATED patch