Re: How do I save data and then raise an exception? - Mailing list pgsql-general

From Tom Lane
Subject Re: How do I save data and then raise an exception?
Date
Msg-id 22454.1223037998@sss.pgh.pa.us
Whole thread Raw
In response to Re: How do I save data and then raise an exception?  ("Rob Richardson" <Rob.Richardson@rad-con.com>)
Responses Re: How do I save data and then raise an exception?  ("Rob Richardson" <Rob.Richardson@rad-con.com>)
List pgsql-general
"Rob Richardson" <Rob.Richardson@rad-con.com> writes:
> I think I just came up with a thoroughly ugly idea.  The database
> supports an annealing shop, in which coils are assigned to charges.
> After the check fails, I end up with coils assigned to a charge that
> does not exist.  I could set up a job that runs every minute and
> checks all coils with status "Assigned" to make sure that the
> associated charges actually exist.  That would fix another recurring
> problem, in which a user intentionally deletes a charge but the
> charge's coils stay assigned to that charge.

Why don't you have a foreign key constraint from coils to charges?

            regards, tom lane

pgsql-general by date:

Previous
From: mm2010
Date:
Subject: Re: [ADMIN] 8.3.4 rpms for Opensuse10.3 64bit
Next
From: "Anderson dos Santos Donda"
Date:
Subject: INITDB in VISTA