Re: SQL design pattern for a delta trigger?

From: Vivek Khera <vivek(at)khera(dot)org>
To: PGSQL Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: SQL design pattern for a delta trigger?
Date: 2007-12-10 19:09:15
Message-ID: 55C6E951-E6D7-42CD-91D0-AAE3D9CD1F92@khera.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Dec 7, 2007, at 11:42 AM, Colin Wetherbee wrote:

> You can do this with a conditional. Something like the following
> should work.
>
> IF
> NOT (a query matching your data returns rows)
> THEN
> INSERT (your new data)

There exists a race condition here unless you've locked your tables.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Carsten Franke 2007-12-10 19:13:09 Unable to ALTER table after SELECT data from table
Previous Message André Volpato 2007-12-10 18:38:00 Re: Creating indexes