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?
Asked
Active
Viewed 1.1k times
6
-
"The only functional GUI that I've come across". PgAdmin-III? It's not amazing, but it does the job. – Craig Ringer Dec 01 '14 at 02:43
-
@CraigRinger Just downloaded it and it's definitely functional... but man, does that make my eyes hurt. Enough to give one a headache if using a retina display. Anyways, thanks for the heads up. Much appreciated. – Nick Parsons Dec 01 '14 at 02:48
-
I just use `psql`, and I think you'll find most regular PostgreSQL users do. So there's less attention paid to GUIs, partly because developing them is really no fun at all. Regular users don't tend to want to use GUIs, and infrequent users are less likely to want to contribute, so ... yeah. – Craig Ringer Dec 01 '14 at 02:52
-
@CraigRinger Great feedback. I used to work with MySQL quite a bit (using Sequel Pro) before switching to MongoDB. I now have an application that requires a relational database so I figured I would give Postgres a shot. Thanks again. – Nick Parsons Dec 01 '14 at 02:54
-
What about CREATE SEQUENCE ? That's what a serial-datatype also does. – Frank Heikens Dec 01 '14 at 09:43
1 Answers
7
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)

Hamid Zandi
- 2,714
- 24
- 32
-
I'm using postgresl 12.0. I should use `nextval('dbo.user_id_plus1'::regclass)` to let it work(But don't know why). – Tony Chou Oct 23 '19 at 17:16