Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-17 Thread Alvaro Herrera
Excerpts from Alex Hunsaker's message of sáb feb 12 04:53:14 -0300 2011: - make plperl.o depend on plperl_helpers.h (should have been done in the utf8 patch) Incidentally, I think this bit was lost, no? -- Álvaro Herrera alvhe...@commandprompt.com The PostgreSQL Company - Command Prompt,

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-17 Thread Alex Hunsaker
On Thu, Feb 17, 2011 at 16:18, Alvaro Herrera alvhe...@commandprompt.com wrote: Excerpts from Alex Hunsaker's message of sáb feb 12 04:53:14 -0300 2011: - make plperl.o depend on plperl_helpers.h (should have been done in the utf8 patch) Incidentally, I think this bit was lost, no? It was,

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-17 Thread Alvaro Herrera
Excerpts from Alvaro Herrera's message of mié feb 16 19:54:07 -0300 2011: I cleaned up the patch a bit -- result is v11, attached. I'll give it another look tomorrow and hopefully commit it. Applied. Thanks. -- Álvaro Herrera alvhe...@commandprompt.com The PostgreSQL Company - Command

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-16 Thread Tim Bunce
On Sat, Feb 12, 2011 at 02:17:12AM +0200, Alexey Klyukin wrote: So, here is the v8. Instead of rewriting the encode_array_literal I've added another function, encode_type_literal (could use a better name). Given that encode_array_literal() encodes an _array_ as a literal, I'd assume

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-16 Thread Alvaro Herrera
Excerpts from Tim Bunce's message of mié feb 16 14:08:11 -0300 2011: On Sat, Feb 12, 2011 at 02:17:12AM +0200, Alexey Klyukin wrote: So, here is the v8. Instead of rewriting the encode_array_literal I've added another function, encode_type_literal (could use a better name). Given that

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-16 Thread Alvaro Herrera
I cleaned up the patch a bit -- result is v11, attached. I'll give it another look tomorrow and hopefully commit it. -- Álvaro Herrera alvhe...@commandprompt.com The PostgreSQL Company - Command Prompt, Inc. PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-16 Thread Alex Hunsaker
On Wed, Feb 16, 2011 at 12:21, Alvaro Herrera alvhe...@commandprompt.com wrote: Excerpts from Tim Bunce's message of mié feb 16 14:08:11 -0300 2011: I'd suggest encode_typed_literal() as a better name. FYI I'm looking at this patch (v10), and I'll incorporate Tim's suggestion. Looks good to

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-15 Thread Alexey Klyukin
On Feb 12, 2011, at 9:53 AM, Alex Hunsaker wrote: On Fri, Feb 11, 2011 at 17:17, Alexey Klyukin al...@commandprompt.com wrote: Anyway in playing with this patch a bit more I found another bug return [[]]; would segfault. So find attached a v9 that: - fixes above segfault - made

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-15 Thread David E. Wheeler
On Feb 15, 2011, at 6:39 AM, Alexey Klyukin wrote: After I re-added the closing /para in plperl.sgml:235 these errors disappeared, and the resulting html looks fine too. v10 with just this single change is attached. So is this ready for committer? Best, David -- Sent via pgsql-hackers

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-15 Thread Alexey Klyukin
On Feb 15, 2011, at 7:45 PM, David E. Wheeler wrote: On Feb 15, 2011, at 6:39 AM, Alexey Klyukin wrote: After I re-added the closing /para in plperl.sgml:235 these errors disappeared, and the resulting html looks fine too. v10 with just this single change is attached. So is this ready

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-15 Thread David E. Wheeler
On Feb 15, 2011, at 9:49 AM, Alexey Klyukin wrote: After I re-added the closing /para in plperl.sgml:235 these errors disappeared, and the resulting html looks fine too. v10 with just this single change is attached. So is this ready for committer? Yes. Awesom, thanks Alexey Alex!

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-11 Thread Alexey Klyukin
On Feb 10, 2011, at 11:26 PM, Alexey Klyukin wrote: On Feb 10, 2011, at 9:44 PM, Andrew Dunstan wrote: On 02/10/2011 08:15 AM, Alexey Klyukin wrote: Let me try implementing that as an XS interface to plperl_array_to_datum. Are you intending this as a completion of the current patch

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-11 Thread Alex Hunsaker
On Fri, Feb 11, 2011 at 17:17, Alexey Klyukin al...@commandprompt.com wrote: So, here is the v8. Instead of rewriting the encode_array_literal I've added another function, encode_type_literal (could use a better name). ... I can easily convert the encode_array_literal to just call this

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-10 Thread Alexey Klyukin
On Feb 9, 2011, at 9:28 PM, Alex Hunsaker wrote: On Wed, Feb 9, 2011 at 08:24, Alexey Klyukin al...@commandprompt.com wrote: What was actually broken in encode_array_literal support of composite types (it converted perl hashes to the literal composite-type constants, expanding nested

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-10 Thread Andrew Dunstan
On 02/10/2011 08:15 AM, Alexey Klyukin wrote: On Feb 9, 2011, at 9:28 PM, Alex Hunsaker wrote: On Wed, Feb 9, 2011 at 08:24, Alexey Klyukinal...@commandprompt.com wrote: What was actually broken in encode_array_literal support of composite types (it converted perl hashes to the literal

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-10 Thread Alexey Klyukin
On Feb 10, 2011, at 9:44 PM, Andrew Dunstan wrote: On 02/10/2011 08:15 AM, Alexey Klyukin wrote: On Feb 9, 2011, at 9:28 PM, Alex Hunsaker wrote: On Wed, Feb 9, 2011 at 08:24, Alexey Klyukinal...@commandprompt.com wrote: What was actually broken in encode_array_literal support of

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-09 Thread Alexey Klyukin
On Feb 9, 2011, at 3:44 AM, Alex Hunsaker wrote: So the merge while not exactly trivial was fairly simple. However it would be great if you could give it another look over. Find attached v7 changes include: - rebased against HEAD - fix potential use of uninitialized dims[cur_depth] -

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-09 Thread Tim Bunce
On Tue, Feb 08, 2011 at 09:40:38AM -0500, Andrew Dunstan wrote: On 02/03/2011 01:20 PM, Andrew Dunstan wrote: Well, the question seems to be whether or not it's a reasonable price to pay. On the whole I'm inclined to think it is, especially when it can be avoided by updating your code, which

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-09 Thread Alex Hunsaker
On Wed, Feb 9, 2011 at 08:24, Alexey Klyukin al...@commandprompt.com wrote: What was actually broken in encode_array_literal support of composite types (it converted perl hashes to the literal composite-type constants, expanding nested arrays along the way) ? I think it would be a useful

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-08 Thread Andrew Dunstan
On 02/03/2011 01:20 PM, Andrew Dunstan wrote: - Every existing plperl function that takes arrays is going to get slower due to the overhead of parsing the string and allocating the array and all its elements. Well, per my understanding of Alex changes, the string parsing is not invoked

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-08 Thread Alexey Klyukin
On Feb 6, 2011, at 9:43 AM, Alex Hunsaker wrote: On Thu, Feb 3, 2011 at 18:29, Alex Hunsaker bada...@gmail.com wrote: On Mon, Jan 31, 2011 at 01:34, Alexey Klyukin al...@commandprompt.com wrote: I've looked at the patch and added a test for arrays exceeding or equal maximum dimensions to

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-08 Thread Alex Hunsaker
On Tue, Feb 8, 2011 at 08:18, Alexey Klyukin al...@commandprompt.com wrote: On Feb 6, 2011, at 9:43 AM, Alex Hunsaker wrote: So here is a v6 Comments? Thanks, looks great to me. It passes all the tests on my OS X system. I wonder what's the purpose of the amagic_call in

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-08 Thread Alex Hunsaker
On Tue, Feb 8, 2011 at 10:33, Alex Hunsaker bada...@gmail.com wrote: On Tue, Feb 8, 2011 at 08:18, Alexey Klyukin al...@commandprompt.com wrote: Thanks, looks great to me. It passes all the tests on my OS X system. I wonder what's the purpose of the amagic_call in get_perl_array_ref, instead

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-08 Thread Alex Hunsaker
On Tue, Feb 8, 2011 at 10:33, Alex Hunsaker bada...@gmail.com wrote: On Tue, Feb 8, 2011 at 08:18, Alexey Klyukin al...@commandprompt.com wrote: On Feb 6, 2011, at 9:43 AM, Alex Hunsaker wrote: So here is a v6 Comments? Thanks, looks great to me. It passes all the tests on my OS X

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-05 Thread Alex Hunsaker
On Thu, Feb 3, 2011 at 18:29, Alex Hunsaker bada...@gmail.com wrote: On Mon, Jan 31, 2011 at 01:34, Alexey Klyukin al...@commandprompt.com wrote: I've looked at the patch and added a test for arrays exceeding or equal maximum dimensions to check, whether the recursive function won't bring

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-04 Thread Andrew Dunstan
On 02/03/2011 08:29 PM, Alex Hunsaker wrote: On Mon, Jan 31, 2011 at 01:34, Alexey Klyukinal...@commandprompt.com wrote: I've looked at the patch and added a test for arrays exceeding or equal maximum dimensions to check, whether the recursive function won't bring surprises there. I've

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-04 Thread Alex Hunsaker
On Fri, Feb 4, 2011 at 10:29, Andrew Dunstan and...@dunslane.net wrote: Anyone object to fixing the above as part of this patch? That is making plperl_(build_tuple_result, modify_tuple, return_next, hash_from_tuple) handle array and hash (composite/row) types consistently? And _that_ would be

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-03 Thread Alexey Klyukin
Hi, On Feb 2, 2011, at 7:16 PM, Tim Bunce wrote: I'm sorry I'm late to this party. I haven't been keeping up with pgsql-hackers. Better late than never :) I'd kind'a hoped that this functionality could be tied into extending PL/Perl to handle named arguments. That way the perl variables

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-03 Thread David E. Wheeler
On Feb 3, 2011, at 4:23 AM, Alexey Klyukin wrote: - Making the conversion lazy would be a big help. Converting it to string is already lazy, and, per the argumens above, I don't see a real benefit of lazy conversion to the perl reference (as comparing to the hurdles of implementing that).

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-03 Thread Tim Bunce
On Thu, Feb 03, 2011 at 02:23:32PM +0200, Alexey Klyukin wrote: Hi, On Feb 2, 2011, at 7:16 PM, Tim Bunce wrote: I'm sorry I'm late to this party. I haven't been keeping up with pgsql-hackers. Better late than never :) I'd kind'a hoped that this functionality could be tied into

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-03 Thread Andrew Dunstan
On 02/03/2011 01:01 PM, Tim Bunce wrote: Imagine that PL/Perl could handle named arguments: CREATE FUNCTION join_list( separator text, list array ) AS $$ return join( $separator, @$list ); $$ LANGUAGE plperl; The $list variable, magically created by PL/Perl, could be the

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-03 Thread Peter Eisentraut
On tor, 2011-02-03 at 18:01 +, Tim Bunce wrote: Imagine that PL/Perl could handle named arguments: CREATE FUNCTION join_list( separator text, list array ) AS $$ return join( $separator, @$list ); $$ LANGUAGE plperl; The $list variable, magically created by PL/Perl,

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-03 Thread Alex Hunsaker
On Thu, Feb 3, 2011 at 05:23, Alexey Klyukin al...@commandprompt.com wrote: Hi, On Feb 2, 2011, at 7:16 PM, Tim Bunce wrote: [...] Some observations on the current code (based on a quick skim): - I'd like to see the conversion function exposed as a builtin    $ref =

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-03 Thread Alex Hunsaker
On Mon, Jan 31, 2011 at 01:34, Alexey Klyukin al...@commandprompt.com wrote: I've looked at the patch and added a test for arrays exceeding or equal maximum dimensions to check, whether the recursive function won't bring surprises there. I've also added check_stack_depth calls to both

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-02 Thread Tim Bunce
I'm sorry I'm late to this party. I haven't been keeping up with pgsql-hackers. I'd kind'a hoped that this functionality could be tied into extending PL/Perl to handle named arguments. That way the perl variables corresponding to the named arguments could be given references without breaking any

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-02-01 Thread Alex Hunsaker
On Mon, Jan 31, 2011 at 01:34, Alexey Klyukin al...@commandprompt.com wrote: I've looked at the patch and added a test for arrays exceeding or equal maximum dimensions to check, whether the recursive function won't bring surprises there. I've also added check_stack_depth calls to both

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-31 Thread Alexey Klyukin
On Jan 29, 2011, at 12:27 AM, Alex Hunsaker wrote: On Thu, Jan 27, 2011 at 03:38, Alexey Klyukin al...@commandprompt.com wrote: Hi, On Jan 27, 2011, at 9:31 AM, Alex Hunsaker wrote: Find attached v3 of the patch. changes include: - fix deep recursion due to accidental reversal of check

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-28 Thread Alex Hunsaker
On Thu, Jan 27, 2011 at 03:38, Alexey Klyukin al...@commandprompt.com wrote: Hi, On Jan 27, 2011, at 9:31 AM, Alex Hunsaker wrote: Find attached v3 of the patch.  changes include: - fix deep recursion due to accidental reversal of check in encode_array_literal - add proper support for

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-27 Thread Alexey Klyukin
Hi, On Jan 27, 2011, at 9:31 AM, Alex Hunsaker wrote: Find attached v3 of the patch. changes include: - fix deep recursion due to accidental reversal of check in encode_array_literal - add proper support for stringifying composite/row types. I did not find a good way to quote these from

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-26 Thread Alex Hunsaker
On Sat, Jan 15, 2011 at 15:48, Alex Hunsaker bada...@gmail.com wrote: On Wed, Jan 12, 2011 at 13:04, Alexey Klyukin al...@commandprompt.com wrote: On Jan 12, 2011, at 8:52 PM, David E. Wheeler wrote: On Jan 12, 2011, at 5:14 AM, Alexey Klyukin wrote: You mean packing both a string

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-26 Thread Alexey Klyukin
Hi, On Jan 26, 2011, at 8:45 PM, Alex Hunsaker wrote: On Sat, Jan 15, 2011 at 15:48, Alex Hunsaker bada...@gmail.com wrote: On Wed, Jan 12, 2011 at 13:04, Alexey Klyukin al...@commandprompt.com wrote: On Jan 12, 2011, at 8:52 PM, David E. Wheeler wrote: On Jan 12, 2011, at 5:14 AM,

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-26 Thread Alex Hunsaker
On Wed, Jan 26, 2011 at 12:44, Alexey Klyukin al...@commandprompt.com wrote: Hi, On Jan 26, 2011, at 8:45 PM, Alex Hunsaker wrote: On Sat, Jan 15, 2011 at 15:48, Alex Hunsaker bada...@gmail.com wrote: On Wed, Jan 12, 2011 at 13:04, Alexey Klyukin al...@commandprompt.com wrote: On Jan 12,

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-26 Thread Alexey Klyukin
On Jan 26, 2011, at 10:08 PM, Alex Hunsaker wrote: On Wed, Jan 26, 2011 at 12:44, Alexey Klyukin al...@commandprompt.com wrote: Hi, On Jan 26, 2011, at 8:45 PM, Alex Hunsaker wrote: On Sat, Jan 15, 2011 at 15:48, Alex Hunsaker bada...@gmail.com wrote: On Wed, Jan 12, 2011 at 13:04,

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-26 Thread Alex Hunsaker
On Wed, Jan 26, 2011 at 13:35, Alexey Klyukin al...@commandprompt.com wrote: On Jan 26, 2011, at 10:08 PM, Alex Hunsaker wrote: (it's obviously reversed comparing with the original one), but it still segfaults after I fixed that. Ahh yep, the reason reversing the check did not fix it is

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-26 Thread Alex Hunsaker
Find attached v3 of the patch. changes include: - fix deep recursion due to accidental reversal of check in encode_array_literal - add proper support for stringifying composite/row types. I did not find a good way to quote these from the perl on the fly, so instead we compute it the same way we

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-15 Thread Alex Hunsaker
On Wed, Jan 12, 2011 at 13:04, Alexey Klyukin al...@commandprompt.com wrote: On Jan 12, 2011, at 8:52 PM, David E. Wheeler wrote: On Jan 12, 2011, at 5:14 AM, Alexey Klyukin wrote: You mean packing both a string representation and a reference to a single SV * value? Dunno, I'm not a guts

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-13 Thread Martijn van Oosterhout
On Thu, Jan 13, 2011 at 12:06:33AM -0700, Alex Hunsaker wrote: I had supposed that it would be possible to do the string conversion lazily, ie, only if the string value was actually demanded. Yep, In-fact if we wanted we could even die (or throw an exception in other language speak :) )

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-13 Thread Alex Hunsaker
On Thu, Jan 13, 2011 at 01:06, Martijn van Oosterhout klep...@svana.org wrote: On Thu, Jan 13, 2011 at 12:06:33AM -0700, Alex Hunsaker wrote: I had supposed that it would be possible to do the string conversion lazily, ie, only if the string value was actually demanded. Yep, In-fact if we

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-13 Thread Stephen J. Butler
On Thu, Jan 13, 2011 at 2:06 AM, Martijn van Oosterhout klep...@svana.org wrote: I played with this a little and it is fairly easy to make a variable such that $a is the string representation and $a[0] the first value of the array. The problem is that you can't pass such a variable into a

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-13 Thread David E. Wheeler
On Jan 13, 2011, at 4:15 PM, Stephen J. Butler wrote: Suppose one of these compatibility objects is passed into legacy code as $_[0]. The problem is that 'ref $_[0]' will return 'Pg::ArrayArg' instead of what it used to, '' (empty string). Other than that, I think it performs as people would

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-12 Thread Alexey Klyukin
On Jan 12, 2011, at 1:07 AM, David E. Wheeler wrote: On Jan 11, 2011, at 2:25 PM, Alexey Klyukin wrote: Hello, Here's the patch that improves handling of arrays as pl/perl function input arguments, converting postgres arrays of arbitrary dimensions into perl array references.

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-12 Thread Alexey Klyukin
On Jan 12, 2011, at 4:06 AM, Robert Haas wrote: On Tue, Jan 11, 2011 at 7:55 PM, Andrew Dunstan and...@dunslane.net wrote: On 01/11/2011 07:17 PM, David E. Wheeler wrote: On Jan 11, 2011, at 3:44 PM, Andrew Dunstan wrote: I think there's at least a danger of breaking legacy code doing

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-12 Thread David E. Wheeler
On Jan 12, 2011, at 5:14 AM, Alexey Klyukin wrote: You mean packing both a string representation and a reference to a single SV * value? Dunno, I'm not a guts guy. I haven't considered that (lack of extensive perlgus-foo) although I think that's an interesting idea. One drawback would be

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-12 Thread Alex Hunsaker
On Wed, Jan 12, 2011 at 06:34, Alexey Klyukin al...@commandprompt.com wrote: On Jan 12, 2011, at 4:06 AM, Robert Haas wrote: By the same token, I'm not convinced it's a good idea for this behavior to be off by default.  Surely many people will altogether fail to notice that it's an option?  

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-12 Thread David E. Wheeler
On Jan 12, 2011, at 11:22 AM, Alex Hunsaker wrote: Personally, I think the point of a compatibility GUC is that at some point in the distant future we can get rid of it. If we default to the old behavior thats going to be harder to do. +1 for defaulting to the new behavior. +1 [ Id

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-12 Thread David Fetter
On Wed, Jan 12, 2011 at 12:22:55PM -0700, Alex Hunsaker wrote: On Wed, Jan 12, 2011 at 06:34, Alexey Klyukin al...@commandprompt.com wrote: On Jan 12, 2011, at 4:06 AM, Robert Haas wrote: By the same token, I'm not convinced it's a good idea for this behavior to be off by default.  Surely

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-12 Thread Alvaro Herrera
Excerpts from Alex Hunsaker's message of mié ene 12 16:22:55 -0300 2011: [ Id actually vote for _not_ having a compatibility option at all, we change more major things than this IMHO every major release. (And even then some major things in minor releases, for example the removal of Safe.pm) ]

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-12 Thread David E. Wheeler
On Jan 12, 2011, at 11:36 AM, Alvaro Herrera wrote: [ Id actually vote for _not_ having a compatibility option at all, we change more major things than this IMHO every major release. (And even then some major things in minor releases, for example the removal of Safe.pm) ] I think the main

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-12 Thread Alvaro Herrera
Excerpts from David E. Wheeler's message of mié ene 12 16:39:56 -0300 2011: On Jan 12, 2011, at 11:36 AM, Alvaro Herrera wrote: [ Id actually vote for _not_ having a compatibility option at all, we change more major things than this IMHO every major release. (And even then some major

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-12 Thread David E. Wheeler
On Jan 12, 2011, at 11:51 AM, Alvaro Herrera wrote: I suspect it'd be quiet, unfortunately, since there are a bazillion ad hoc implementations of a Perl SQL array parser, and many of them, I suspect, don't complain if the string doesn't look like an SQL array. They would just parse a

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-12 Thread Alexey Klyukin
On Jan 12, 2011, at 8:52 PM, David E. Wheeler wrote: On Jan 12, 2011, at 5:14 AM, Alexey Klyukin wrote: You mean packing both a string representation and a reference to a single SV * value? Dunno, I'm not a guts guy. Well, neither me (I haven't used much of the guts api there). I

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-12 Thread Alexey Klyukin
On Jan 12, 2011, at 9:36 PM, Alvaro Herrera wrote: Excerpts from Alex Hunsaker's message of mié ene 12 16:22:55 -0300 2011: [ Id actually vote for _not_ having a compatibility option at all, we change more major things than this IMHO every major release. (And even then some major things in

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-12 Thread Alvaro Herrera
Excerpts from David E. Wheeler's message of mié ene 12 16:55:17 -0300 2011: On Jan 12, 2011, at 11:51 AM, Alvaro Herrera wrote: I suspect it'd be quiet, unfortunately, since there are a bazillion ad hoc implementations of a Perl SQL array parser, and many of them, I suspect, don't

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-12 Thread Tom Lane
Alexey Klyukin al...@commandprompt.com writes: Since almost everyone votes for making the new behavior a default option I'm inclined to do that change, although I'm against throwing out the compatibility option. There are many other reasons except for PL/Perl for people to upgrade to 9.1,

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-12 Thread Andrew Dunstan
On 01/12/2011 04:22 PM, Tom Lane wrote: Alexey Klyukinal...@commandprompt.com writes: Since almost everyone votes for making the new behavior a default option I'm inclined to do that change, although I'm against throwing out the compatibility option. There are many other reasons except for

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-12 Thread Robert Haas
On Wed, Jan 12, 2011 at 4:45 PM, Andrew Dunstan and...@dunslane.net wrote: I thought the idea of overloading the string representation to look like the old style was a cute solution.  If we don't have anyone at hand who knows how to do that, let's find someone who does.  Not break our users'

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-12 Thread David E. Wheeler
On Jan 12, 2011, at 3:29 PM, Robert Haas wrote: What I was casting a bit of doubt on upthread was whether or not this would work without possibly breaking some code, in possibly silent or obscure ways. If I'm wrong about that, then by all means let's use some perl Magic (that's a technical

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-12 Thread Tom Lane
David E. Wheeler da...@kineticode.com writes: On Jan 11, 2011, at 3:44 PM, Andrew Dunstan wrote: I think there's at least a danger of breaking legacy code doing that. Say you have some code that does a ref test on the argument, for example. The behavior would now be changed. I think that'd

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-12 Thread Tom Lane
David E. Wheeler da...@kineticode.com writes: On Jan 12, 2011, at 5:14 AM, Alexey Klyukin wrote: You mean packing both a string representation and a reference to a single SV * value? Dunno, I'm not a guts guy. I haven't considered that (lack of extensive perlgus-foo) although I think

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-12 Thread Alex Hunsaker
On Wed, Jan 12, 2011 at 22:12, Tom Lane t...@sss.pgh.pa.us wrote: David E. Wheeler da...@kineticode.com writes: On Jan 12, 2011, at 5:14 AM, Alexey Klyukin wrote: You mean packing both a string representation and a reference to a single SV * value? Dunno, I'm not a guts guy. I haven't

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-12 Thread Alex Hunsaker
On Wed, Jan 12, 2011 at 14:45, Andrew Dunstan and...@dunslane.net wrote: What I was casting a bit of doubt on upthread was whether or not this would work without possibly breaking some code, in possibly silent or obscure ways. I can't see how it would break, unless we did it wrong... If I'm

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-11 Thread David E. Wheeler
On Jan 11, 2011, at 2:25 PM, Alexey Klyukin wrote: Hello, Here's the patch that improves handling of arrays as pl/perl function input arguments, converting postgres arrays of arbitrary dimensions into perl array references. Awesome! I've wanted this for *years*. It includes regression

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-11 Thread Andrew Dunstan
On 01/11/2011 06:07 PM, David E. Wheeler wrote: To maintain compatibility with existing pl/perl code a new variable, plperl.convert_array_arguments (better name?), is introduced. Its default value is false, when set to true it triggers the new behavior, i.e. Have you considered instead

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-11 Thread David E. Wheeler
On Jan 11, 2011, at 3:44 PM, Andrew Dunstan wrote: I think there's at least a danger of breaking legacy code doing that. Say you have some code that does a ref test on the argument, for example. The behavior would now be changed. I think that'd be pretty rare. David -- Sent via

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-11 Thread Andrew Dunstan
On 01/11/2011 07:17 PM, David E. Wheeler wrote: On Jan 11, 2011, at 3:44 PM, Andrew Dunstan wrote: I think there's at least a danger of breaking legacy code doing that. Say you have some code that does a ref test on the argument, for example. The behavior would now be changed. I think

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-11 Thread Robert Haas
On Tue, Jan 11, 2011 at 7:55 PM, Andrew Dunstan and...@dunslane.net wrote: On 01/11/2011 07:17 PM, David E. Wheeler wrote: On Jan 11, 2011, at 3:44 PM, Andrew Dunstan wrote: I think there's at least a danger of breaking legacy code doing that. Say you have some code that does a ref test on

Re: [HACKERS] arrays as pl/perl input arguments [PATCH]

2011-01-11 Thread Andrew Dunstan
On 01/11/2011 09:06 PM, Robert Haas wrote: On Tue, Jan 11, 2011 at 7:55 PM, Andrew Dunstanand...@dunslane.net wrote: On 01/11/2011 07:17 PM, David E. Wheeler wrote: On Jan 11, 2011, at 3:44 PM, Andrew Dunstan wrote: I think there's at least a danger of breaking legacy code doing that. Say