Skip site navigation (1) Skip section navigation (2)

Bug #745: PL/Perl function fails if not called first, under solaris

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug #745: PL/Perl function fails if not called first, under solaris
Date: 2002-08-23 17:04:56
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
Erik G. Burrows (eburrows(at)erikburrows(dot)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::PasswdMD5 library for password encryption. This function is used extensively on my web site for security. When operating with PostgreSQL under Linux (RH 7.3) everything works perfectly. However, when the same setup is duplicated on my production Sun E450 runing Solaris 8, the function only works if it is the first 'action' of the connection. If any other functions are called first, or if any other SQL statement is executed, I get an error stating that the Perl interperter is unable to find in it's @INC array. That array is printed out, and within @INC is the directory in which lives. The postgres user does have permission to get to and read this file. 
Since is part of the core Perl library, I am assuming that whatever is causing this error is preventing the interperter from 'use'ing any library files, and is just the first one it's looking for.

Sample Code
-- DROP FUNCTION encrypt_password(VARCHAR, VARCHAR);
	use Crypt::PasswdMD5;

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

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

	return $crypttext;
' LANGUAGE 'plperlu';

No file was uploaded with this report

pgsql-bugs by date

Next:From: Dmitry TkachDate: 2002-08-23 17:09:20
Subject: 'on delete' rule: bug or feature...
Previous:From: s mahendranDate: 2002-08-23 09:43:51
Subject: regarding postgres

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group