When I send a POST request to register I get the error "org.postgresql.util.PSQLException: ERROR: null value in column "id" of relation "members" violates not-null constraint
Detail: Failing row contains (null, ttt, noob@noob.com, noob, test).", but shouldnt my id be auto-generated?
#Spring Boot ID generation problem
7 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @uneven violet! Please use
/closeor theClose Postbutton above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
by using GenerationType.IDENTITY you basically say. DB it's your job to generate pk values
so if you haven't set the db to auto generate keys it won't work
Using the AUTO generation type seems to do the trick.
Yep I just found out, thank you!
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.