PostgreSQL uses sequences to generate values for serial columns and serial columns are generally what is used for "auto-incrementing" columns in PostgreSQL. Sequences have names and are, in general, independent of any particular table so you could have one sequence generating unique IDs for several different tables; the sequence name is what lastInsertId wants as its argument:

For example, PDO_PGSQL() requires you to specify the name of a sequence object for the name parameter.

The sequence object created by PostgreSQL is automatically named [table]_[column]_seq, So:

$id = $db->lastInsertId('tableName_columnName_seq');

reference:http://stackoverflow.com/questions/10492566/lastinsertid-does-not-work-in-postgresql

最新文章

  1. DB2 JDBC
  2. Hibernate Id Generator and Primary Key
  3. JavaScript判断图片是否加载完成的三种方式
  4. 一个Java对象到底占用多大内存?
  5. Introduction to Project Management(II)
  6. Oracle RAC环境下如何更新patch(Rolling Patch)
  7. kubuntu/ubuntu下安装fcitx输入法
  8. Linux64位程序中的漏洞利用
  9. Educational Codeforces Round 56 (Rated for Div. 2) D
  10. Java8虚拟机内存模型
  11. python 字典 拼接SQL语句
  12. 关于NGUI Shader 和 Draw Call的优化 & 模糊shader
  13. 十四、文件和目录——文件时间和utime函数
  14. 转载:JAVA序列化与反序列化 (作者:YSOcean)
  15. CSS background-image背景图片相关介绍
  16. 第二个Sprint ------第七天、第八天、第九天、第十天,第十一天
  17. 【HNOI2007】紧急疏散
  18. Java学习(异常类)
  19. 2017-2018-1 JaWorld 团队作业--冲刺2
  20. MongoDB安装及启动

热门文章

  1. java装饰模式
  2. CSS行高line-height的一些深入理解及应用
  3. uitextfield银行卡加空格
  4. Myeclipse10、Maven构建Javaweb项目
  5. 初识Spark(Spark系列)
  6. kafka_2.11-0.10.0.0安装步骤
  7. Sub Lime Text
  8. [转]查看Android源码版本
  9. 第八十七节,html5+css3pc端固定布局,大纲算法,section和div,结构分析
  10. Algorithm 算法