plruby issue with redeclaring functions - Mailing list pgsql-general

From David Garamond
Subject plruby issue with redeclaring functions
Date
Msg-id 41174CCD.10206@zara.6.isreserved.com
Whole thread Raw
Responses Re: plruby issue with redeclaring functions
List pgsql-general
-- plruby 0.4.2, ruby 1.8.1, pg 7.4.3, linux

-- 1. create a valid plruby function
create or replace function sqr(int4) returns int4 as '
   args[0]*args[0]
' language 'plruby';

-- 2. test it
select sqr(5);

-- 3. recreate the function, with syntax error
create or replace function sqr(int4) returns int4 as '
   args[0]*args[0]-
' language 'plruby';

-- 4. test it
select sqr(5);

-- 5. recreate the function, fix the syntax error
create or replace function sqr(int4) returns int4 as '
   args[0]*args[0]
' language 'plruby';

-- 6. test it.
select sqr(5);

step 6 fails with:

ERROR:  method `proc_1057896' not defined in Module

note:

* ok if using plpgsql
* ok if step 2 and/or 4 is skipped
* of if step 5 is replaced with DROP FUNCTION + CREATE FUNCTION

--
dave


pgsql-general by date:

Previous
From: dmartini@uni-hohenheim.de
Date:
Subject: Re: Embedded Database
Next
From: zhicheng wang
Date:
Subject: postgresql and smp linux kernel