X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FPg.pm;h=250707b90a9a08e116f8e41bfbafadc4d4dc637b;hb=3895349e454e6b3fd36188b27e565acfa7da601e;hp=1444cfef1a3b0fe0857dd1be50440ff838932422;hpb=734868da8acee7ff14dff8b91ab18f0edc3c10df;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI/Pg.pm b/lib/DBIx/Class/Storage/DBI/Pg.pm index 1444cfe..250707b 100644 --- a/lib/DBIx/Class/Storage/DBI/Pg.pm +++ b/lib/DBIx/Class/Storage/DBI/Pg.pm @@ -17,9 +17,12 @@ warn __PACKAGE__.": DBD::Pg 2.9.2 or greater is strongly recommended\n" if ($DBD::Pg::VERSION < 2.009002); # pg uses (used?) version::qv() sub can_insert_returning { - # FIXME !!! - # pg before 8.2 doesn't support this, need to check version - return 1; + my $self = shift; + + return 1 + if $self->_server_info->{dbms_ver_normalized} >= 8.002; + + return 0; } sub with_deferred_fk_checks { @@ -37,6 +40,7 @@ sub with_deferred_fk_checks { after => sub { $txn_scope_guard->commit }); } +# only used when INSERT ... RETURNING is disabled sub last_insert_id { my ($self,$source,@cols) = @_;