Re: INSERT where not exists with foreign key

2019-05-20 Thread Adrian Klaver
On 5/20/19 11:11 AM, Chuck Martin wrote: My Google foo isn't working on this question, probably because I don't understand the question well enough. I'm using Postgres 11.3 on Centos 7. I'm trying to insert a record in table A with a foreign key to table B, but only where there is not already a

Re: INSERT where not exists with foreign key

2019-05-20 Thread Adrian Klaver
On 5/20/19 11:11 AM, Chuck Martin wrote: My Google foo isn't working on this question, probably because I don't understand the question well enough. I'm using Postgres 11.3 on Centos 7. I'm trying to insert a record in table A with a foreign key to table B, but only where there is not already a

INSERT where not exists with foreign key

2019-05-20 Thread Chuck Martin
My Google foo isn't working on this question, probably because I don't understand the question well enough. I'm using Postgres 11.3 on Centos 7. I'm trying to insert a record in table A with a foreign key to table B, but only where there is not already a foreign key in A to B. So assume this simple