Re: describe objects, as in pg_depend

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: describe objects, as in pg_depend
Date: 2010-11-17 15:47:41
Message-ID: 27135.1290008861@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)commandprompt(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Markus Wanner 2010-11-17 15:58:01 Re: changing MyDatabaseId
Previous Message Magnus Hagander 2010-11-17 15:43:00 Re: Indent authentication overloading