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

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Brendan Jurd <direvus(at)gmail(dot)com>
Cc: 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-16 23:53:56
Message-ID: 20080416235356.GG17229@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-04-16 23:59:40 pgsql: Repair two places where SIGTERM exit could leave shared memory
Previous Message Brendan Jurd 2008-04-16 23:37:33 Re: printTable API (was: Show INHERIT in \du)

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2008-04-17 02:49:00 Re: Proposed patch - psql wraps at window width
Previous Message Brendan Jurd 2008-04-16 23:37:33 Re: printTable API (was: Show INHERIT in \du)