Re: duplicated values on primary key field on reindex - Mailing list pgsql-general

From Tom Lane
Subject Re: duplicated values on primary key field on reindex
Date
Msg-id 24514.1152840310@sss.pgh.pa.us
Whole thread Raw
In response to Re: duplicated values on primary key field on reindex  ("Weerts, Jan" <j.weerts@i-views.de>)
List pgsql-general
"Weerts, Jan" <j.weerts@i-views.de> writes:
> Scott Marlowe wrote:
>> Can you get set of fields in that row to uniquely identify it by?
>>
>> If so, see if you can update that column to something else and
>> continue

> The only way would be to update by primarykey. But since the
> select on the primarykey field shows this "strange" ordering,
> I wonder, what effect an update would have.

CTID always works:

    SELECT ctid, otherstuff FROM table WHERE ... ;

    eyeball otherstuff to determine row you wish to hack

    UPDATE table SET ... WHERE ctid = '...';

Note: the act of UPDATE changes the row's ctid, don't be surprised.

            regards, tom lane

pgsql-general by date:

Previous
From: David Fetter
Date:
Subject: Re: Timestamp vs timestamptz
Next
From: Tom Lane
Date:
Subject: Re: Need help with quote escaping in exim for postgresql