use strict; use warnings; use DBI; my $dbname = "test"; my $dbstring = "dbi:Pg:dbname=$dbname"; my $dbuser = "postgres"; my $dbpwd = "postgres"; my $dbh = DBI->connect($dbstring, $dbuser, $dbpwd, {AutoCommit => 0}) || die "connection failed: $DBI::errstr\n"; $dbh->disconnect();