Re: patch: Allow \dd to show constraint comments

From: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: patch: Allow \dd to show constraint comments
Date: 2011-05-25 02:31:50
Message-ID: BANLkTi=p5TLB2qNTaKkyAU+hL0zoWPrKQg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, May 23, 2011 at 10:56 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Mon, May 23, 2011 at 10:13 PM, Josh Kupershmidt <schmiddy(at)gmail(dot)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 Content-Type Size
pg_comments.v2.patch text/x-patch 60.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-05-25 02:47:49 Re: pg_class reltuples/relpages not updated by autovacuum/vacuum
Previous Message Jaime Casanova 2011-05-25 02:31:04 Re: adding a new column in IDENTIFY_SYSTEM