Re: Ask ctid

From: Alban Hertroys <dalroi(at)solfertje(dot)student(dot)utwente(dot)nl>
To: Achmad Nizar Hidayanto <nizar(at)cs(dot)ui(dot)ac(dot)id>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: Ask ctid
Date: 2008-03-07 19:05:47
Message-ID: 83E4E7C9-F333-4680-8215-74B1A8E6B9B2@solfertje.student.utwente.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mar 7, 2008, at 9:28 AM, Achmad Nizar Hidayanto wrote:

> Thank you for the comment,
>
> I just wonder, how come i have two identic rows. I have set the
> primary key and set it as a unique. That's why i take
> a look at ctid (in real, i don't use this id. I just tried to trace
> why i have two identic rows. After examining the physical
> id using ctid, i found that the two identic rows differ in their
> ctid).
>
> Having this case, can i conclude that postgre cannot guarantee the
> uniqueness of primary key? or is it just a bug of old
> version of postgre?

Well, it's certainly surprising your Postgres intallation is doing
that - it's one of the things Postgres is good at, but we lack
information to see what's really going on here.

You're mentioning you're using an old version, which one? The output
of "select version();" should do.

Can you show us the table definition with the primary key and the two
identical records you mentioned?

> Many thanks for your help.
>
>
> Nizar
> =====
>
> Tom Lane wrote:
>> Achmad Nizar Hidayanto <nizar(at)cs(dot)ui(dot)ac(dot)id> writes:
>>>
>>> I implement database in my faculty using Postgre. I have a
>>> problem with ctid in my tables. Let say, i have table STUDENT
>>> with #STU as the primary key. I don't know what happend in this
>>> table, some rows have exactly the same value ( i also have set
>>> the #STU as unique). After tracing the table, i found that the
>>> two rows differ in ctid value. As the impact, my application
>>> cannot operate well.
>> There are some known bugs in older PG releases that could lead to
>> duplicate rows (actually, to multiple versions of a row all being
>> seen as live). If you're not on the latest minor version of your
>> release series, update. regards, tom lane
>
>

Alban Hertroys

--
If you can't see the forest for the trees,
cut the trees and you'll see there is no forest.

!DSPAM:737,47d19038233091286811304!

In response to

  • Re: Ask ctid at 2008-03-07 08:28:12 from Achmad Nizar Hidayanto

Responses

  • Re: Ask ctid at 2008-03-10 13:09:17 from Achmad Nizar Hidayanto

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2008-03-07 19:28:33 Re: Problems with 8.3
Previous Message Martijn van Oosterhout 2008-03-07 18:48:59 Re: Ask ctid