pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Patnude <GPatnude@adelphia.net>
To: pgsql-hackers@postgresql.org
To: pgsql-general@postgresql.org
To: pgsql-sql@postgresql.org
Subject: Retrieving the new "nextval" for primary keys....
Date: Fri, 23 Aug 2002 18:15:28 -0700
Message-ID: <ak6lse$a9a$1@news.hub.org> (raw)

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'

)









view thread (4+ messages)  latest in thread

Message-ID: <ak6lse$a9a$1@news.hub.org>
Permalink:  ../ak6lse$a9a$1@news.hub.org/
Also on:    postgresql.org/message-id/ak6lse$a9a$1@news.hub.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: GPatnude@adelphia.net, pgsql-hackers@postgresql.org, pgsql-general@postgresql.org
  Subject: Re: Retrieving the new "nextval" for primary keys....
  In-Reply-To: <ak6lse$a9a$1@news.hub.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox