Re: [PATCHES] Show INHERIT in \du - Mailing list pgsql-hackers

From Brendan Jurd
Subject Re: [PATCHES] Show INHERIT in \du
Date
Msg-id 37ed240d0803240930y6fcad470i784ec8f3bc05f968@mail.gmail.com
Whole thread Raw
In response to Re: [PATCHES] Show INHERIT in \du  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [PATCHES] Show INHERIT in \du
List pgsql-hackers
On 21/03/2008, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> "Brendan Jurd" <direvus@gmail.com> writes:
> > We can't just build the output table by hand like
>  > describeOneTableDetails does?  Admittedly it's kludgy, but it's not an
>  > unprecedented kludge.
>
>
> Oh, I had forgotten the existence of that entry point in print.c.  Yeah,
>  it might be workable --- want to have a go at it?
>

I've had a chance to look at this now, and although it certainly does
seem workable, there's a lot of duplication of code that I feel uneasy
about.  describeOneTableDetails essentially already duplicates the
table buildling code in printQuery, so I would be creating a third
copy of the same logic.

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?

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Bug in libpq causes local clients to hang
Next
From: "Jeffrey Baker"
Date:
Subject: Re: Bug in libpq causes local clients to hang