Recursive containment of composite types

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Recursive containment of composite types
Date: 2011-03-28 14:47:47
Message-ID: 17149.1301323667@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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?

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2011-03-28 14:48:52 Re: Set hint bits upon eviction from BufMgr
Previous Message Euler Taveira de Oliveira 2011-03-28 14:44:29 Re: Comments on system tables and columns