Re: bloated heapam.h

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: bloated heapam.h
Date: 2008-05-11 04:30:23
Message-ID: 20080511043023.GB9136@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

> +1 for moving fastgetattr, heap_getattr, and the heaptuple.c functions
> to htup.h. I don't see any big gain from relocating the other stuff;
> it seems to largely all use about the same set of typedefs.

Ultimately that was my conclusion too. I tried moving the heaptuple.c
functions to htup.h, but hit the problem that pg_dump.c wants to include
that file. It then fails to compile because it doesn't know Datum
(defined in postgres.h, so unavailable to frontend programs). I worked
around that by enclosing the prototypes in #ifndef FRONTEND, but that
seems ugly.

Apparently the reason for pg_dump.c to need htup.h is getAttrName which
needs system columns' attribute numbers. Of course, the first thing
that comes to mind is that we should fix pg_dump to not require that
header in the first place. Perhaps we can get the names by querying the
server, at the same time we get the user column names. (Apparently this
is only used to dump unique indexes on system columns.)

The easiest actual solution, however, seems to be to move those
attribute numbers to a separate header, say access/sysattrs.h.

--
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-05-11 04:49:59 Re: bloated heapam.h
Previous Message Euler Taveira de Oliveira 2008-05-11 04:24:46 Re: ecpg localization