Bug #956: plperl vs. plperlu

Started by PostgreSQL Bugs Listalmost 23 years ago3 messagesbugs
Jump to latest
#1PostgreSQL Bugs List
pgsql-bugs@postgresql.org

A.Bhuvaneswaran (bhuvansql@myrealbox.com) reports a bug with a severity of 4
The lower the number the more severe it is.

Short Description
plperl vs. plperlu

Long Description
Hi,

FYI, in 7.3.2, we are unable to create two languages viz, plperl and plperlu since he is trying to create the function(plperl_call_handler) and the language everytime. Infact it is not documented anywhere in the release. Someone correct me, if i am wrong. FYI, i have included the output of createlang command.

regards,
bhuvaneswaran

Sample Code
$ createlang -e -L /usr/lib/postgresql/ -d test_pg 'plperl';
SELECT oid FROM pg_language WHERE lanname = 'plperl';
SELECT oid FROM pg_proc WHERE proname = 'plperl_call_handler' AND prorettype = 0 AND pronargs = 0;
SET autocommit TO 'on';CREATE FUNCTION "plperl_call_handler" () RETURNS LANGUAGE_HANDLER AS '/usr/lib/postgresql//plperl' LANGUAGE C;
SET autocommit TO 'on';CREATE TRUSTED LANGUAGE "plperl" HANDLER "plperl_call_handler";
$ createlang -e -L /usr/lib/postgresql/ -d test_pg 'plperlu';
SELECT oid FROM pg_language WHERE lanname = 'plperlu';
SELECT oid FROM pg_proc WHERE proname = 'plperl_call_handler' AND prorettype = 0 AND pronargs = 0;
SET autocommit TO 'on';CREATE FUNCTION "plperl_call_handler" () RETURNS LANGUAGE_HANDLER AS '/usr/lib/postgresql//plperl' LANGUAGE C;
ERROR: function plperl_call_handler already exists with same argument types
createlang: language installation failed
$

No file was uploaded with this report

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: PostgreSQL Bugs List (#1)
Re: Bug #956: plperl vs. plperlu

pgsql-bugs@postgresql.org writes:

FYI, in 7.3.2, we are unable to create two languages viz, plperl and
plperlu

Wups. There is code in there to handle that case, but it got broken by
a last-minute 7.3 change. Here's the patch.

regards, tom lane

*** src/bin/scripts/createlang.sh~	Fri Oct 18 18:05:36 2002
--- src/bin/scripts/createlang.sh	Sat Apr 26 11:19:05 2003
***************
*** 256,262 ****
  # ----------
  # Check whether the call handler exists
  # ----------
! sqlcmd="SELECT oid FROM pg_proc WHERE proname = '$handler' AND prorettype = 0 AND pronargs = 0;"
  if [ "$showsql" = yes ]; then
  	echo "$sqlcmd"
  fi
--- 256,262 ----
  # ----------
  # Check whether the call handler exists
  # ----------
! sqlcmd="SELECT oid FROM pg_proc WHERE proname = '$handler' AND prorettype = (SELECT oid FROM pg_type WHERE typname = 'language_handler') AND pronargs = 0;"
  if [ "$showsql" = yes ]; then
  	echo "$sqlcmd"
  fi
#3A.Bhuvaneswaran
bhuvansql@myrealbox.com
In reply to: Tom Lane (#2)
Re: Bug #956: plperl vs. plperlu

FYI, in 7.3.2, we are unable to create two languages viz, plperl and
plperlu

Wups. There is code in there to handle that case, but it got broken by
a last-minute 7.3 change. Here's the patch.

After applying the patch, i am able to create two languages viz, plperl
and plperlu.

Thank you.

regards,
bhuvaneswaran