pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: hagen@datasundae.com
To: 'David G. Johnston' <david.g.johnston@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: RE: INSERT Trigger to check for existing records
Date: Sat, 21 Nov 2020 11:49:06 -0700
Message-ID: <000e01d6c036$fda479b0$f8ed6d10$@datasundae.com> (raw)
In-Reply-To: <CAKFQuwZK_igf_c2CuEUWC-VAYxHeR1+PAfTtATzTJZX5836wFA@mail.gmail.com>
References: <CAKoxK+5x9J74Sn=rvGSu4dAkSdpF=9AoTjs9-KmnSGd6c03SxQ@mail.gmail.com>
	<1fc1fb9e-684f-d028-3f9b-fcfaf1f12f65@aklaver.com>
	<CAKoxK+4DGFeevYrCJ3oEWxqXGodtEKt33dpQQjvw0O1ZwMgWyA@mail.gmail.com>
	<3e1051a4-98d4-4a59-f382-5b82efa4c095@datasundae.com>
	<CAKFQuwYpbAQ-rm++roXFiQdP-OmX4Wwzmnh1U2qWSpRAG_LbJA@mail.gmail.com>
	<f38a05da-48d8-1f95-78a4-159414424ec3@datasundae.com>
	<CAKFQuwZQXdHJ=Maf6FgSnP3SZdn9jQtLb7qXR6_vrzioJXbnRg@mail.gmail.com>
	<CAKFQuwZK_igf_c2CuEUWC-VAYxHeR1+PAfTtATzTJZX5836wFA@mail.gmail.com>

Yes but it didn’t sink in but the two table join idea does make sense – I’ll give that a try. THANK YOU.

 

From: David G. Johnston <david.g.johnston@gmail.com> 
Sent: Saturday, November 21, 2020 11:25 AM
To: Hagen Finley <hagen@datasundae.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: INSERT Trigger to check for existing records

 

On Saturday, November 21, 2020, David G. Johnston <david.g.johnston@gmail.com <mailto:david.g.johnston@gmail.com> > wrote:

On Saturday, November 21, 2020, Hagen Finley <hagen@datasundae.com <mailto:hagen@datasundae.com> > wrote:

David,

That's an interesting idea. I WOULD like  to retain the OLD records that are the same and only INSERT new or changed records. Is there a way to compare the old and the new records without a trigger?

 

A where clause?

 

 

Did you get the part in the plan where there are two tables, existing and new? You write queries that join the two tables together and use the where clause in those queries to limit records.

 

David J.

 

view thread (22+ messages)  latest in thread

Message-ID: <000e01d6c036$fda479b0$f8ed6d10$@datasundae.com>
Permalink:  ../000e01d6c036$fda479b0$f8ed6d10$@datasundae.com/
Also on:    postgresql.org/message-id/000e01d6c036$fda479b0$f8ed6d10$@datasundae.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: hagen@datasundae.com, david.g.johnston@gmail.com
  Subject: Re: INSERT Trigger to check for existing records
  In-Reply-To: <000e01d6c036$fda479b0$f8ed6d10$@datasundae.com>
  References: <CAKoxK+5x9J74Sn=rvGSu4dAkSdpF=9AoTjs9-KmnSGd6c03SxQ@mail.gmail.com> <1fc1fb9e-684f-d028-3f9b-fcfaf1f12f65@aklaver.com> <CAKoxK+4DGFeevYrCJ3oEWxqXGodtEKt33dpQQjvw0O1ZwMgWyA@mail.gmail.com> <3e1051a4-98d4-4a59-f382-5b82efa4c095@datasundae.com> <CAKFQuwYpbAQ-rm++roXFiQdP-OmX4Wwzmnh1U2qWSpRAG_LbJA@mail.gmail.com> <f38a05da-48d8-1f95-78a4-159414424ec3@datasundae.com> <CAKFQuwZQXdHJ=Maf6FgSnP3SZdn9jQtLb7qXR6_vrzioJXbnRg@mail.gmail.com> <CAKFQuwZK_igf_c2CuEUWC-VAYxHeR1+PAfTtATzTJZX5836wFA@mail.gmail.com> <000e01d6c036$fda479b0$f8ed6d10$@datasundae.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox