Database Administrators Asked by akagixxer on October 28, 2021
PostgreSQL 11
Requirements:
The data I get is NOT uniquely identified, so I am left with semantic comparison of the values to determine uniqueness.
E.g.
CREATE TABLE data.stuff
(
recorded BIGINT NOT NULL,
source_id INT NOT NULL,
key TEXT NOT NULL,
value TEXT NOT NULL
PRIMARY KEY (recorded, source_id, key, value)
);
INSERT INTO data.stuff (recorded, source_id, key, value)
VALUES (?, ?, ?, ?)
ON CONFLICT (recorded, source_id, key, value)
DO NOTHING;
It seems like my SQL is just saying that I want an index for a table which feels silly…
Is there a better way to do this?
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP