From: | Frank Bax <fbax(at)sympatico(dot)ca> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: [NOVICE] OID Question |
Date: | 2004-11-11 22:00:06 |
Message-ID: | 5.2.1.1.0.20041111165732.02d761a0@pop6.sympatico.ca |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general pgsql-novice |
At 03:34 PM 11/11/04, Geoffrey wrote:
>Bruno Wolff III wrote:
>>On Thu, Nov 11, 2004 at 10:04:30 -0500, Terry Lee Tucker
>><terry(at)esc1(dot)com> wrote:
>>
>>>Greetings,
>>>Here is a simple question:
>>>Is it ok to put a unique index on the oid for my tables? We are in
>>>the process
>>
>>Yes, but you may occasionally have insert failures if the oid wraps
>>around and you try to reuse one on an insert.
>
>So this prompts a question regarding the documentation. I'm assuming that
>I can address the wrap-around issue based on the following found under
>"Notes" section of the "Create Table" document:
>
>"Whenever an application makes use of OIDs to identify specific rows of a
>table, it is recommended to create a unique constraint on the oid column
>of that table, to ensure that OIDs in the table will indeed uniquely
>identify rows even after counter wraparound."
>
>Am I reading this correctly? If I place a unique constraint on the oid
>column, I will not have to worry about oid wrap around?
Wrong. Wrap around by itself is not the problem here. When wrap around
occurs, it will be possible to have two rows with the same oid. The
"unique contraint" will prevent duplicate oid's in the table.
Frank
From | Date | Subject | |
---|---|---|---|
Next Message | A. Mous | 2004-11-11 22:15:47 | Re: When to switch to Postgres 8.0? |
Previous Message | Wayne Brown | 2004-11-11 21:39:36 | Re: comp.database.postgresql.* |
From | Date | Subject | |
---|---|---|---|
Next Message | Terry Lee Tucker | 2004-11-11 23:24:30 | Re: OID Question |
Previous Message | Tom Lane | 2004-11-11 21:18:23 | Re: version changes |