Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-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

pgsql-hackers by date

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

pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group