Re: ctid & updates - Mailing list pgsql-general

From Jan Wieck
Subject Re: ctid & updates
Date
Msg-id 200206032000.g53K0mh03880@saturn.janwieck.net
Whole thread Raw
In response to ctid & updates  ("Joshua b. Jore" <josh@greentechnologist.org>)
Responses Re: ctid & updates
List 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@Yahoo.com #



pgsql-general by date:

Previous
From: Jan Wieck
Date:
Subject: Re: SOLVED: invalid type error
Next
From: Doug Fields
Date:
Subject: Re: Automatic value truncation during update