create table account ( user_id SERIAL not null primary key, username varchar(15) not null, passwd varchar(15) not null, person_id integer not null references person(person_id) on delete cascade, active bool not null default 'true', locked bool not null default 'false' ); #### peter_trialdb=> \d account Table "public.account" Column | Type | Modifiers ------------+-----------------------+-------------------------------------------------------------- account_id | integer | not null default nextval('account_account_id_seq'::regclass) username | character varying(15) | not null passwd | character varying(15) | not null person_id | integer | not null active | boolean | not null default true locked | boolean | not null default false Indexes: "account_pkey" PRIMARY KEY, btree (account_id) Foreign-key constraints: "account_person_id_fkey" FOREIGN KEY (person_id) REFERENCES person(person_id) ON DELETE CASCADE #### use strict; use Class::DBI::Loader; use Data::Dumper; my $loader = Class::DBI::Loader->new( dsn=>'dbi:Pg:dbname=peter_trialdb', user=>'peter', password=>'$3cr3t$qu!rr3l', namespace=>'Db', relationships=>1, options=>{ AutoCommit=>1 } ); #### ./automation.pl Use of uninitialized value in split at /usr/lib/perl5/site_perl/5.8.5/Class/DBI/Pg.pm line 26. public.account has no primary key at /usr/lib/perl5/site_perl/5.8.5/Class/DBI/Loader/Generic.pm line 164