Skip site navigation (1) Skip section navigation (2)

Re: Recursive containment of composite types

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Recursive containment of composite types
Date: 2011-03-28 14:54:51
Message-ID: (view raw or whole thread)
Lists: pgsql-hackers
On Mon, Mar 28, 2011 at 9:47 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Bug #5950 proposes the following test case:
> create table t ();
> alter table t add childs t;
> alter table t add id serial not null primary key;
> Most of the back branches dump core because CheckAttributeType() goes
> into infinite recursion.  That doesn't happen in HEAD, but so far as I
> can see that's just because of some chance rearrangement of the order of
> operations in ALTER TABLE.  I wouldn't be at all surprised if there are
> related cases where HEAD fails too.
> I think the most straightforward and reliable fix for this would be to
> forbid recursive containment of a rowtype in itself --- ie, the first
> ALTER should have been rejected.  Can anyone think of a situation where
> it would be sane to allow such a thing?

Well, maybe. In fact, probably.  That's like asking in C if it's sane
to have a structure to contain a pointer back to itself, which of
course it is.  That said, if it doesn't work properly, it should
probably be disabled until it does.


In response to


pgsql-hackers by date

Next:From: Simon RiggsDate: 2011-03-28 14:58:28
Subject: Re: Additional options for Sync Replication
Previous:From: Robert HaasDate: 2011-03-28 14:54:04
Subject: Re: Recursive containment of composite types

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group