Re: [GENERAL] preferred way to use PG_GETARG_BYTEA_P in SPI

2007-10-11 Thread Tom Lane
"Merlin Moncure" <[EMAIL PROTECTED]> writes: > well, there aren't all that many examples in contrib, and some of the > ones that are there look like this (edited) from tsearch2: > Datum > rewrite_accum(PG_FUNCTION_ARGS) > { > QUERYTYPE *acc = (QUERYTYPE *) PG_GETARG_POINTER(0); > Arra

Re: [GENERAL] preferred way to use PG_GETARG_BYTEA_P in SPI

2007-10-11 Thread Merlin Moncure
On 10/10/07, Tom Lane <[EMAIL PROTECTED]> wrote: > "Merlin Moncure" <[EMAIL PROTECTED]> 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_POINT

Re: [GENERAL] preferred way to use PG_GETARG_BYTEA_P in SPI

2007-10-10 Thread Tom Lane
"Merlin Moncure" <[EMAIL PROTECTED]> 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

[GENERAL] preferred way to use PG_GETARG_BYTEA_P in SPI

2007-10-10 Thread Merlin Moncure
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. ISTM a little but