Re: patch: Allow \dd to show constraint comments - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: patch: Allow \dd to show constraint comments
Date
Msg-id 1307379529-sup-2724@alvh.no-ip.org
Whole thread Raw
In response to Re: patch: Allow \dd to show constraint comments  (Josh Kupershmidt <schmiddy@gmail.com>)
Responses Re: patch: Allow \dd to show constraint comments
List pgsql-hackers
Excerpts from Josh Kupershmidt's message of dom jun 05 16:36:57 -0400 2011:
> On Tue, May 24, 2011 at 10:31 PM, Josh Kupershmidt <schmiddy@gmail.com> wrote:
> > Attached is a rebased patch. From a quick look, it seems that most of
> > the object types missing from \dd are already covered by pg_comments
> > (cast, constraint, conversion, domain, language, operator class,
> > operator family). A few objects would probably still need to be added
> > (foreign data wrapper, server).
> 
> Here's another update to this patch. Includes:
>  * rudimentary doc page for pg_comments
>  * 'foreign data wrapper' and 'server' comment types now included in
> pg_comments; regression test updated

Hmm, if we're going to have pg_comments as a syntactic sugar kind of
thing, it should output things in format immediately useful to the user,
i.e. relation/column/etc names and not OIDs.  The OIDs would force you
to do lots of joins just to make it readable.  Maybe you should have a
column for the class of object the comment applies to, but as a name and
not a regclass.  And then a column for names that each comment applies
to.  (We're still struggling to get a useful pg_locks display).  I mean,
if OIDs are good for you and you're OK with doing a few joins, why not
go to the underlying catalogs in the first place?

(IMHO anyway -- what do others think?)

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: heap vacuum & cleanup locks
Next
From: Alvaro Herrera
Date:
Subject: Re: Postmaster holding unlinked files for pg_largeobject table