|
36 | 36 | *
|
37 | 37 | *
|
38 | 38 | * IDENTIFICATION
|
39 |
| - * $PostgreSQL: pgsql/src/backend/commands/vacuumlazy.c,v 1.92 2007/09/1017:58:45 alvherre Exp $ |
| 39 | + * $PostgreSQL: pgsql/src/backend/commands/vacuumlazy.c,v 1.93 2007/09/1021:40:03 alvherre Exp $ |
40 | 40 | *
|
41 | 41 | *-------------------------------------------------------------------------
|
42 | 42 | */
|
@@ -802,6 +802,9 @@ lazy_truncate_heap(Relation onerel, LVRelStats *vacrelstats)
|
802 | 802 | */
|
803 | 803 | RelationTruncate(onerel,new_rel_pages);
|
804 | 804 |
|
| 805 | +/* Now we're OK to release the lock. */ |
| 806 | +UnlockRelation(onerel,AccessExclusiveLock); |
| 807 | + |
805 | 808 | /*
|
806 | 809 | * Drop free-space info for removed blocks; these must not get entered
|
807 | 810 | * into the FSM!
|
@@ -834,10 +837,6 @@ lazy_truncate_heap(Relation onerel, LVRelStats *vacrelstats)
|
834 | 837 | vacrelstats->rel_pages=new_rel_pages;
|
835 | 838 | vacrelstats->pages_removed=old_rel_pages-new_rel_pages;
|
836 | 839 |
|
837 |
| -/* |
838 |
| - * We keep the exclusive lock until commit (perhaps not necessary)? |
839 |
| - */ |
840 |
| - |
841 | 840 | ereport(elevel,
|
842 | 841 | (errmsg("\"%s\": truncated %u to %u pages",
|
843 | 842 | RelationGetRelationName(onerel),
|
|