Re: *Proper* solution for 1..* relationship?

From: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
To: Wolfgang Keller <feliphil(at)gmx(dot)net>
Cc: pgsql novice forum <pgsql-novice(at)postgresql(dot)org>
Subject: Re: *Proper* solution for 1..* relationship?
Date: 2013-05-01 15:37:43
Message-ID: CAK3UJREh6OoBF4fC5N6KEMqO3biOJ1An-B33GcP2_L-nO9T+cw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Tue, Apr 30, 2013 at 7:56 AM, Wolfgang Keller <feliphil(at)gmx(dot)net> wrote:
>> The most straightforward way I know to enforce this is to check
>> that at least one child exists in a DEFERRED trigger on the the
>> parent. You still need to worry about concurrency issues.
>
> Imho it's absurd that I have to do this ("worry about concurrency
> issues") myself, how long - more than fourty years after the invention
> of relational databases?

You're not the first one to wish for something like this, and the SQL
standard actually has the CREATE ASSERTION syntax which I believe
would be able cover your use-case. Unfortunately, almost no databases
support this feature :-(

Josh

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Gavin Flower 2013-05-01 20:16:15 Re: *Proper* solution for 1..* relationship?
Previous Message David Johnston 2013-04-30 13:13:52 Re: *Proper* solution for 1..* relationship?