File tree 1 file changed +13
-3
lines changed
src/backend/storage/large_object
1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 9
9
*
10
10
*
11
11
* IDENTIFICATION
12
- * $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.65 2000/01/26 05:56:59 momjian Exp $
12
+ * $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.66 2000/04/08 04:37:07 tgl Exp $
13
13
*
14
14
*-------------------------------------------------------------------------
15
15
*/
@@ -278,10 +278,20 @@ inv_drop(Oid lobjId)
278
278
{
279
279
Relation r ;
280
280
281
- r = ( Relation ) RelationIdGetRelation (lobjId );
282
- if (!RelationIsValid (r ) || r -> rd_rel -> relkind != RELKIND_LOBJECT )
281
+ r = RelationIdGetRelation (lobjId );
282
+ if (!RelationIsValid (r ))
283
283
return -1 ;
284
284
285
+ if (r -> rd_rel -> relkind != RELKIND_LOBJECT )
286
+ {
287
+ /* drop relcache refcount from RelationIdGetRelation */
288
+ RelationDecrementReferenceCount (r );
289
+ return -1 ;
290
+ }
291
+
292
+ /* Since heap_drop_with_catalog will destroy the relcache entry,
293
+ * there's no need to drop the refcount in this path.
294
+ */
285
295
heap_drop_with_catalog (RelationGetRelationName (r ));
286
296
return 1 ;
287
297
}
You can’t perform that action at this time.
0 commit comments