Re: BUG #3264: SPI: int64's sometimes returned by value sometimes by reference

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #3264: SPI: int64's sometimes returned by value sometimes by reference
Дата
Msg-id 6762.1178771838@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #3264: SPI: int64's sometimes returned by value sometimes by reference  ("Adam Kunen" <adam.kunen@gmail.com>)
Ответы Re: BUG #3264: SPI: int64's sometimes returned by value sometimes by reference  ("Adam Kunen" <adam.kunen@gmail.com>)
Список pgsql-bugs
"Adam Kunen" <adam.kunen@gmail.com> writes:
> I have noticed some discrepencies with 64-bit values in tuples.
> For a given row with multiple int8's I have noticed sometimes the value will
> be passed by value and sometime by reference.

No, int8 datums are always passed by reference.  If you have a
counterexample then let's see it.

Whether they *could* be passed by value on some platforms is a
different issue.  One of the reasons for having macros like
DatumGetInt64 is to make such a thing transparent to source code
when/if we get around to doing it.  IMHO, if your code assumes
either convention explicitly then it's broken.

A possible reading of your report is that you've failed to distinguish
int4 and int8 datums in places ... but with so few details, it's
impossible to be sure of that diagnosis.

            regards, tom lane

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

Предыдущее
От: "Adam Kunen"
Дата:
Сообщение: BUG #3264: SPI: int64's sometimes returned by value sometimes by reference
Следующее
От: "Russell Smith"
Дата:
Сообщение: BUG #3265: 8.1 -> 8.2 behviour change: View owner must have access to underlying tables