#!/usr/local/bin/perl
#
# perl connection to EXKom database
#
use Pg;
use Benchmark;

$conn = Pg::connectdb("dbname=exkom");
die $conn->errorMessage unless PGRES_CONNECTION_OK eq $conn->status;

# print "Enter a state code :";
# $state_code = <STDIN>;

# chomp $state_code;
$result = $conn->exec("delete from junk");
$end = 10000;

$t0 = new Benchmark;

for ($i=1; $i < $end; $i++) {
     $result = $conn->exec("insert into junk values($i)");
}

$t1 = new Benchmark;
$td = timediff($t1, $t0);
print " the $end records took :", timestr($td) , "\n"
