Re: INSERT Trigger to check for existing records

2020-11-22 Thread Hagen Finley
Adrian and Michael, My current insert logic (which works) is in a psycopg2 python script which reads a spreadsheet row into an array, so for the moment I didn't want to add that integration to my struggle. cur = conn.cursor() \ query = "INSERT INTO sfdc(theater,co

RE: INSERT Trigger to check for existing records

2020-11-22 Thread hagen
Thank you Adrian, Your summary looks exactly right to me. I think option 2b looks more in reach for my limited skillset. Let me see if I can make that work (dubious) and report. Best, Hagen -Original Message- From: Adrian Klaver Sent: Sunday, November 22, 2020 11:26 AM To: Hagen Finl

Re: INSERT Trigger to check for existing records

2020-11-22 Thread Adrian Klaver
On 11/22/20 9:53 AM, Hagen Finley wrote: Hello Michael, Thanks so much for this advice. As I mentioned previously, I'm not very good at this yet, so forgive me if my response is obtuse. I really love databases but my sentiments may be unrequited. The overriding issue is lack of a plan. From

Re: INSERT Trigger to check for existing records

2020-11-22 Thread Hagen Finley
Hello Michael, Thanks so much for this advice. As I mentioned previously, I'm not very good at this yet, so forgive me if my response is obtuse. I really love databases but my sentiments may be unrequited. In reality my table has lots of columns (~30) including a report date (repdate) and ea

Re: INSERT Trigger to check for existing records

2020-11-22 Thread Michael Lewis
If you can modify your insert statement, and live with an extra column in the data, no trigger is needed as best I can figure. Create a unique index over the existing columns, add a "created_on" field and call insert on conflict (unique index) do nothing. This should give the behavior you want.