Re: ctid & updates

From: Jan Wieck <janwieck(at)yahoo(dot)com>
To: "Joshua b(dot) Jore" <josh(at)greentechnologist(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: ctid & updates
Date: 2002-06-03 20:00:47
Message-ID: 200206032000.g53K0mh03880@saturn.janwieck.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Joshua b. Jore wrote:
> 1#
> I saw a post from Jan Wieck about how ctid can be used for a fast update.
> I noticed that ctid changes on update (as expected since it's really a new
> row). Is there anyway to get the new ctid from the update so later
> updates to the row can continue to use ctid to zero in on the row
> location?

That's one of the details I'm still thinking about. And in
the case of a cursor using a junk attribute it gets worse,
because there is no easy way to push that new value back into
the cursor's result set.

But I doubt that this would become a real world problem ever.
People who need to update one and the same DB row again and
again during the same transaction are spaghetti-code-script-
kiddies who know for sure that "a cursor's that thingy on ya
screen that ya move withe mouse", so we're pretty safe here
:-p

> 2#
> Also, is ctid unique for each row?

Yes, per table.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Doug Fields 2002-06-03 20:06:36 Re: Automatic value truncation during update
Previous Message Jan Wieck 2002-06-03 19:47:58 Re: SOLVED: invalid type error