Re: How do I save data and then raise an exception?

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "Rob Richardson" <Rob(dot)Richardson(at)rad-con(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How do I save data and then raise an exception?
Date: 2008-10-03 18:58:36
Message-ID: dcc563d10810031158k3f79c4acwec3a298701267f38@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Oct 3, 2008 at 8:56 AM, Rob Richardson
<Rob(dot)Richardson(at)rad-con(dot)com> wrote:
> No, because the application first saves the coils and then saves the
> charge. Setting up the foreign key constraint would prevent any coils
> from being saved because the charge record would never exist at the time
> the coil record was created.

You should be able to set your constraints to deferrable initially
deferred and get proper behaviour even with that update system.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jörn Heid 2008-10-03 19:02:27 Re: Standalone Windows Installation
Previous Message Joseph Shraibman 2008-10-03 18:54:25 Re: Static functions