X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FPg.pm;h=1352c25722e50e7d9accb268b3b6e76896024925;hb=75d079145a507a0e5ff89b2676d383f4fd1a5511;hp=75b22e449fec020b30607fe2e166f4989c9c4829;hpb=884559b13fe244d3e446d127e9fd21ea8d7c6eb3;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI/Pg.pm b/lib/DBIx/Class/Storage/DBI/Pg.pm index 75b22e4..1352c25 100644 --- a/lib/DBIx/Class/Storage/DBI/Pg.pm +++ b/lib/DBIx/Class/Storage/DBI/Pg.pm @@ -22,11 +22,11 @@ sub get_autoinc_seq { : (undef,$source->name); while (my $col = shift @pri) { my $info = $dbh->column_info(undef,$schema,$table,$col)->fetchrow_arrayref; - if (defined $info->[12] and $info->[12] =~ + if (defined $info->[12] and $info->[12] =~ /^nextval\(+'([^']+)'::(?:text|regclass)\)/) { return $1; # may need to strip quotes -- see if this works - } + } } } @@ -36,7 +36,7 @@ sub sqlt_type { 1; -=head1 NAME +=head1 NAME DBIx::Class::Storage::DBI::Pg - Automatic primary key class for PostgreSQL