#!/usr/bin/perl
#
use DBI;

$dbh = DBI->connect("DBI:Pg:dbname=chlor");

$sth = $dbh->prepare("DROP TABLE reftest");
$sth->execute;
print "DROP T: ".$sth->errstr."\n";
$sth = $dbh->prepare("DROP SEQUENCE reftest_id_seq");
$sth->execute;
print "DROP S: ".$sth->errstr."\n";
$sth = $dbh->prepare("CREATE TABLE reftest(id serial,name text unique)");
$sth->execute;
print "CREATE: ".$sth->errstr."\n";
$sth->finish;

$sth = $dbh->prepare("INSERT INTO reftest(name) VALUES('Knud')");
$sth->execute;
print "INSERT: ".$sth->errstr."\n";
$sth->execute;
print "INSERT: ".$sth->errstr."\n";
$sth->finish;

$dbh->disconnect;
