I am trying to allow a page I created to let users insert a record. I set up a GUI SQL using key value pairs. Now, when it runs, I get the following error " Insert into rp_shipped_2025 failed: you must satisfy the constraint 'Rp shipped 2025 pkey'
This error message has been driving me crazy for quite some time. Nobody seems to be able to explain what it means or how to fix it. I have an id field in the table which is auto-incrementing. At this point I have no idea what else to try.
I have a Retool database called foam_tracking. I have created a form to allow people to enter data into that database. It worked for a while, but now all of sudden I am getting the following error:
"Insert into foam_tracking failed: you must satisfy the constraint 'Foam tracking pkey'"
My id field is a auto-incrementing integer ID. I really don't have any idea what this error means and I have no idea how to fix it. I have gotten many times before and the best I could do was to delete my id column and recreate. Sometimes that worked. Other times I just gave up.
Any help you could provide would be greatly appreciated. Every time I see this error message I want to throw my computer out the window. If you need additional information, please let me know. Thank you.
By the way, if I don't set a primary key, then it works.
hi @tomm , from your screenshots above, it looks like the sequence is from a duplicate (or renamed) table, i.e. the discrepancy between table foam_tracking and the sequence foam_tracking_2_id_seq (namely, the _2.)
so the ids of inserted rows on the one table are being dictated by a seemingly disconnected table and a sequence that references it.
(i'm no DB or RetoolDB expert by any means, so hopefully that helps your case. i've been randomly hitting a similar pkey error recently despite my sequence and table matching in my setup, and i've been scouring the forums to learn more about these things. )