pgsql: Prevent a rowtype from being included in itself.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Prevent a rowtype from being included in itself.
Date: 2011-03-28 19:46:23
Message-ID: E1Q4ION-0004Qm-Kx@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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
------
master

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

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

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2011-03-28 19:56:39 Re: [COMMITTERS] pgsql: Remove more SGML tabs.
Previous Message Bruce Momjian 2011-03-28 18:50:34 pgsql: Add 9.1 release note link for synchronous replication.