Re: BUG #5982: recursive type crashes postgres

From: Rikard Pavelic <rikard(dot)pavelic(at)zg(dot)htnet(dot)hr>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Merlin Moncure <mmoncure(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5982: recursive type crashes postgres
Date: 2011-04-15 21:04:03
Message-ID: 4DA8B2C3.2050904@zg.htnet.hr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 15.4.2011 22:49, Kevin Grittner wrote:
> Rikard Pavelic <rikard(dot)pavelic(at)zg(dot)htnet(dot)hr> 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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Merlin Moncure 2011-04-15 21:06:28 Re: BUG #5982: recursive type crashes postgres
Previous Message Kevin Grittner 2011-04-15 20:49:24 Re: BUG #5982: recursive type crashes postgres