Re: transaction safety

From: DaVinci <bombadil(at)wanadoo(dot)es>
To: Lista PostgreSql <pgsql-general(at)postgresql(dot)org>
Subject: Re: transaction safety
Date: 2001-02-12 11:34:14
Message-ID: 20010212123414.A685@fangorn.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Feb 12, 2001 at 11:08:55AM +0000, Oliver Elphick wrote:
> DaVinci wrote:
> > Hi all.
> >
> > I want to create a new tuple of main info and detail tuples (in
> > different tables) that are joined by a key field. Key field is created by
> > generator automatically and I need that number in order to assign to detail
> > tuples. How can I to get that number in a safe way?.
>
> A successful INSERT returns the oid of the row just created; so get the
> new value with a query like this:
>
> SELECT key_field FROM table WHERE oid = new_oid_value;

I have a new question for this idea (thanks). When Database is big, do i
need index for oid field to speed select?.

Greets.

David

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Ansley 2001-02-12 13:08:01 RE: transaction safety
Previous Message Oliver Elphick 2001-02-12 11:08:55 Re: transaction safety