prepared queries in plperl

From: Dmitry Karasik <dmitry(at)karasik(dot)eu(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: prepared queries in plperl
Date: 2005-09-27 10:25:02
Message-ID: 84br2evmdd.fsf@tetsuo.karasik.eu.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello,

I've posted before a patch that enables prepared queries in plperl, and
now, after a while, as it seems working as expected, I'd like to ask if it
would be a reasonable thing to commit in into -devel? The patch against
the latest cvs is at http://www.karasik.eu.org/misc/plperl.diff .

The idea behind the patch is to make it possible to pass non-interpolated
parameters to the query:

CREATE OR REPLACE FUNCTION plus_one(INTEGER) RETURNS INTEGER AS $$
my $x = spi_prepare('SELECT $1 AS datum', 'INT4');
my $rv = spi_exec_prepared($x, $q + 1);
spi_freeplan( $x);
return $rv->{rows}[0]->{datum};
$$ LANGUAGE plperl;

--
Thanks,
Dmitry Karasik

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Abhijit Menon-Sen 2005-09-27 10:27:01 Re: PostgreSQL overall design
Previous Message Andrey Repko 2005-09-27 10:15:53 Strange, very strange