Skip site navigation (1) Skip section navigation (2)

Re: get a pkey/id back from/after an insert

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: Corey <corey(at)bitworthy(dot)net>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: get a pkey/id back from/after an insert
Date: 2006-06-20 02:10:01
Message-ID: 20060620021002.47854.qmail@web31801.mail.mud.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-novice
> Excellent - yes, this is ultimately the same thing I was hoping to achieve:
> a single operation, rather than two or more disparate actions.
> 
> Thankyou for the extra info and the link, I will definitely check that out very
> soon ( right now I'm in crunch mode and just to get something working,
> even if it's less elegant ).  I'll post to the list if I successfully manage to
> get the single-statement, non-view solution working.

Well for testing purposes it should be fine to explicitly call out currentval.  But be careful if
you are going to be using multiply connections at onces.  I am not sure that currentval will give
you what you want if another connection calls nextval first before you insert a record to your
child table.

Regards,

Richard Broersma Jr.

In response to

Responses

pgsql-novice by date

Next:From: satheesh GnanasekaranDate: 2006-06-20 06:25:03
Subject: Doubt in stored procedure
Previous:From: CoreyDate: 2006-06-19 22:27:53
Subject: Re: get a pkey/id back from/after an insert

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group