if (!exists($ENV{DBDPG_MAINTAINER})) {
    print "1..0\n";
    exit;
}

use strict;
use DBI;

main();

sub main {
    my ($n, $dbh, $sth);
    
    print "1..3\n";
    
    $n = 1;
    
    $dbh = DBI->connect("dbi:Pg:dbname=$ENV{DBDPG_TEST_DB};host=$ENV{DBDPG_TEST_HOST}", $ENV{DBDPG_TEST_USER}, $ENV{DBDPG_TEST_PASS}, {RaiseError => 1, PrintError => 0, AutoCommit => 0});
    
    print "ok $n\n"; $n++;
    
    $sth = $dbh->prepare(q{SELECT * FROM test});
    $dbh->disconnect();
        
    print "ok $n\n"; $n++;

    eval {
        $sth->execute();
    };
    if (!$@) {
        print "not ";
    }
    
    print "ok $n\n"; $n++;
}

1;
