Re: duplicated values on primary key field on reindex

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Weerts, Jan" <j(dot)weerts(at)i-views(dot)de>
Cc: "Scott Marlowe" <smarlowe(at)g2switchworks(dot)com>, "Pgsql-General \(E-Mail\)" <pgsql-general(at)postgresql(dot)org>
Subject: Re: duplicated values on primary key field on reindex
Date: 2006-07-14 01:25:10
Message-ID: 24514.1152840310@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Weerts, Jan" <j(dot)weerts(at)i-views(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-07-14 02:30:34 Re: Need help with quote escaping in exim for postgresql
Previous Message David Fetter 2006-07-14 00:04:11 Re: Timestamp vs timestamptz