Class::DBI::Pg automate the setup of Class::DBI columns and primary key for Postgres. select Postgres system catalog and find out all columns, primary key and SERIAL type column. WWW: https://metacpan.org/release/Class-DBI-Pg