2011/10/20 Robert Haas <robertmhaas@gmail.com>:
> On Thu, Oct 20, 2011 at 10:49 AM, Kohei KaiGai <kaigai@kaigai.gr.jp> wrote:
>>>> part-3: drop statement reworks for other object classes
>>>
>>> This is going to need some rebasing.
>>>
>> OK, I rebased it.
>>
>> This patch includes bug-fix when we tried to drop non-existence
>> operator family with IF EXISTS.
>
> I'm thinking we should probably pull that part out and do it
> separately. Seems like it should probably be back-patched.
>
I checked REL9_0_STABLE branch:
It seems to me v9.0 implementation is correct. It might be enbugged
when OpFamilyCacheLookup() get missing_ok argument. :-(
/** RemoveOpFamily* Deletes an opfamily.*/
void
RemoveOpFamily(RemoveOpFamilyStmt *stmt)
{ Oid amID, opfID; HeapTuple tuple; ObjectAddress object;
/* * Get the access method's OID. */ amID = GetSysCacheOid1(AMNAME, CStringGetDatum(stmt->amname)); if
(!OidIsValid(amID)) ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("access
method\"%s\" does not exist", stmt->amname)));
/* * Look up the opfamily. */ tuple = OpFamilyCacheLookup(amID, stmt->opfamilyname); if
(!HeapTupleIsValid(tuple)) { if (!stmt->missing_ok) ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT), errmsg("operator family \"%s\" does not exist for
access method \"%s\"", NameListToString(stmt->opfamilyname), stmt->amname))); else
ereport(NOTICE, (errmsg("operator family \"%s\" does not exist for
access method \"%s\"", NameListToString(stmt->opfamilyname), stmt->amname))); return; }
--
KaiGai Kohei <kaigai@kaigai.gr.jp>