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

From Josh Kupershmidt
Subject Re: patch: Allow \dd to show constraint comments
Date
Msg-id BANLkTi=p5TLB2qNTaKkyAU+hL0zoWPrKQg@mail.gmail.com
Whole thread Raw
In response to Re: patch: Allow \dd to show constraint comments  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: patch: Allow \dd to show constraint comments  (Josh Kupershmidt <schmiddy@gmail.com>)
List pgsql-hackers
On Mon, May 23, 2011 at 10:56 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Mon, May 23, 2011 at 10:13 PM, Josh Kupershmidt <schmiddy@gmail.com> wrote:
>> Well actually, I got into messing with this solely from the Todo list.
>> Which, of course, neglected to mention the thread about pg_comments,
>> or the other objects missing from \dd.
>
> Heh.  Sounds like updating the Todo list would be a good place to start.

Yeah, fixed that, at least.

[snip]
>> Your pg_comments.patch doesn't apply to git head anymore -- would you
>> be interested in resurrecting this code for 9.2, assuming we can get
>> support for this idea?
>
> Yeah, I don't think it would be too hard to rebase; or you or someone
> else might even want to pick it up.   :-)

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).

I'm not sure how much time I'll have in the next CF, so I'd rather not
take up this patch. But I should be able to at least review.

Besides the few concerns and missing bits noted by Robert in the
original thread[1], one concern I have is how easy it will be for
users to directly query pg_comments for common types of queries, e.g.
looking for comments attached to non-system functions, given the few
thousand rows in that view. I wonder whether it'd be worthwhile to
have two views: pg_user_comments and pg_all_comments, similar to how
we have pg_stat_user_tables and pg_stat_all_tables. We could just say
that folks should just use \dd for looking at non-system objects, but
a significant reason for this whole exercise is that \dd isn't cutting
it.

Josh

--
[1] http://archives.postgresql.org/pgsql-hackers/2010-09/msg01080.php

Attachment

pgsql-hackers by date:

Previous
From: Jaime Casanova
Date:
Subject: Re: adding a new column in IDENTIFY_SYSTEM
Next
From: Jeff Davis
Date:
Subject: Re: tackling full page writes