Checking for undefined in Perl interface code?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Checking for undefined in Perl interface code?
Date: 2002-01-23 23:16:12
Message-ID: 9276.1011827772@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

PL/Perl tries to handle an "undef" result from a Perl function (which
should convert to a SQL NULL) with code like so:

/* XXX is this the approved way to check for an undef result? */
if (perlret == &PL_sv_undef)
{
retval = (Datum) 0;
fcinfo->isnull = true;
}
else
{
// handle non-null result
}

But I find that it doesn't work, at least not on RH Linux 7.2 with
perl 5.6.0. The if-test fails to notice undef results.

Anyone know what the correct way to do this is?

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mikheev, Vadim 2002-01-23 23:22:42 Re: Savepoints
Previous Message Bill Studenmund 2002-01-23 22:55:29 Re: RFD: schemas and different kinds of Postgres objects