I'm rather new to Postgres and Navicat is the only fully functional GUI that I've come across. That said, I'm trying to implement a simple auto increment for an id. Navicat doesn't seem to support bigserial or serial, or have anything in place to specify a primary key w/ auto increment. Any thoughts?
By simply setting our id column as SERIAL with PRIMARY KEY attached, Postgres will handle all the complicated behind-the-scenes work and automatically increment our id column with a unique, primary key value for every INSERT .
To get the next auto increment id in MySQL, we can use the function last_insert_id() from MySQL or auto_increment with SELECT. Creating a table, with “id” as auto-increment.
In MySQL, the syntax to change the starting value for an AUTO_INCREMENT column using the ALTER TABLE statement is: ALTER TABLE table_name AUTO_INCREMENT = start_value; table_name. The name of the table whose AUTO_INCREMENT value you wish to change.
you should make a sequence default value
Navicat Menu -> Others -> Sequence -> (choose table and column) -> save "user_id_plus1"
and set default value for id column with
nextval('user_id_plus1'::regclass)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With