I'm switching from MySQL to PostgreSQL and was wondering how I can do autoincrement values. I saw in the PostgreSQL docs a datatype "serial", but I get syntax errors when using it (in v8.0).
PostgreSQL Autoincrement
auto-incrementpostgresql
Related Topic
- Postgresql – Insert, on duplicate update in PostgreSQL
- Postgresql – Import SQL dump into PostgreSQL database
- Postgresql – How to do an update + join in PostgreSQL
- Postgresql – How to start PostgreSQL server on Mac OS X
- Postgresql – How to exit from PostgreSQL command line utility: psql
- Postgresql – “use database_name” command in PostgreSQL
- Postgresql – How to change PostgreSQL user password
- Postgresql – psql: FATAL: database “
” does not exist
Best Answer
Yes, SERIAL is the equivalent function.
SERIAL is just a create table time macro around sequences. You can not alter SERIAL onto an existing column.