Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5ce6829

Browse files
committed
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 denselypopulated, 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.
1 parentf78611b commit5ce6829

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎src/backend/catalog/catalog.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/catalog/catalog.c,v 1.72 2008/01/01 19:45:48 momjian Exp $
13+
* $PostgreSQL: pgsql/src/backend/catalog/catalog.c,v 1.73 2008/02/20 17:44:09 tgl Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -374,6 +374,8 @@ GetNewOidWithIndex(Relation relation, Relation indexrel)
374374
/* Generate new OIDs until we find one not in the table */
375375
do
376376
{
377+
CHECK_FOR_INTERRUPTS();
378+
377379
newOid=GetNewObjectId();
378380

379381
ScanKeyInit(&key,
@@ -423,6 +425,8 @@ GetNewRelFileNode(Oid reltablespace, bool relisshared, Relation pg_class)
423425

424426
do
425427
{
428+
CHECK_FOR_INTERRUPTS();
429+
426430
/* Generate the OID */
427431
if (pg_class)
428432
rnode.relNode=GetNewOid(pg_class);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp