#!/usr/bin/perl use DBI; use DBD::Pg; my $dbh = DBI->connect( 'dbi:Pg:dbname=template1;host=localhost', 'postgres', undef ); die DBI->errstr;