On Aug 21, 2013, at 8:09 PM, Vincent Veyron <vv.li...@wanadoo.fr> wrote:
> my $dbh = DBI->connect_cached( "DBI:Pg:dbname=aspro", 'www-data', > undef, { > PrintError =>1, > RaiseError => 1, > AutoCommit => 1, > pg_bool_tf => 't', > private_preferred_datestyle => $preferred_datestyle, > > Callbacks => { > "connect_cached.new" => sub { > shift->do(qq{ > SET datestyle TO $preferred_datestyle > }); > return; > } > } > > } ) > or croak "Cannot connect to db: $DBI::errstr"; > > return $dbh; > > } Try the connected callback, instead: http://justatheory.com/computers/databases/postgresql/execute-on-select.html Best, David