Re: describe objects, as in pg_depend

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

Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> writes:
> A customer of ours (Enova Financial) requested the ability to describe
> objects in pg_depend. The wiki contains a simplistic SQL snippet that
> does the task, but only for some of the object types, and it's rather
> ugly. It struck me that we could fulfill this very easily by exposing
> the getObjectDescription() function at the SQL level, as in the attached
> module.

What's the point of the InvalidOid check? It seems like you're mostly
just introducing a corner case: sometimes, but not always, the function
will return NULL instead of failing for bad input. I think it should
just fail always.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-11-17 15:25:51 Re: changing MyDatabaseId
Previous Message Tom Lane 2010-11-17 15:11:51 Re: unlogged tables