Re: bloated heapam.h

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: bloated heapam.h
Дата
Msg-id 20080511043023.GB9136@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: bloated heapam.h  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: bloated heapam.h  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Euler Taveira de Oliveira
Дата:
Сообщение: Re: ecpg localization
Следующее
От: Tom Lane
Дата:
Сообщение: Re: bloated heapam.h