Re: Parent Id

From: Gene Vital <genevital(at)karibe(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Parent Id
Date: 2003-10-09 19:55:27
Message-ID: 3F85BD2F.7090802@karibe.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

have an example :)

Bruno Wolff III wrote:

> On Thu, Oct 09, 2003 at 14:26:21 -0400,
> Gene Vital <genevital(at)karibe(dot)com> wrote:
>
>>when inserting new records into parent / child tables, what is the best
>>recommended way of retrieving the pkey value from the parent table when
>>using auto incrementing fields ?
>
>
> You want to use currval. currval will return the last value obtained
> by nextval in the same session, so it is safe to use without any additional
> locking.
>

--
Eugene Vital
Any technology indistinguishable from magic is insufficiently advanced.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2003-10-09 20:13:52 Re: Domains (was Re: int1?)
Previous Message Marek Lewczuk 2003-10-09 19:52:58 SQL query problem