> I asked the question how do you get a record without going through an
> index, the answer was CTID, which unfortunately changes when the row is
> updated.

The ctid is a physical location of the row. On update a new tuple is written 
in a new location, that is why the ctid changes. The old tuple has a system 
field
t_ctid which is then a forward pointer to the new tuple.

Thus you can follow that chain until the visible tuple is found. 
The current tid = tid does not do that (I think because the ODBC driver
which was the first to use it (for result set modification) needed to notice 
when the 
tuple was updated underneath).

But you can use:
        select * from atab where ctid = currtid2('atab', '(0,1)'); -- '(0,1)' 
is the old ctid

Of course the old ctid is only valid until (auto)vacuum marks it free.
Without vacuum you are currently safe to use the currtid functions.

Andreas

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to