Re: psql: display of object comments

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql: display of object comments
Date: 2011-07-25 16:27:48
Message-ID: CA+TgmoZSiTu7v7NKJKo5Z2kzOcaNuYi56X4pAzd-AoVqeR2Dmw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jul 22, 2011 at 10:44 PM, Josh Kupershmidt <schmiddy(at)gmail(dot)com> wrote:
> On Sat, Jul 9, 2011 at 1:16 PM, Josh Kupershmidt <schmiddy(at)gmail(dot)com> wrote:
>
> Attached is an updated version of this patch, lifted out of the recent
> pg_comments patch. With this v2 patch, \dd should properly show just
> its five object types, and the psql documentation and help strings
> should be fixed.

I took a look at this patch today and I think some of these queries
are not quite right. When you do a left join against pg_description,
you have this sort of thing in the WHERE clause:

(d.objsubid IS NULL OR d.objsubid = 0)

I think what you actually want is "AND d.objsubid = 0" in the LEFT
JOIN's "ON" clause. Then you are, in effect, only left joining
against the rows from pg_description where objsubid = 0, and
null-extending if none such is found. I think that's what you want.

I think you can remove the XXX comments, too. Unless I'm
misunderstanding something, using the table to test visibility for
constraints, rules, and triggers seems just right, and opclasses and
opfamilies you have a suitable function available, so those don't seem
problematic. Or am I confused?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bernd Helmle 2011-07-25 16:53:13 Re: Another issue with invalid XML values
Previous Message Kevin Grittner 2011-07-25 16:26:54 Re: WIP fix proposal for bug #6123