Datum should be defined outside postgres.h

Поиск
Список
Период
Сортировка
От Zdenek Kotala
Тема Datum should be defined outside postgres.h
Дата
Msg-id 47209F67.5080106@sun.com
обсуждение исходный текст
Ответы Re: Datum should be defined outside postgres.h  (Peter Eisentraut <peter_e@gmx.net>)
Re: Datum should be defined outside postgres.h  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
I'm trying to solve one TODO item mentioned in 
src/backend/utils/mmgr/mcxt.c.

----
/* * MemoryContextSwitchTo *              Returns the current context; installs the given context. * * This is inlined
whenusing GCC. * * TODO: investigate supporting inlining for some non-GCC compilers. */
 
----

Everything works fine with Sun Studio instead of zic and ecpg 
compilation. The problem there is that palloc.h defines 
CurrentMemoryContext which is declared in mcxt.c. And palloc.h is 
included by postgres.h.

Unfortunately zic and ecpg break the rule which is mentioned on many 
places and they include postgres.h. Linker is looking for 
CurrentMemoryContext because inlined function requires it. This problem 
disappears when -xO3 is enabled and SS optimizes a code. But it cannot 
be use in general.

I fixed it for zic, but problem with ecpg is that it includes 
nodes/primnodes.h and it requires Datum type definition which is defined 
in postgres.h. :(

By my opinion Datum should be defined in separate file and all headers 
which use this type should include it. (this is problem on many places 
with another types). Another question is why ecpg needs it?

    Any comments how to fix ecpg?
        Zdenek


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: text search and "filenames"
Следующее
От: Alvaro Herrera
Дата:
Сообщение: text search parser, "uri"