Обсуждение: Help on Trugger/Function

Поиск
Список
Период
Сортировка

Help on Trugger/Function

От
Pam Wampler
Дата:
I am new to postgresql -- I am trying to create a trigger on a table --
I get this error on the function
   ERROR:  Unrecognized language specified in a CREATE FUNCTION: 'plpgsql'.
Recognized languages are sql, C, internal, and created procedural
languages.

Here is my function that I get this error on:

create function head_insert() returns OPAQUE as '
   BEGIN
   NEW.tests := 0;
   NEW.fails  := 0;
   NEW.reps  := 0;
  END;
'
LANGUAGE 'plpgsql';



Re: Help on Trugger/Function

От
Stephan Szabo
Дата:
On Thu, 14 Feb 2002, Pam Wampler wrote:

> I am new to postgresql -- I am trying to create a trigger on a table --
> I get this error on the function
>    ERROR:  Unrecognized language specified in a CREATE FUNCTION: 'plpgsql'.
> Recognized languages are sql, C, internal, and created procedural
> languages.

You'll need to use createlang to add the plpgsql language to the database
(it's not added by default).
I believe it's
createlang plpgsql <database>