Archive

Archive for the ‘PostgreSQL’ Category

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?

Use the below commands to create a language for a specific Database.

createlang -l

createlang -d dbname plpgsql

Other options are: –

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";

GRANT USAGE ON LANGUAGE plpgsql TO public;

Categories: PostgreSQL Tags: