pgsql: Prevent a rowtype from being included in itself.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Prevent a rowtype from being included in itself.
Дата
Msg-id E1Q4ION-0004Qr-N6@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Prevent a rowtype from being included in itself.

Eventually we might be able to allow that, but it's not clear how many
places need to be fixed to prevent infinite recursion when there's a direct
or indirect inclusion of a rowtype in itself.  One such place is
CheckAttributeType(), which will recurse to stack overflow in cases such as
those exhibited in bug #5950 from Alex Perepelica.  If we were sure it was
the only such place, we could easily modify the code added by this patch to
stop the recursion without a complaint ... but it probably isn't the only
such place.  Hence, throw error until such time as someone is excited
enough about this type of usage to put work into making it safe.

Back-patch as far as 8.3.  8.2 doesn't have the recursive call in
CheckAttributeType in the first place, so I see no need to add code there
in the absence of clear evidence of a problem elsewhere.

Branch
------
REL8_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/fca20bcec9f4cae358044bdc66ebcb88c07c5ac2

Modified Files
--------------
src/backend/catalog/heap.c                |   43 ++++++++++++++++++++++++++---
src/backend/catalog/index.c               |    2 +-
src/backend/commands/tablecmds.c          |    6 +++-
src/include/catalog/heap.h                |    3 +-
src/test/regress/expected/alter_table.out |   12 ++++++++
src/test/regress/sql/alter_table.sql      |    9 ++++++
6 files changed, 67 insertions(+), 8 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Prevent a rowtype from being included in itself.
Следующее
От: Peter Eisentraut
Дата:
Сообщение: pgsql: Make duplicate_oids return nonzero exit status if duplicates wer