Re: SQL design pattern for a delta trigger? - Mailing list pgsql-general

From Ted Byers
Subject Re: SQL design pattern for a delta trigger?
Date
Msg-id 898748.69272.qm@web88314.mail.re4.yahoo.com
Whole thread Raw
In response to Re: SQL design pattern for a delta trigger?  (Erik Jones <erik@myemma.com>)
Responses Re: SQL design pattern for a delta trigger?
Re: SQL design pattern for a delta trigger?
Re: SQL design pattern for a delta trigger?
List pgsql-general
--- Erik Jones <erik@myemma.com> wrote:

>
> On Dec 6, 2007, at 2:36 PM, Ted Byers wrote:
>
> [snip]
> What you want to do here for handling the update v.
> insert is called
> an "UPSERT".  Basically, what you do is run the
> update as if the row
> exists and catch the exception that is thrown if it
> doesn't at which
> point you insert the record with the end date =
> now().  After that
> you can proceed normally with creating the new
> record with start date
> = now() and end date = NULL.
>
Thanks Eric.  Do you know of an URL where this is
discussed or where I can find an example.  None of my
books discuss this, and my search using google has so
far produced only noise.

Thanks again.

Ted

pgsql-general by date:

Previous
From: "Charles.Hou"
Date:
Subject: Re: autovacuum is stopping automatically....
Next
From: Martin Korous
Date:
Subject: cannot dump structures