X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (mx2.hub.org [200.46.204.254]) by postgresql.org (Postfix) with ESMTP id 01C6011F670B for ; Mon, 17 Apr 2006 16:46:28 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: -2.237 X-Spam-Level: X-Spam-Status: No, score=-2.237 required=5 tests=[AWL=0.364, BAYES_00=-2.599, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] Received: from postgresql.org ([200.46.204.71]) by localhost (mx2.hub.org [200.46.204.254]) (amavisd-new, port 10024) with ESMTP id 5N8GeVtFqBz6 for ; Mon, 17 Apr 2006 16:46:16 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id B3AB411F6294 for ; Mon, 17 Apr 2006 16:46:14 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k3HJkDjc004552; Mon, 17 Apr 2006 15:46:13 -0400 (EDT) To: "Jim C. Nasby" cc: pgsql-admin@postgresql.org Subject: Re: DDL commands don't handle OID wrap In-reply-to: <20060417193829.GN49405@pervasive.com> References: <20060417193829.GN49405@pervasive.com> Comments: In-reply-to "Jim C. Nasby" message dated "Mon, 17 Apr 2006 14:38:30 -0500" Date: Mon, 17 Apr 2006 15:46:13 -0400 Message-ID: <4551.1145303173@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200604/149 X-Sequence-Number: 21318 "Jim C. Nasby" writes: > Haven't seen this in previous discussions of OID wrap in the archives. > The issue is that DDL statements don't make any attempt to skip past > used ranges of OIDs. > duplicate key violates unique constraint "pg_attrdef_oid_index" If you can make that happen in 8.1, I'd be fascinated to look at the test case. 2005-08-11 21:35 tgl * doc/src/sgml/ddl.sgml, src/backend/access/heap/heapam.c, src/backend/access/heap/tuptoaster.c, src/backend/access/transam/varsup.c, src/backend/catalog/catalog.c, src/backend/catalog/heap.c, src/backend/catalog/index.c, src/backend/catalog/pg_type.c, src/backend/commands/dbcommands.c, src/backend/commands/trigger.c, src/backend/commands/typecmds.c, src/backend/storage/large_object/inv_api.c, src/backend/utils/cache/relcache.c, src/bin/pg_dump/pg_backup_archiver.c, src/bin/pg_dump/pg_dump.c, src/include/access/transam.h, src/include/catalog/catalog.h, src/include/catalog/pg_type.h, src/include/utils/rel.h, src/include/utils/relcache.h: Solve the problem of OID collisions by probing for duplicate OIDs whenever we generate a new OID. This prevents occasional duplicate-OID errors that can otherwise occur once the OID counter has wrapped around. Duplicate relfilenode values are also checked for when creating new physical files. Per my recent proposal. regards, tom lane