duplicate key value violates unique constraint when trying to insert
I have this simple table:
and i have a script that reads data from redis and writes to this table:
this script runs is supposed to run every hour, triggered by a cronjob and now it doesn't run because i get the error
this error is caused on the first insertion try.
Also, don't want to mess up the data in Postgres nor in Redis.
Any help would be much appreciated. Thank you
and i have a script that reads data from redis and writes to this table:
this script runs is supposed to run every hour, triggered by a cronjob and now it doesn't run because i get the error
this error is caused on the first insertion try.
- I haven't done anything, haven't changed the schema or the data in the database
- as you can see, the only primary key i have in the table is the
idfield - am not trying to force the id
Also, don't want to mess up the data in Postgres nor in Redis.
Any help would be much appreciated. Thank you
Solution
asked and answered in stack overflow:
https://stackoverflow.com/questions/78633513/duplicate-key-value-violates-unique-constraint-when-trying-to-insert?noredirect=1#comment138634231_78633513
https://stackoverflow.com/questions/78633513/duplicate-key-value-violates-unique-constraint-when-trying-to-insert?noredirect=1#comment138634231_78633513
Stack Overflow
I'm using drizzle-orm to work on my postgresql database...
I have this simple table:
export const ExperimentData = pgTable('experiment_data', {
id: bigserial('id', { mode: 'number' }).primaryKey(...
I have this simple table:
export const ExperimentData = pgTable('experiment_data', {
id: bigserial('id', { mode: 'number' }).primaryKey(...