Re: describe objects, as in pg_depend - Mailing list pgsql-hackers

From Tom Lane
Subject Re: describe objects, as in pg_depend
Date
Msg-id 27135.1290008861@sss.pgh.pa.us
Whole thread Raw
In response to Re: describe objects, as in pg_depend  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: describe objects, as in pg_depend
List pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Excerpts from Tom Lane's message of mié nov 17 12:20:06 -0300 2010:
>> What's the point of the InvalidOid check?

> If the check is not there, the calling query will have to prevent the
> function from being called on rows having OID=0 in pg_depend.  (These
> rows show up in the catalog for pinned objects).

Hmm.  It would be good to document that motivation somewhere.  Also,
for my own taste it would be better to do
/* for "pinned" items in pg_depend, return null */if (!OidIsValid(catalogId))    PG_RETURN_NULL();
... straight line code here ...

rather than leave the reader wondering whether there are any other cases
where the function is intended to return null.

Oh, one other gripe: probably better to name it pg_describe_object.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: Indent authentication overloading
Next
From: Markus Wanner
Date:
Subject: Re: changing MyDatabaseId