unicef2k
09-24-02, 23:30
| I'm suppose to migrate data at work from MS SQL server to Postgresql. Everything is done except, how can I obtain @@identity in postgresql? Thanks in advance. |
View Full Version : @@identity on postgres?
| I'm suppose to migrate data at work from MS SQL server to Postgresql. Everything is done except, how can I obtain @@identity in postgresql? Thanks in advance. |
| Probably long past resolved but might help someone else. Use sequences in postgres for id columns: INSERT mytable(myid) VALUES (nextval('MySequence')); SELECT currval('MySequence'); currval works like @@identity and will return the current value of the sequence in the same session. http://database.sarang.net/database/postgres/aw_pgsql_book/node74.html#5906 |