#!/usr/bin/perl # Replace , , and below with your actual DB, user, and password. use DBI; $dbh = DBI->connect ("dbi:Pg:dbname=", "", ""); $sth = $dbh->prepare("SELECT * FROM testschema.testtable"); $sth->execute(); while ( ($test_id,$test_name,$test_email) = $sth->fetchrow_array() ) { print "$test_id\t\t $test_name\t\t $test_email \n"; } $sth->finish(); $dbh->disconnect();