PostgreSQL function for last inserted ID

后端 未结 11 1354

In PostgreSQL, how do I get the last id inserted into a table?

In MS SQL there is SCOPE_IDENTITY().

Please do not advise me to use something like this:

11条回答
  •  情深已故
    2020-11-22 14:34

    I had this issue with Java and Postgres. I fixed it by updating a new Connector-J version.

    postgresql-9.2-1002.jdbc4.jar

    https://jdbc.postgresql.org/download.html: Version 42.2.12

    https://jdbc.postgresql.org/download/postgresql-42.2.12.jar

提交回复
热议问题