Re: Need help with trigger - Mailing list pgsql-general

From David G. Johnston
Subject Re: Need help with trigger
Date
Msg-id CAKFQuwaGMpHMoVP5Ev9YkqsUdgfLUQ5GbtSzJFPt+4D=2GTXTA@mail.gmail.com
Whole thread Raw
In response to Need help with trigger  (Condor <condor@stz-bg.com>)
Responses Re: Need help with trigger
List pgsql-general
On Saturday, January 23, 2021, Condor <condor@stz-bg.com> wrote:


Hello ppl,

I need help with trigger how to replace insert command with update. External program read data from one table and in every 30 min I need to refresh data in arhive table.
What I want is: if data already inserted and end_date is not changed, only to update lastseen column. If data not exists to insert data and if data exists and end_date is changed
to update end_date, lastseen and sendto columns. Well, update probably will never happened, this functionality is left for frontend but its can be cut off.

Seems like an insert on conflict would be simpler.  Otherwise, what is your question or concern?

David J.

pgsql-general by date:

Previous
From: Ron
Date:
Subject: Re: Copy & Re-copy of DB
Next
From: Adrian Klaver
Date:
Subject: Re: Need help with trigger