Re: printTable API (was: Show INHERIT in \du) - Mailing list pgsql-patches

From Alvaro Herrera
Subject Re: printTable API (was: Show INHERIT in \du)
Date
Msg-id 20080416235356.GG17229@alvh.no-ip.org
Whole thread Raw
In response to Re: printTable API (was: Show INHERIT in \du)  ("Brendan Jurd" <direvus@gmail.com>)
Responses Re: printTable API (was: Show INHERIT in \du)
List pgsql-patches
Brendan Jurd escribió:

> On Thu, Apr 17, 2008 at 7:27 AM, Alvaro Herrera  wrote:

> >  One thing I'm not entirely happy about is the fact that we need a
> >  pointer to the last footer/cell/header, so two pointers for each
> >  element kind.
>
> Well, the alternative is iterating through the array each time you
> want to add something until you hit a NULL pointer, and adding the new
> item at that point.  Considering we're only chewing up an extra 4 *
> sizeof(pointer) = 16 bytes in the struct, it seems like a reasonable
> price to pay for the convenience.

Well, consider that there are going to be 1 or 2 entries in the arrays
in most cases anyway :-)  Well, as far as footers go anyway ... I just
realized that in all other cases it will certainly be the wrong thing to
do :-)  Still, perhaps a integer count is better?

> What is it about the extra fields that makes you unhappy?

I don't know if "unnecessarity" is a word, but I hope you get what I
mean :-)

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

pgsql-patches by date:

Previous
From: "Brendan Jurd"
Date:
Subject: Re: printTable API (was: Show INHERIT in \du)
Next
From: Bruce Momjian
Date:
Subject: Re: Proposed patch - psql wraps at window width