Re: PL/Python

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: tjenkins(at)devis(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: PL/Python
Date: 2003-01-21 18:48:50
Message-ID: 7899.1043174930@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Jenkins <tjenkins(at)devis(dot)com> writes:
> please pardon me if this is really obvious, but i can't seem to find a null
> flag in the structures i have in that function. I don't get how to set the
> null flag for the datum slot. I'm still learning how to work with the
> backend code.

It looks like whoever wrote the plpython code was still learning, too.
Parts of it handle NULLs correctly, but PLy_spi_execute_plan doesn't
seem to cope at all. It looks like you ought to add a nulls flag array
to PLyPlanObject, fill it during PLy_spi_execute_plan, and pass it to
SPI_execp. IIRC it's a char array, containing 'n' for a null arg and
' ' for not-null, but check SPI_execp to be sure.

Also, the code that explicitly pfree's the typfunc's results here is a
waste of space, if not actively dangerous...

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Medi Montaseri 2003-01-21 18:49:51 Re: postmaster.pid
Previous Message will trillich 2003-01-21 18:28:59 Re: loading delimited files