Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ON CONFLICT (name, age)
- DO UPDATE SET
- occupation = 'teacher'
- ELSE ON CONFLICT(all others) DO NOTHING;
- CREATE UNIQUE INDEX index1 ON contact USING btree (name, age);
- CREATE UNIQUE INDEX index2 ON contact USING btree (name, address) WHERE (address IS NOT NULL);
- CREATE UNIQUE INDEX index3 ...
- CREATE UNIQUE INDEX index4 ...
- INSERT INTO contact
- (name,
- age,
- address,
- occupation)
- VALUES
- ('John',
- 25,
- '1 main st',
- 'doctor')
- ON CONFLICT (name, age)
- DO UPDATE SET
- occupation = 'teacher';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement