Re: Inserting many rows using "with"

2020-09-11 Thread Brian Dunavant
On Fri, Sep 11, 2020 at 1:31 PM Harmen wrote: > Hi all, > > Are there any known problems with this strategy? Are they any other > methods of > inserting lots of records in a nicer way? > I do this all the time with insert and it's wonderful. It can get tricky if you need to do UPDATEs. You can

Inserting many rows using "with"

2020-09-11 Thread Harmen
Hi all, I got a table with subscriptions to some kind of campaigns, and every contact can have max 1 running subscription per campaign: CREATE TABLE subscriptions ( id SERIAL NOT NULL PRIMARY KEY , campaign_id INT NOT NULL , contact_id INT NOT NULL , done BOOL NOT NULL );