UPSERT and autogenerated ID (primary key)
I have an HTML form with 3 rows.
I have 2 saved records in the table (user didn't fill in all)
The next time the user logs in, he continues to fill out the form, which is pre filled with the previous 2 records from the db.
but get this error :
Can I use UPSERT this way?
I have 2 saved records in the table (user didn't fill in all)
The next time the user logs in, he continues to fill out the form, which is pre filled with the previous 2 records from the db.
- He edits one row
- Fills in the last row, and submits.
- save the new row,
- update the edited one
- ignore the unedited row
...without adding duplicates
but get this error :
null value in column "id" of relation "notes" violates not-null constraintid is auto incrementCan I use UPSERT this way?