#how to lastinsert ID at postgres
18 messages · Page 1 of 1 (latest)
look at your table definition
and change the not null constraint as well as potentially use an auto increment value as key or a uuid.
problem is: database does not want null as a value in the id field (because table definition says so) but you insert a null value.
my defenition table
i want insert id to my users table
might try something like this. you will need to drop or alter your table
in this case it's good to let the database generate the id.
because you do not provide an id field, the database says no
in order for the database to automatically create the id, you might need to tell it to do so
thankyouuu sir i will try it
this case the database definition bad not best practice the definition from sqlite now i want change to posgresql
in the postgresql autocrement need serial
PostgreSQL - AUTO INCREMENT, PostgreSQL has the data types smallserial, serial and bigserial; these are not true types, but merely a notational convenience for creating unique identifier co
tyy sirr for the insight