#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    Bucharest
    Posts
    72
    Rep Power
    11

    Question ERROR: language "plpgsql" does not exist


    When I try to create a function with
    CREATE FUNCTION x() RETURNS timestamp AS '
    <function boddy>
    ' LANGUAGE plpgsql;

    I get : ERROR: language "plpgsql" does not exist

    I use PG 7.3.1 win32 and I need to "create language plpgsql", but I don't know how?
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    Bucharest
    Posts
    72
    Rep Power
    11

    Thumbs up I found it!


    sorry, it was all in the documentation!

    1. Creata a function handler:
    CREATE FUNCTION plpgsql_call_handler() RETURNS language_handler AS
    '$libdir/plpgsql' LANGUAGE C;


    2. Create the language 'plpgsql'
    CREATE TRUSTED LANGUAGE plpgsql
    HANDLER "plpgsql_call_handler";


    3. ... and I don't know if is a god thing to :
    GRANT USAGE ON LANGUAGE plpgsql TO public;

    -----------------------
    ... again, I'm sorry. It was not my intention to abuse this forum.
    Last edited by goreXP; November 20th, 2003 at 08:50 AM.

IMN logo majestic logo threadwatch logo seochat tools logo