Retrieving the new "nextval" for primary keys.... - Mailing list pgsql-sql

From Greg Patnude
Subject Retrieving the new "nextval" for primary keys....
Date
Msg-id ak6lse$a9a$1@news.hub.org
Whole thread Raw
List pgsql-sql
I am using postgreSQL with Perl::CGI and Perl::DBI::Pg... I would like to be
able to insert a row from my Perl script [$SQL->exec();] and have postgreSQL
return the id of the newly inserted record (new.id) directly to the Perl
script for further processing... Anyone with a solution / idea ???

Nearly EVERY table I create in postgreSQL (7.2) has the following minimum
structure:

create table "tblName" (
   id int4 primary key nextval ("tblName_id_seq"),
   ..field...   ..field...   ..field...
   create_dt date default 'CURRENT_DATE',   change_dt timestamptz default 'now()',   active_flag bool default 'TRUE'

)








pgsql-sql by date:

Previous
From: Mathieu Arnold
Date:
Subject: Re: triggers and plpgsql question
Next
From: "OU"
Date:
Subject: Re: Separating data sets in a table