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

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: PostgreSQL::PLPerl::Call - Simple interface for calling SQL functions from PostgreSQL PL/Perl
Дата
Msg-id 4B792507.8050507@archonet.com
обсуждение исходный текст
Ответ на Re: PostgreSQL::PLPerl::Call - Simple interface for calling SQL functions from PostgreSQL PL/Perl  (Tim Bunce <Tim.Bunce@pobox.com>)
Ответы Re: PostgreSQL::PLPerl::Call - Simple interface for calling SQL functions from PostgreSQL PL/Perl  (Tim Bunce <Tim.Bunce@pobox.com>)
Список pgsql-hackers
On 15/02/10 10:32, Tim Bunce wrote:
> On Mon, Feb 15, 2010 at 07:31:14AM +0000, Richard Huxton wrote:
>>
>> Is there any value in having a two-stage interface?
>>
>>     $seq_fn = get_call('nextval(regclass)');
>>     $foo1   = $seq_fn->($seq1);
>>     $foo2   = $seq_fn->($seq2);
>
> I don't think there's significant performance value in that.
>
> Perhaps it could be useful to be able to pre-curry a call and
> then pass that code ref around, but you can do that trivially
> already:
>
>      $nextval_fn = sub { call('nextval(regclass)', @_) };
>      $val = $nextval_fn->($seq1);
> or
>      $nextfoo_fn = sub { call('nextval(regclass)', 'foo_seqn') };
>      $val = $nextfoo_fn->();

Fair enough. Just wondered whether it was worth putting that on your 
side of the interface. I'm forced to concede you probably have more 
experience in database-related APIs than me :-)

--   Richard Huxton  Archonet Ltd


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: idle in txn query cancellation
Следующее
От: Andres Freund
Дата:
Сообщение: Re: idle in txn query cancellation