Skip site navigation (1) Skip section navigation (2)

Re: get_whatever_oid, part 1: object types with unqualifed names

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: get_whatever_oid, part 1: object types with unqualifed names
Date: 2010-06-28 14:53:24
Message-ID: 27483.1277736804@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> 2010/6/28 KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>:
>> * at the RenameSchema()

> This looks like another syscache reference leak.

Actually that one *is* a leak, although it doesn't matter much because
the leak occurs only in an error path, so transaction abort will clean
up the leaked reference.  Still, it's sucky coding style:
SearchSysCacheExists should have been used.

I'm not sure I agree that replacing SearchSysCacheExists calls (or
things that should have been SearchSysCacheExists calls) with
OidIsValid(get_whatever_oid()) is an improvement.  The Exists call
tells what you're actually trying to accomplish.  The other way is
an overspecification of the required result.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Mike BerrowDate: 2010-06-28 15:03:17
Subject: Issue: Deprecation of the XML2 module 'xml_is_well_formed' function
Previous:From: Tom LaneDate: 2010-06-28 14:48:05
Subject: Re: get_whatever_oid, part 1: object types with unqualifed names

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group