DBD::Pg

The standard Perl client interface driver

DBD::Pg (sometimes referred to as dbdpg) is the standard Perl DBI driver for PostgreSQL, enabling Perl applications to connect direcly to PostgreSQL.

DBD::Pg was first released in 1997.

Release history

This list shows major releases in the 3.x series; for a full and detailed list of releases see the change log and the release page.

Notes

Examples

Connect to database and execute "SELECT 'Hello World'":

use strict;
use DBI;

my $dbh = DBI->connect(
	'dbi:Pg:dbname=testdb',
	'testuser'
);

my $query = $dbh->prepare("SELECT 'Hello World'");
$query->execute();
printf("%s\n", $query->fetchrow_array());
$query->finish();

$dbh->disconnect();

Categories

Application interface

See also

libpq