V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
cevincheung
V2EX  ›  PostgreSQL

PostgreSQL 获取自增 ID 的问题

  •  
  •   cevincheung · 2015-09-09 01:33:16 +08:00 · 2792 次点击
    这是一个创建于 3158 天前的主题,其中的信息可能已经有所发展或是发生改变。

    明明可以通过SELECT LASTVAL () AS insert_id很方便的获取同一个连接( session )中的最后插入的 insert id 。那为什么还要非得用select currval (regclass::seqname )来获取 id 呢?

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2194 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 06:55 · PVG 14:55 · LAX 23:55 · JFK 02:55
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.