Bug #745: PL/Perl function fails if not called first, under solaris - Mailing list pgsql-bugs

From pgsql-bugs@postgresql.org
Subject Bug #745: PL/Perl function fails if not called first, under solaris
Date
Msg-id 20020823170456.BB0414759C6@postgresql.org
Whole thread Raw
List pgsql-bugs
Erik G. Burrows (eburrows@erikburrows.com) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
PL/Perl function fails if not called first, under solaris

Long Description
I have a PL/Perl stored procedure, called encrypt_password (included in this report) which simply makes a call to the
Crypt::PasswdMD5library for password encryption. This function is used extensively on my web site for security. When
operatingwith PostgreSQL under Linux (RH 7.3) everything works perfectly. However, when the same setup is duplicated on
myproduction Sun E450 runing Solaris 8, the function only works if it is the first 'action' of the connection. If any
otherfunctions are called first, or if any other SQL statement is executed, I get an error stating that the Perl
interperteris unable to find vars.pm in it's @INC array. That array is printed out, and within @INC is the directory in
whichvars.pm lives. The postgres user does have permission to get to and read this file.  
Since vars.pm is part of the core Perl library, I am assuming that whatever is causing this error is preventing the
interperterfrom 'use'ing any library files, and vars.pm is just the first one it's looking for. 


Sample Code
-- DROP FUNCTION encrypt_password(VARCHAR, VARCHAR);
CREATE FUNCTION encrypt_password(VARCHAR, VARCHAR) RETURNS VARCHAR AS '
    use Crypt::PasswdMD5;

    my($cleartext, $salt) = @_;
    my($crypttext);

    $crypttext = unix_md5_crypt($cleartext, $salt);

    return $crypttext;
' LANGUAGE 'plperlu';


No file was uploaded with this report

pgsql-bugs by date:

Previous
From:
Date:
Subject: Remove A Column But Fail To Import
Next
From: Dmitry Tkach
Date:
Subject: 'on delete' rule: bug or feature...