#!/usr/bin/perl -w # This code available under a BSD 3-clause license. # http://opensource.org/licenses/BSD-3-Clause use strict; use DBI; my $dbh = DBI->connect("dbi:Pg:host=172.21.2.10;db=lab", "labUser", "labPass", { AutoCommit => 0, RaiseError => 1 } ); defined $dbh or die "db connect failed"; # Insert 500 rows of a common phrase: my $phrase = "The quick red fox jumps over the lazy brown dog!"; my $sth = $dbh->prepare(qq[ INSERT INTO phrase (phrase) VALUES (?) ]); $sth->execute($phrase) for (1..500); $dbh->commit();