X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FPg.pm;h=5fcaa17cb816f0bd0e84e2a9a1f93cee042b98d3;hb=6412a5927691e6b8e3370edeb06ed3ef79c757b3;hp=49ca40dd86bb16f498537b1eda19462b7c457479;hpb=eeb8cfeb91eebb5bd979202c234c9facf71f0b25;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI/Pg.pm b/lib/DBIx/Class/Storage/DBI/Pg.pm index 49ca40d..5fcaa17 100644 --- a/lib/DBIx/Class/Storage/DBI/Pg.pm +++ b/lib/DBIx/Class/Storage/DBI/Pg.pm @@ -13,6 +13,13 @@ use base qw/DBIx::Class::Storage::DBI/; warn "DBD::Pg 1.49 is strongly recommended" if ($DBD::Pg::VERSION < 1.49); +sub with_deferred_fk_checks { + my ($self, $sub) = @_; + + $self->dbh->do('SET CONSTRAINTS ALL DEFERRED'); + $sub->(); +} + sub _dbh_last_insert_id { my ($self, $dbh, $seq) = @_; $dbh->last_insert_id(undef, undef, undef, undef, {sequence => $seq}); @@ -63,6 +70,7 @@ sub bind_attribute_by_data_type { my $bind_attributes = { bytea => { pg_type => DBD::Pg::PG_BYTEA }, + blob => { pg_type => DBD::Pg::PG_BYTEA }, }; if( defined $bind_attributes->{$data_type} ) { @@ -88,7 +96,7 @@ sub _svp_begin { sub _svp_release { my ($self, $name) = @_; - $self->dbh->pg_release($name;) + $self->dbh->pg_release($name); } sub _svp_rollback {