dimensionav
asked on
Create postgresql sequence for database ids
Hi!
We imported a MySQL database and, since in postgre there isn't Autoincrement options, we need to create a serial.
The thing is, the current exported id's doesn't allow us to change its type from int to a serial, instead of that, Postgresql is asking to create a sequence and set the default value as the nextval of that sequence
Is there any more efficient way to do it?
Regards!
We imported a MySQL database and, since in postgre there isn't Autoincrement options, we need to create a serial.
The thing is, the current exported id's doesn't allow us to change its type from int to a serial, instead of that, Postgresql is asking to create a sequence and set the default value as the nextval of that sequence
Is there any more efficient way to do it?
Regards!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you have to do this a ton of times you could try creating a procedure that would take a table and column name as parameters that would do it for you.