preferred way to use PG_GETARG_BYTEA_P in SPI

From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: "Postgres General" <pgsql-general(at)postgresql(dot)org>
Subject: preferred way to use PG_GETARG_BYTEA_P in SPI
Date: 2007-10-10 18:49:16
Message-ID: b42b73150710101149q1872226ape6f52fba4f1ced09@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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 unintuitive to have PG_GETARG_BYTEA_P crash on null
input...why not just assign null and skip the de-toast call in the
macro?

merlin

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-10-10 18:58:00 Re: <> ALL( ... ) and <> ANY ( ... ) didn't behave as expected
Previous Message Erik Jones 2007-10-10 18:29:44 Re: <> ALL( ... ) and <> ANY ( ... ) didn't behave as expected