Re: psql: bogus descriptions displayed by \d+

From: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql: bogus descriptions displayed by \d+
Date: 2011-07-26 02:29:29
Message-ID: CAK3UJRHn-3HP0DKcfxueeMA6oJX8q=F9QEAd9D-+MQ+WUvx5oQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jul 22, 2011 at 12:44 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Thu, Jul 21, 2011 at 9:17 PM, Josh Kupershmidt <schmiddy(at)gmail(dot)com> wrote:
>> Here's a small patch against branch 8.4 to mention support for COMMENT
>> ON index_name.column_name.
>
> I am not in favor of this - because we'd also need to mention every
> other relkind that can support comments.  I think if we want to do
> something here we should change it to say relation_name, and then
> clarify what that means further down.  Similarly with the patch for
> master.
>
> Also, if we're going to make a change here, we probably should make
> sure it matches the actual behavior.  In master, that's to allow
> comments on columns of tables, views, composite types, and foreign
> tables.

That seems like a good way to document this; patch for master updated.
I avoided mucking with the documentation for COMMENT ON RULE and
COMMENT ON TRIGGER this time; they both say "table" when they really
mean "table or view", but maybe trying to differentiate between
"table", "table_or_view", and "relation" will make things overly
complicated.

>> Also, a patch against master to:
>>  * get rid of the bogus "Description" outputs for \d+ sequence_name
>> and \d+ index_name
>
> This part looks OK, but instead of doing a negative test (not-index,
> not-sequence) let's have it do a positive test, for the same types
> comment.c allows.

Right, fixed.

>> And while I'm messing with this, some further nitpicks about psql not
>> addressed by these patches:
>>  * The "Storage" column for \d+ sequence_name is correct, I suppose,
>> but repetitive
>
> I'm OK with removing that.

Hrm, would it be better to keep that Storage bit around in some
non-repetitive form, maybe on its own line below the table output?

>>  * The "Type" column for \dv+ view_name, \di+ index_name, \ds+
>> sequence_name , etc. seems borderline useless.. shouldn't you know
>> what type you're looking at based on the backslash command you're
>> using?
>
> Not really.  You can do something like this, for example:
>
> \dti+
>
> ...to show both indexes and tables.

I see. Didn't know about that trick.

Josh

Attachment Content-Type Size
bogus_descriptions.v2.patch text/x-patch 6.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jerry Sievers 2011-07-26 02:31:03 Check constraints on partition parents only?
Previous Message Greg Smith 2011-07-26 02:14:21 Re: write scalability