Re: printTable API (was: Show INHERIT in \du)

From: "Brendan Jurd" <direvus(at)gmail(dot)com>
To: "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: printTable API (was: Show INHERIT in \du)
Date: 2008-04-15 08:11:32
Message-ID: 37ed240d0804150111l14f623bx6fd594dd516bf4a4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, Apr 14, 2008 at 6:03 AM, Alvaro Herrera wrote:
> Looks cool -- on a first read, I think you should add some more code
> comments at the top of each function specifying whether the texts need
> to be translated by the caller or done by the function itself. Also it
> would be good if it is consistent, too :-)
>

Thanks for your feedback Alvaro. Taking a look at this with fresh
eyes, I realised it was daft to pass the encoding to each AddHeader
and AddCell call, since the encoding isn't going to change between
cells.

Instead I put a pointer to a printTableOpt inside the
printTableContent. The Opt struct contains the encoding and the Add
functions refer to the encoding internally when adding items. This
also has the benefit that you don't need to pass a printTableOpt
separately to the functions that actually do the printing.

Per your suggestion, I fleshed out the comments on translation, in
particular explaining why AddHeader and AddCell have an option for
translation but AddFooter does not.

The second version of the patch is attached.

Now my question is, how do I indicate that a second version of the
patch has been submitted on the wiki? Should I leave the primary link
pointing at the original submission, or update it to point at this
message?

Cheers,
BJ
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)
Comment: http://getfiregpg.org

iD8DBQFIBGMz5YBsbHkuyV0RArf1AJwOsz2Wq5g7vg6DvyOzD7Ixsgl8EgCg4HyZ
sxtmc2A5FYiwYkkrhfpDsDM=
=jvKI
-----END PGP SIGNATURE-----

Attachment Content-Type Size
print-table_1.diff.bz2 application/x-bzip2 14.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Brendan Jurd 2008-04-15 08:24:48 Re: [HACKERS] Show INHERIT in \du
Previous Message Florian Weimer 2008-04-15 07:58:41 Re: Cached Query Plans

Browse pgsql-patches by date

  From Date Subject
Next Message Brendan Jurd 2008-04-15 08:24:48 Re: [HACKERS] Show INHERIT in \du
Previous Message Magnus Hagander 2008-04-15 08:09:44 Re: libpq Win32 Mutex performance patch