"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);
>       ArrayType  *qa = (ArrayType *)
> DatumGetPointer(PG_DETOAST_DATUM_COPY(PG_GETARG_DATUM(1)));
>       if (acc == NULL || PG_ARGISNULL(0))
>       {

That might be safe but it sure looks like bad practice to me.
In particular I think it's unwise to assume that the Datum value
for a null will always be zero.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply via email to