pgsql: Throw a more on-point error for functions depending on columns.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Throw a more on-point error for functions depending on columns.
Дата
Msg-id E1s19M9-000UrQ-OU@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Throw a more on-point error for functions depending on columns.

ALTER COLUMN TYPE wasn't expecting to find any pg_proc objects
depending on the column whose type is to be altered.  That indeed
wasn't possible when this code was written, but it is possible
since we introduced new-style SQL function bodies.

It's about as difficult to fix this case as it is to fix dependent
views, and we've been punting on those for years, so I don't feel
too awful about punting for functions too.  (I sure wouldn't risk
back-patching such code.)  So just throw a more user-facing error.
Also, adjust some of the existing comments to reflect that these
are all pretty much the same issue.

(This patch also fixes it so we will tolerate finding such a
dependency during ALTER COLUMN SET EXPRESSION; in that, we need
not do anything to the function, so no error is wanted.  That
problem is new in HEAD.)

Per bug #18449 from Alexander Lakhin.  Back-patch to v14 where
we added new-style SQL functions.

Discussion: https://postgr.es/m/18449-f8248467aaa294d5@postgresql.org

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/9b41d1d634aa9a3a36a21c5624b25c8475fd51ee

Modified Files
--------------
src/backend/commands/tablecmds.c | 30 +++++++++++++++++++++++++-----
1 file changed, 25 insertions(+), 5 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Detect more overflows in timestamp[tz]_pl_interval.
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Fix documentation and comments on what happens after GSS rejecti