Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2002
    Location
    Toronto, Canada
    Posts
    76

    Unanswered: @@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.

  2. #2
    Join Date
    Sep 2001
    Location
    Vienna
    Posts
    400

    Migration

    I don't know anything about mssql

    But you can find useful information at
    Techdocs

    There are some scripts that make the migration and I think some tutorials
    http://www.postgresql.org
    --Postgresql is the only kind of thing--

  3. #3
    Join Date
    Nov 2004
    Posts
    1

    sequences

    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/...de74.html#5906

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •