Re: [HACKERS] Show INHERIT in \du

From: "Brendan Jurd" <direvus(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Bernd Helmle" <mailings(at)oopsware(dot)de>, "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, pgsql-hackers(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org
Subject: Re: [HACKERS] Show INHERIT in \du
Date: 2008-04-13 08:11:46
Message-ID: 37ed240d0804130111k5ec1a6e0p289b758e5d21657e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Tue, Mar 25, 2008 at 2:41 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "Brendan Jurd" <direvus(at)gmail(dot)com> writes:
> > This makes me wonder whether print.c could offer something a bit more
> > helpful to callers wishing to DIY a table; we could have a
> > table-building struct with methods like addHeader and addCell.
>
> > What do you think? Overkill, or worthy pursuit?
>
> Once you have two occurrences of a pattern, it's reasonable to assume
> there will be more later. +1 for building a little bit of infrastructure.
>

I've written a patch which implements the same \du behaviour as my
previous patch, but using the new printTable API I submitted in [1].

If the printTable API patch is rejected or substantially changed, we
will need to revisit this patch.

The new patch constructs a table manually, in the same manner as
describeOneTableDetails, so that we get the same outputs as the
original patch but without any of the localisation issues identified
by Tom and Alvaro.

I have attached a patch against my printTable code, containing only
the changes I made to describeRoles() (du-attributes_1.diff.bz2), and
a combined patch against HEAD containing the full printTable API
changes as well as the changes to describeRoles()
(du-attributes-print-table_1.diff.bz2).

No memory problems detected by valgrind, and all regression tests
passed on x86_64 gentoo.

I've added this item to the May CommitFest wiki page.

Cheers,
BJ

[1[ http://archives.postgresql.org/message-id/37ed240d0804120112w60c80089obd3a8c8ac72505f8@mail.gmail.com

Attachment Content-Type Size
du-attributes_1.diff.bz2 application/x-bzip2 1.8 KB
du-attributes-print-table_1.diff.bz2 application/x-bzip2 14.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message James Mansion 2008-04-13 08:23:01 Re: Cached Query Plans
Previous Message Marc Cousin 2008-04-13 08:02:13 Re: Cached Query Plans (was: global prepared statements)

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Chernow 2008-04-13 15:50:47 Re: libpq patch for pqtypes hook api and PGresult creation
Previous Message Tom Lane 2008-04-13 05:01:19 Re: [PATCH] sh: Add support Renesas SuperH