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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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 12:46:38
Message-ID: 22454.1223037998@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Rob Richardson" <Rob(dot)Richardson(at)rad-con(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Anderson dos Santos Donda 2008-10-03 13:05:23 INITDB in VISTA
Previous Message mm2010 2008-10-03 12:38:13 Re: [ADMIN] 8.3.4 rpms for Opensuse10.3 64bit