Re: 8.1, OID's and plpgsql

From: "Jim C(dot) Nasby" <jim(at)nasby(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Uwe C(dot) Schroeder" <uwe(at)oss4u(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: 8.1, OID's and plpgsql
Date: 2005-12-03 02:28:08
Message-ID: 20051203022808.GZ13642@nasby.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Fri, Dec 02, 2005 at 06:58:39PM -0500, Tom Lane wrote:
> "Jim C. Nasby" <jim(at)nasby(dot)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,

Erm, even if they do delete or update the row, wouldn't it's ctid still
remain valid since nothing could vacuum it yet? Of course, now it'd
probably see the old version of the row, but that behavior could be
changed so that the database would follow t_ctid in that case.
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-12-03 03:49:57 Re: was a initdb required from 8.1beta3 -> beta4?
Previous Message Jim C. Nasby 2005-12-03 02:22:57 Re: 8.1, OID's and plpgsql

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-12-03 03:08:59 Re: strange behavior (corruption?) of large production database
Previous Message Jim C. Nasby 2005-12-03 02:22:57 Re: 8.1, OID's and plpgsql