mirror of
https://github.com/postgres/postgres.git
synced 2025-05-05 09:19:17 +03:00
Put a CHECK_FOR_INTERRUPTS call into the loops that try to find a unique new
OID or new relfilenode. If the existing OIDs are sufficiently densely populated, this could take a long time (perhaps even be an infinite loop), so it seems wise to allow the system to respond to a cancel interrupt here. Per a gripe from Jacky Leng. Backpatch as far as 8.1. Older versions just fail on OID collision, instead of looping.
This commit is contained in:
parent
f8dc95540e
commit
d64f38d1a1
@ -10,7 +10,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/catalog/catalog.c,v 1.68 2006/10/04 00:29:50 momjian Exp $
|
* $PostgreSQL: pgsql/src/backend/catalog/catalog.c,v 1.68.2.1 2008/02/20 17:44:20 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -368,6 +368,8 @@ GetNewOidWithIndex(Relation relation, Relation indexrel)
|
|||||||
/* Generate new OIDs until we find one not in the table */
|
/* Generate new OIDs until we find one not in the table */
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
CHECK_FOR_INTERRUPTS();
|
||||||
|
|
||||||
newOid = GetNewObjectId();
|
newOid = GetNewObjectId();
|
||||||
|
|
||||||
ScanKeyInit(&key,
|
ScanKeyInit(&key,
|
||||||
@ -417,6 +419,8 @@ GetNewRelFileNode(Oid reltablespace, bool relisshared, Relation pg_class)
|
|||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
CHECK_FOR_INTERRUPTS();
|
||||||
|
|
||||||
/* Generate the OID */
|
/* Generate the OID */
|
||||||
if (pg_class)
|
if (pg_class)
|
||||||
rnode.relNode = GetNewOid(pg_class);
|
rnode.relNode = GetNewOid(pg_class);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user