INSERT INTO … FROM SELECT … RETURNING id mappings

前端 未结 3 1679
梦谈多话
梦谈多话 2020-12-16 19:50

I\'m using PostgreSQL 9.3.

I want to duplicate some of the db records. Since I\'m using an auto-increment pk id for the table, I want to get back the id mappings fro

3条回答
  •  死守一世寂寞
    2020-12-16 20:14

    The simplest solution IMHO would be to simply add a column to your table where you could put id of the row that was cloned.

提交回复
热议问题