Re: C function migration from 9.2 to 9.5

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: C function migration from 9.2 to 9.5
Дата
Msg-id 6590.1457052756@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: C function migration from 9.2 to 9.5  (Michael Omotayo Akinde <michaeloa@met.no>)
Ответы Re: C function migration from 9.2 to 9.5  (Michael Omotayo Akinde <michaeloa@met.no>)
Список pgsql-general
Michael Omotayo Akinde <michaeloa@met.no> writes:
> This throws a compiler warning on the cast from heap_form_tuple to
> HeapTuple, but IIRC it's always done that so not an error?

Uh, that's *awfully* fishy, because heap_form_tuple certainly returns
HeapTuple.  I wondered why you had that cast there; it should not be
necessary.  If the compiler is warning about it, that sets off all kinds
of alarm bells.

I notice your test program fails to #include "access/htup_details.h",
which is where heap_form_tuple() is declared these days.  I wonder if
your problem boils down to "no visible declaration of function, so
compiler thinks it returns int"?  In that case the real difference
from what worked to what didn't probably had less to do with any PG
version change and more to do with moving from 32-bit to 64-bit.
(Or I guess we might've relocated the declaration of heap_form_tuple
somewhere along the line.)

A general tip for getting C code to work is to turn on as many
compiler warnings as you can, and never ignore any of them.

            regards, tom lane


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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: BDR concern/issue
Следующее
От: "Premsun Choltanwanich"
Дата:
Сообщение: Re: could not migrate 8.0.13 database with large object data to 9.5.1