From 448eb0837f7a8db270481475e8803e1e8a19a37e Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 28 Aug 2004 21:05:26 +0000 Subject: Rearrange order of operations in heap_drop_with_catalog and index_drop so that we close and flush the doomed relation's relcache entry before we start to delete the underlying catalog rows, rather than afterwards. For awhile yesterday I thought that an unexpected relcache entry rebuild partway through this sequence might explain the infrequent parallel regression failures we were chasing. It doesn't, mainly because there's no CommandCounterIncrement in the sequence and so the deletions aren't "really" done yet. But it sure seems like trouble waiting to happen. --- src/backend/commands/tablecmds.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/backend/commands/tablecmds.c') diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index a7eac55f252..6a7a8a3017e 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.126 2004/08/15 23:44:46 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.127 2004/08/28 21:05:26 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -4924,7 +4924,7 @@ ATExecAlterColumnType(AlteredTableInfo *tab, Relation rel, add_column_datatype_dependency(RelationGetRelid(rel), attnum, targettype); /* Drop any pg_statistic entry for the column, since it's now wrong type */ - RemoveStatistics(rel, attnum); + RemoveStatistics(RelationGetRelid(rel), attnum); /* * Update the default, if present, by brute force --- remove and re-add -- cgit v1.2.3