From: David Kamholz Date: Sat, 9 Dec 2006 20:39:02 +0000 (+0000) Subject: die in Storage::DBI::Pg when it can't find the autoinc sequence X-Git-Tag: v0.08010~208 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d12926f69a0df62c454b1c6fec2798be5c2e909f;p=dbsrgits%2FDBIx-Class.git die in Storage::DBI::Pg when it can't find the autoinc sequence --- diff --git a/lib/DBIx/Class/Storage/DBI/Pg.pm b/lib/DBIx/Class/Storage/DBI/Pg.pm index e211c05..5d7a0bf 100644 --- a/lib/DBIx/Class/Storage/DBI/Pg.pm +++ b/lib/DBIx/Class/Storage/DBI/Pg.pm @@ -16,6 +16,9 @@ warn "DBD::Pg 1.49 is strongly recommended" sub last_insert_id { my ($self,$source,$col) = @_; my $seq = ($source->column_info($col)->{sequence} ||= $self->get_autoinc_seq($source,$col)); + $self->throw_exception("could not fetch primary key for " . $source->name . ", could not " + . "get autoinc sequence for $col (check that table and column specifications are correct " + . "and in the correct case)") unless defined $seq; $self->_dbh->last_insert_id(undef,undef,undef,undef, {sequence => $seq}); }