Skip site navigation (1) Skip section navigation (2)

Re: prepared queries in plperl

From: "Andrew Dunstan" <andrew(at)dunslane(dot)net>
To: <dmitry(at)karasik(dot)eu(dot)org>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: prepared queries in plperl
Date: 2005-09-27 11:20:59
Message-ID: 1786.24.211.165.134.1127820059.squirrel@www.dunslane.net (view raw or flat)
Thread:
Lists: pgsql-hackers
Dmitry Karasik said:
>
> 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;
>


Develeopment branch is currently in feature freeze pending release of
version 8.1.

Meanwhile, I will observe that this very desirable feature needs an
interface with spi_fetchrow() - fetching large gobs of data all at once into
perl memory is just not nice.

We need to examine the names being used on our spi functions - I'm not sure
there is sufficient consistency about them.

cheers

andrew



In response to

Responses

pgsql-hackers by date

Next:From: Gnanavel SDate: 2005-09-27 12:05:58
Subject: Re: PostgreSQL overall design
Previous:From: Abhijit Menon-SenDate: 2005-09-27 10:27:01
Subject: Re: PostgreSQL overall design

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group