Re: transaction safety - Mailing list pgsql-general

From DaVinci
Subject Re: transaction safety
Date
Msg-id 20010212123414.A685@fangorn.net
Whole thread Raw
In response to Re: transaction safety  ("Oliver Elphick" <olly@lfix.co.uk>)
List 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

pgsql-general by date:

Previous
From: "Oliver Elphick"
Date:
Subject: Re: transaction safety
Next
From: Michael Ansley
Date:
Subject: RE: transaction safety