#!/usr/local/bin/perl use strict; use warnings; use base qw/ Class::DBI /; my $dbname = "pure-ftpd"; my $user = "pure-ftpd"; my $pass = q(elided); my $host = "adjunct"; my $port = "5432"; main->connection("dbi:Pg:dbname=$dbname;host=$host;port=$port", $user, $pass, {FetchHashKeyName => 'NAME'}); # As pointed out by perrin, I tried with and # without the FetchHashKeyName flag. main->table('users'); main->columns(Primary => qw/ "User" /); main->columns(Others => qw/ "Password" "Uid" "Gid" "Dir" "ULBandwidth" "DLBandwidth" /); my $new = main->create ( { '"User"' => 'test', '"Password"' => 'foobarbaz', '"Uid"' => 5000, '"Gid"' => 5000, '"Dir"' => '/nonexistent', '"ULBandwidth"' => 5, '"DLBandwidth"' => 10 } );