plpython function problem workaround - Mailing list pgsql-general

From Sim Zacks
Subject plpython function problem workaround
Date
Msg-id d140ko$89$1@news.hub.org
Whole thread Raw
Responses Re: plpython function problem workaround
List pgsql-general
I worked around the plpython problem that doesn't allow scripts created on
Windows to be run on the *nix server with the following statement.
    update pg_proc set prosrc=replace(prosrc,chr(13),'') where prolang=87238
--plpythonu's oid in my setup is 87238. I don't know if that is a standard
or just on mine.

Is there a way to automate that script every time a plpythonu function is
created?
I tried writing a trigger on the pg_proc table but it wouldn't let me:
    ERROR:  permission denied: "pg_proc" is a system catalog
Is there a way to do this without playing with the source code?

CREATE FUNCTION fixpython() RETURNS trigger AS $$
BEGIN
        IF new.prolang=87238 THEN
            new.prosrc=replace(prosrc,chr(13),'');
        END IF;
end
$$ LANGUAGE 'plpgsql';

CREATE TRIGGER fixpython BEFORE INSERT OR UPDATE ON pg_proc
    FOR EACH ROW EXECUTE PROCEDURE fixpython();



pgsql-general by date:

Previous
From: Miroslav Šulc
Date:
Subject: Re: prelimiary performance comparison pgsql vs mysql
Next
From: Michael Fuhr
Date:
Subject: Re: pg_restore: [custom archiver] could not uncompress data: incorrect data check