PLPerl not installed correctly?

From: "Daniel Hutchison" <Daniel(dot)Hutchison(at)rokaconsulting(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: PLPerl not installed correctly?
Date: 2010-04-14 02:18:07
Message-ID: 010b01cadb78$bae097c0$30a1c740$@Hutchison@rokaconsulting.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I've been experiencing problems getting any plperl function working, and I
believe the problem lies in the actual plperl installation not due to my
rusty perl memories. For example, the very simple plperl example in the
comprehensive documentation (at
http://www.postgresql.org/docs/8.4/interactive/plperl-funcs.html):

CREATE FUNCTION perl_max (integer, integer) RETURNS integer AS $$

if ($_[0] > $_[1]) { return $_[0]; }

return $_[1];

$$ LANGUAGE plperl;

Returns something odd (at least to me, also with little postgresql
experience):

prod1=> select perl_max(1,2);

ERROR: invalid input syntax for integer: "CODE(0x1f6d13c)"

I have seen something similar to "CODE(0x...)" show up in other programs,
but because the input parameter on those was TEXT I didn't get an error...
the program just behaved very confusingly until I realized that the correct
text input was being replaced with "CODE(0x...)". At least in this example,
I get an actual error because the input variable doesn't match type.

Thanks for any help you can tell me on how to fix this!

Daniel

My Environment:

PostgreSQL: \set: "VERSION = 'PostgreSQL 8.4.3, compiled by Visual C++ build
1400, 32-bit'"

OS: Windows Vista laptop (only for development purposes, I swear ;) )

ActivePerl: perl -v: "This is perl, v5.10.1 built for
MSWin32-x86-multi-thread"

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Donn Washburn 2010-04-14 03:09:54 first steps
Previous Message Danny Lo 2010-04-14 01:10:24 How to best partition table