Re: An Idea for OID conflicts

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Gevik Babakhani <pgdev(at)xs4all(dot)nl>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: An Idea for OID conflicts
Date: 2006-09-18 18:10:58
Message-ID: 450EE132.7050701@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gevik Babakhani wrote:
> Folks,
>
> I would like to have your thoughts on a solution for the duplicate OIDs.
>
> I wanted to apply the uuid patch on a newly download source from the
> CVS. Patching and "make install" went just okay but "make check" and
> initdb failed to my surprise. A quick look at duplicate_oids showed that
> almost all of the OIDs I got available from unused_oids were already in
> use. So naturally I went "!!?! segmentation fault **!!?".
>
> I can only imagine how time consuming this can be for the committers to
> correct these manually.
>
> I think we can solve this problem with the combination of the following
> three steps.
>
> 1. When using new OIDs always start from a fixed number. For example
> 10000. This way the new OIDs are easy to recognize and the developer can
> continue the work.
> 2. Always use the new OIDs sequentially.
> 3. Make a small utility that goes through a patch, finds the new OIDs
> and changes them back to a value specified by the committer(s).
>
> Would this be workable?
>
>

My idea was to have a file called reserved_oids.h which would contain
lines like:

#error "do not include this file anywhere"
CATALOG(reserved_for_foo_module,9876) /* 2006-09-18 */

and which would be examined by the unused_oids script.

To get oids reserved, a committer would add lines to that file for you.
When your patch was done, it would include stuff to remove those lines
from the file.

That way you will be working with the oids your patch will eventually
use - no later fixup necessary.

Every release the file would be cleaned of old entries if necessary.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2006-09-18 18:29:15 Re: 8.2 beta blockers
Previous Message Tom Lane 2006-09-18 18:09:11 Re: 8.2 beta blockers