返回插入数据,轻松获取插入记录的serial值
最近更新时间: 2025-02-18 16:02:00
postgres=# insert into tbase(nickname) values('TDSQL PG好') returning *;
id | nickname
----+-----------
7 | TDSQL PG好
(1 row)
- 指定返回的字段。
INSERT 0 1
postgres=# insert into tbase(nickname) values('hello TDSQL PG') returning id;
id
----
8
(1 row)