Skip Menu |

This queue is for tickets about the DBD-Pg CPAN distribution.

Report information
The Basics
Id: 52441
Status: resolved
Priority: 0/
Queue: DBD-Pg

People
Owner: Nobody in particular
Requestors: wes [...] barely3am.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: 3.10.0



Subject: last_insert_id() breaks when using table inheritance
Pg.pm +321 I've only confirmed this in 2.8.7; but, it appears as if when you're using Table Inherit's within pgsql, the function last_insert_id() breaks and doesn't find the NEXTVAL (since the seq doesn't appear in the table itself when inherited). Testing with Class::DBI I can manually work-around the issue by setting the inherited sequence, but might wanna see if there's a way to do this cleanly in the last_insert_id() fctn. I dunno if that's possible using the catalog or not. Figured it was at least worth documenting.
Could you provide a quick sample schema and test file?
I think this could be closed by documenting the issue with inherited tables and pointing out that using a RETURNING clause instead of last_insert_id is strongly recommended.
Have this working in e34d46682af50ad22cc2b3b0f0d43e8a0420682f Will be part of the next release (version 3.10.0)