Re: PostgreSQL::PLPerl::Call - Simple interface for calling SQL functions from PostgreSQL PL/Perl - Mailing list pgsql-hackers

From David E. Wheeler
Subject Re: PostgreSQL::PLPerl::Call - Simple interface for calling SQL functions from PostgreSQL PL/Perl
Date
Msg-id 4EA17200-BC13-405A-888F-EAD995D1BCF2@kineticode.com
Whole thread Raw
In response to PostgreSQL::PLPerl::Call - Simple interface for calling SQL functions from PostgreSQL PL/Perl  (Tim Bunce <Tim.Bunce@pobox.com>)
Responses Re: PostgreSQL::PLPerl::Call - Simple interface for calling SQL functions from PostgreSQL PL/Perl
List pgsql-hackers
On Feb 12, 2010, at 3:10 PM, Tim Bunce wrote:

> I've appended the POD documentation and attached the (rough but working)
> test script.
>
> I plan to release the module to CPAN in the next week or so.
>
> I'd greatly appreciate any feedback.

I like the idea overall, and anything that can simplify the interface is more than welcome. However:

* I'd rather not have to specify a signature for a non-polymorphic function.
* I'd like to be able to use Perl code to call the functions as discussed previously, something like:
     my $count_sql = SP->tl_activity_stats_sql(         [ statistic => $stat, person_id => $pid ],         $debug
);
 For a Polymorphic function, perhaps it could be something like:
     my $count = SP->call(         tl_activity_stats_sql => [qw(text[] int)],         [ statistic => $stat, person_id
=>$pid ],         $debug     ); 
 The advantage here is that I'm not writing functions inside strings, and only provide the signature when I need to
disambiguatebetween polymorphic variants. 

Anyway, That's just interface arguing. The overall idea is sound and very much appreciated.

Best,

David



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: idle in txn query cancellation
Next
From: "David E. Wheeler"
Date:
Subject: Re: Package namespace and Safe init cleanup for plperl [PATCH]