Re: [bug] relcache leaks in get_object_address

From: Kohei KaiGai <kaigai(at)kaigai(dot)gr(dot)jp>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: PgHacker <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [bug] relcache leaks in get_object_address
Date: 2011-10-13 16:27:12
Message-ID: CADyhKSUy4RPFumXp=-YOxm+nTejef7VPHaWtvSMsCovuh3=iiQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The attached patch fixes this problem.
Unfortunately, we have no code that invokes get_object_address()
with missing_ok = true now, so please apply a couple of patches
to rework DROP statement of mine.

DROP TRIGGER no_such_trigger ON existing_table;

shall cause a relcache reference leaks, without this patch.

Thanks,

2011/10/13 Kohei KaiGai <kaigai(at)kaigai(dot)gr(dot)jp>:
> I noticed a problem of get_object_address() with missing_ok = true.
>
> When we try to solve the name of nonexistent rule/trigger/constraint on
> a particular existing table, get_object_address_relobject() opens the
> relation, but address.objectId = InvalidOid shall be set.
>
> I think it should be closed if the queried object was missing, although
> existing code does not invoke get_object_address() with missing_ok = true.
>
> Thanks,
> --
> KaiGai Kohei <kaigai(at)kaigai(dot)gr(dot)jp>
>

--
KaiGai Kohei <kaigai(at)kaigai(dot)gr(dot)jp>

Attachment Content-Type Size
pgsql-v9.2-fix-relcache-leaks-in-get_object_address_relobject.patch application/octet-stream 953 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kohei KaiGai 2011-10-13 16:46:16 Re: [v9.2] DROP statement reworks
Previous Message Greg Sabino Mullane 2011-10-13 16:21:58 Re: Overhead cost of Serializable Snapshot Isolation