Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 32FC91337BE4 for ; Fri, 15 Apr 2011 18:04:14 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 11730-01 for ; Fri, 15 Apr 2011 21:04:07 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp-out-02.xnet.hr (smtp-out-02.xnet.hr [83.139.103.74]) by mail.postgresql.org (Postfix) with ESMTP id 12E931337BE7 for ; Fri, 15 Apr 2011 18:04:05 -0300 (ADT) Received: from mail.xnet.hr (cartman.bnet.hr [213.149.32.10]) by smtp-out-02.xnet.hr (XnetMailOut) with ESMTP id 53AC28A67F for ; Fri, 15 Apr 2011 23:04:05 +0200 (CEST) Received: (qmail 5220 invoked from network); 15 Apr 2011 21:04:05 -0000 X-Mail-Scanner: Scanned by qSheff-II-2.1-r3 (http://www.enderunix.org/qsheff/) Received: from cpezg-94-253-146-175-cbl.xnet.hr (HELO [94.253.146.175]) ([94.253.146.175]) (envelope-sender ) by 0 (qmail-ldap-1.03) with SMTP for ; 15 Apr 2011 21:04:05 -0000 Message-ID: <4DA8B2C3.2050904@zg.htnet.hr> Date: Fri, 15 Apr 2011 23:04:03 +0200 From: Rikard Pavelic User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: Kevin Grittner CC: Tom Lane , Merlin Moncure , pgsql-bugs@postgresql.org Subject: Re: BUG #5982: recursive type crashes postgres References: <201104151834.p3FIYSQ0067290@wwwmaster.postgresql.org> <28780.1302894395@sss.pgh.pa.us> <4DA8AAD7.9000606@zg.htnet.hr> <4DA86904020000250003C8CD@gw.wicourts.gov> In-Reply-To: <4DA86904020000250003C8CD@gw.wicourts.gov> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201104/113 X-Sequence-Number: 30032 On 15.4.2011 22:49, Kevin Grittner wrote: > Rikard Pavelic wrote: >> On 15.4.2011 21:06, Tom Lane wrote: >>> The former. >>> >>> regression=# CREATE TYPE turtle AS >>> ( >>> name varchar >>> ); >>> CREATE TYPE >>> regression=# ALTER TYPE turtle ADD ATTRIBUTE offspring turtle; >>> ERROR: composite type turtle cannot be made a member of itself >>> regression=# > >> Todo item? > > I haven't seen anything which seems like a reasonable use case yet, > myself. If you were *actually* tracking turtles and their > offspring, that would be a completely worthless data structure. Is > there really a case where a reference to the ID of an object of like > type isn't a better solution? > > -Kevin > I'm trying to map application and database domain as close as possible. So it's not that I have an use case, but have a mismatch which cannot be mapped. This feature would reduce object-relational impedance mismatch in DDD, so I think it is worth an Todo item. Is this design strange/stupid? Probably. But, currently it behaves as struct. It would be nice if it behaved as class (when attribute is nullable). Regards, Rikard