Re: CTID: Anyway to lock it?

From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
To: "Jim Hines" <jhines(at)wdtv(dot)com>, <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: CTID: Anyway to lock it?
Date: 2002-11-04 19:36:30
Message-ID: 03AF4E498C591348A42FC93DEA9661B8128B81@mail.vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

> -----Original Message-----
> From: Jim Hines [mailto:jhines(at)wdtv(dot)com]
> Sent: 04 November 2002 19:00
> To: pgsql-odbc(at)postgresql(dot)org
> Subject: [ODBC] CTID: Anyway to lock it?
>
>
> Hello,
> I have a piece of software that uses specific record numbers
> in order to pull
> data from PG. It uses this query:
> select "votes" , CTID, OID from database where ctid in ('(27, 55)')'
>
> Apparently the CTID changes per record with each update. Is
> there anyway to
> lock the CTID so that it doesn't change everytime I update a record?

No, I would think not. From the docs:

Ctid - The tuple ID of the tuple within its table. This is a pair (block
number, tuple index within block) that identifies the physical location
of the tuple. Note that although the ctid can be used to locate the
tuple very quickly, a row's ctid will change each time it is updated or
moved by VACUUM FULL. Therefore ctid is useless as a long-term row
identifier. The OID, or even better a user-defined serial number, should
be used to identify logical rows.

Regards, Dave.

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Jim Hines 2002-11-04 20:05:46 Re: CTID: Anyway to lock it?
Previous Message Tom Lane 2002-11-04 19:33:19 Re: CTID: Anyway to lock it?