Re: 8.1, OID's and plpgsql - Mailing list pgsql-general

From Jim C. Nasby
Subject Re: 8.1, OID's and plpgsql
Date
Msg-id 20051203022257.GY13642@nasby.net
Whole thread Raw
In response to Re: 8.1, OID's and plpgsql  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: 8.1, OID`s and plpgsql
List pgsql-general
On Fri, Dec 02, 2005 at 06:58:39PM -0500, Tom Lane wrote:
> "Jim C. Nasby" <jim@nasby.net> writes:
> > Maybe the docs should be changed to just say that you should never reuse
> > a ctid outside of the transaction you obtained the ctid in?
>
> That's not a sufficient rule either: someone else could still delete or
> update the row while your transaction runs.  You'd really have to SELECT
> FOR UPDATE or FOR SHARE to be sure the ctid remains stable.  (Of course,
> this isn't an issue for the case of a row you just inserted yourself,
> since no one else can see it yet to change it.)
>
> The paragraph defining ctid is not the place for a discussion of how it
> could be used ... I'm not quite sure where is, though.

Maybe the MVCC paragraph?

Related to the original question though, is there actually any way to
get the ctid of a row that was just inserted?
--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Reduce NUMERIC size by 2 bytes, reduce max length to 508 digits
Next
From: "Jim C. Nasby"
Date:
Subject: Re: 8.1, OID's and plpgsql