Re: Parent Id

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Gene Vital <genevital(at)karibe(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Parent Id
Date: 2003-10-09 18:43:17
Message-ID: 20031009184317.GA14131@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

In response to

  • Parent Id at 2003-10-09 18:26:21 from Gene Vital

Responses

Browse pgsql-general by date

  From Date Subject
Next Message jearl 2003-10-09 18:57:53 Re: Response from MySql AB (Re: Humor me: Postgresql vs.
Previous Message Jeff Boes 2003-10-09 18:37:19 Table partitioning for maximum speed?