Open joshmoore opened 4 years ago
See:
9.5 and newer: PostgreSQL 9.5 and newer support INSERT ... ON CONFLICT UPDATE (and ON CONFLICT DO NOTHING), i.e. upsert.
9.5 and newer:
PostgreSQL 9.5 and newer support INSERT ... ON CONFLICT UPDATE (and ON CONFLICT DO NOTHING), i.e. upsert.
https://stackoverflow.com/a/17267423
update password set hash = ... should become:
update password set hash = ...
INSERT INTO password (experimenter_id, hash, changed) VALUES (ID, 'Y', clock_timestamp()) ON CONFLICT (experimenter_id) DO UPDATE SET hash = 'Y', changed = clock_timestamp();
See:
https://stackoverflow.com/a/17267423
update password set hash = ...
should become: