From: | Eric Lee Green <pgsql-hackers(at)estinc(dot)com> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Broken PL/PgSQL for 7.0 beta 3? |
Date: | 2000-04-03 21:46:20 |
Message-ID: | 38E9112C.7797B2BA@estinc.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
The following code works under 6.5 and doesn't work in 7.0 beta 3. Comments?
------------------snip---------------------------------------
create table paths ( pathnum serial, pathname text );
CREATE FUNCTION plpgsql_call_handler () RETURNS OPAQUE AS
'/opt/brupro/pgsql/lib/plpgsql.so' LANGUAGE 'C';
CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql'
HANDLER plpgsql_call_handler
LANCOMPILER 'PL/pgSQL';
/**********************************************************
* This function makes handling paths MUCH faster on inserts:
**********************************************************/
CREATE FUNCTION get_path (text) RETURNS integer AS '
DECLARE
retval integer;
BEGIN
select pathnum into retval from paths where pathname = $1 ;
if not found then
insert into paths ( pathname )values ( $1 ) ;
select pathnum into retval from paths where pathname = $1 ;
end if ;
return retval ;
END;
' LANGUAGE 'plpgsql';
select get_path('/etc');
--------------end snip-------------------------------
--
Eric Lee Green eric(at)estinc(dot)com
Software Engineer Visit our Web page:
Enhanced Software Technologies, Inc. http://www.estinc.com/
(602) 470-1115 voice (602) 470-1116 fax
From | Date | Subject | |
---|---|---|---|
Next Message | Don Baccus | 2000-04-04 00:43:51 | Re: Problem with view |
Previous Message | Tom Lane | 2000-04-03 21:42:44 | Re: Problem with view |