Re: preferred way to use PG_GETARG_BYTEA_P in SPI

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: preferred way to use PG_GETARG_BYTEA_P in SPI
Дата
Msg-id 25355.1192054612@sss.pgh.pa.us
обсуждение исходный текст
Ответ на preferred way to use PG_GETARG_BYTEA_P in SPI  ("Merlin Moncure" <mmoncure@gmail.com>)
Ответы Re: preferred way to use PG_GETARG_BYTEA_P in SPI  ("Merlin Moncure" <mmoncure@gmail.com>)
Список pgsql-general
"Merlin Moncure" <mmoncure@gmail.com> writes:
> I'm curious what's considered the best way to invoke PG_GETARG_BYTEA_P
> in an SPI routine and properly check for null input in non 'strict'
> routines.  Right now, I'm looking at PG_GETARG_POINTER to check for
> null value before using PG_GETARG_BYTEA_P to assign to the bytea
> pointer.

That would be entirely wrong.  In a non-strict function, test
PG_ARGISNULL(n) before attempting any variant of PG_GETARG(n).
Grepping for PG_ARGISNULL will yield lots of examples.

            regards, tom lane

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

Предыдущее
От: Ralph Smith
Дата:
Сообщение: Default Ubuntu post-install Qs (PG v7.4)
Следующее
От: Randall Lucas
Дата:
Сообщение: Coercing compound types to use generic ROW comparison operators