Re: [PATCHES] implement prepared queries in plperl

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: dmitry(at)karasik(dot)eu(dot)org
Cc: Postgresql Dev <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] implement prepared queries in plperl
Date: 2006-03-07 03:18:56
Message-ID: 440CFBA0.5020800@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


[moving to -hackers]

Dmitry Karasik wrote:

>>I have committed the patch and docs for this - it's an important feature
>>and I would like people banging on it.
>>I'd like to review the API we provide to plperl, though - I don't like
>>it much. I think that should be an 8.2 TODO.
>>
>>
>
>Thanks!
>
>If you'd be interested in my opinion, I thought that probably it would be
>beneficial to have two layers of access to SPI, first, the existing spi_xxx()
>set, and second, fully object oriented, with 'SPI->new' or
>'SPI->query->rows->data' or whatever else imagined. That would've been a good
>design for an average Perl XS module, because XS layer would only introduced
>direct mappings to C functions, and the accompanied perl code in .pm file would
>implement object bells and whistles based on C API as seen from perl. That's a
>bit bloatish, so I'd understand if you would want to completely rewrite the
>Perl API, however, I'd propose to do that in two phases: first, introduce
>object API that is implemented on well-known spi_xxx(), and then, if necessary,
>get rid of the latter.
>
>

Well, if we want an OO API I'd like to get to where we have a DBI
handle. Perl programmers are familiar with how it works. In plperl it
would just be there (no need to open/close it). Someone already did
this, although it got dataed and is GPLed so we can't include it in the
postgresl core. But that's what I and many other plperl people want.

I would also like to see a nice clean procedural API, rather more
lightweight than DBI. But I don't think we need to be mirroring the SPI
API. The fact that we use SPI is an implementation detail. I know pltcl
calls things spi_foo. But especially if we are not exactly mirroring a
call in SPI we should not do that, IMNSHO.

>btw, would be me appropriate to move the discussion into hackers(at)?
>
>
>

yes. done.

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2006-03-07 07:45:55 Re: PostgreSQL Anniversary Summit, Call for Contributions
Previous Message Bruce Momjian 2006-03-07 03:12:00 Re: [HACKERS] Zeroing damaged pages

Browse pgsql-patches by date

  From Date Subject
Next Message Hans-Jürgen Schönig 2006-03-07 08:29:34 CREATE SYNONYM ...
Previous Message Bruce Momjian 2006-03-07 03:12:00 Re: [HACKERS] Zeroing damaged pages