|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * IDENTIFICATION
|
11 |
| - * $Header: /cvsroot/pgsql/src/backend/catalog/pg_constraint.c,v 1.11 2002/12/06 05:00:10 momjian Exp $ |
| 11 | + * $Header: /cvsroot/pgsql/src/backend/catalog/pg_constraint.c,v 1.12 2002/12/12 20:35:11 tgl Exp $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
@@ -439,18 +439,16 @@ RemoveConstraintById(Oid conId)
|
439 | 439 | con = (Form_pg_constraint) GETSTRUCT(tup);
|
440 | 440 |
|
441 | 441 | /*
|
442 |
| - * If the constraint is for a relation, open and exclusive-lock |
443 |
| - * the relation it's for. |
444 |
| - * |
445 |
| - * If the constraint is for a domain, open and lock the pg_type entry |
446 |
| - * tye constraint is used on. |
447 |
| - * |
448 |
| - * XXX not clear what we should lock, if anything, for assert constraints. |
| 442 | + * Special processing depending on what the constraint is for. |
449 | 443 | */
|
450 | 444 | if (OidIsValid(con->conrelid))
|
451 | 445 | {
|
452 | 446 | Relation rel;
|
453 | 447 |
|
| 448 | + /* |
| 449 | + * If the constraint is for a relation, open and exclusive-lock the |
| 450 | + * relation it's for. |
| 451 | + */ |
454 | 452 | rel = heap_open(con->conrelid, AccessExclusiveLock);
|
455 | 453 |
|
456 | 454 | /*
|
@@ -490,34 +488,14 @@ RemoveConstraintById(Oid conId)
|
490 | 488 | /* Keep lock on constraint's rel until end of xact */
|
491 | 489 | heap_close(rel, NoLock);
|
492 | 490 | }
|
493 |
| - /* Lock the domain row in pg_type */ |
494 | 491 | else if (OidIsValid(con->contypid))
|
495 | 492 | {
|
496 |
| - Relation typRel; |
497 |
| - HeapTuple typTup; |
498 |
| - ScanKeyData typKey[1]; |
499 |
| - SysScanDesc typScan; |
500 |
| - int nkeys = 0; |
501 |
| - |
502 |
| - typRel = heap_openr(TypeRelationName, RowExclusiveLock); |
503 |
| - |
504 |
| - ScanKeyEntryInitialize(&typKey[nkeys++], 0x0, |
505 |
| - ObjectIdAttributeNumber, F_OIDEQ, |
506 |
| - ObjectIdGetDatum(con->contypid)); |
507 |
| - |
508 |
| - typScan = systable_beginscan(typRel, TypeOidIndex, true, |
509 |
| - SnapshotNow, nkeys, typKey); |
510 |
| - |
511 |
| - typTup = systable_getnext(typScan); |
512 |
| - |
513 |
| - if (!HeapTupleIsValid(typTup)) |
514 |
| - elog(ERROR, "RemoveConstraintById: Type %d does not exist", |
515 |
| - con->contypid); |
516 |
| - |
517 |
| - systable_endscan(typScan); |
518 |
| - |
519 |
| - /* Keep lock on domain type until end of xact */ |
520 |
| - heap_close(typRel, NoLock); |
| 493 | + /* |
| 494 | + * XXX for now, do nothing special when dropping a domain constraint |
| 495 | + * |
| 496 | + * Probably there should be some form of locking on the domain type, |
| 497 | + * but we have no such concept at the moment. |
| 498 | + */ |
521 | 499 | }
|
522 | 500 | else
|
523 | 501 | {
|
|
0 commit comments