owncloud/core — pull request #556 by icewind1991 (2012-11-22 23:35:38+00:00)
Title: use lastval() to get the insert id in postgesql

This solves the issue with getting the last insert id for me in the filesystem branch.

The old way relied on getting the value from the primary key sequence for the table but this has several problems.

- This fails when the primary key is not an autoincrease integer
- We need to be able to guess the sequence name, which doesn't seem consistent across installations, the current guess is tablename_id_seq', which seems to work for most people but on my current test setup the correct name seems to be tablename.primaryKeyName

Using lastval() removes the need to know the sequence name and should work for all installations