From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Prevent a rowtype from being included in itself.
Date: Mon, 28 Mar 2011 19:46:23 +0000
Message-ID: <E1Q4ION-0004Qo-NP@gemulon.postgresql.org> (raw)
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
------
REL9_0_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/ce3b0ab0c327b2e3efa44342ad8de3256806cf84
Modified Files
--------------
src/backend/catalog/heap.c | 38 ++++++++++++++++++++++++++++-
src/backend/catalog/index.c | 3 +-
src/backend/commands/tablecmds.c | 8 ++++-
src/include/catalog/heap.h | 1 +
src/test/regress/expected/alter_table.out | 12 +++++++++
src/test/regress/sql/alter_table.sql | 9 +++++++
6 files changed, 67 insertions(+), 4 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Prevent a rowtype from being included in itself.
In-Reply-To: <E1Q4ION-0004Qo-NP@gemulon.postgresql.org>
References: <E1Q4ION-0004Qo-NP@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox