Lists: | pgsql-admin |
---|
From: | "jquest jquest" <jquest_j(at)hotmail(dot)com> |
---|---|
To: | pgsql-admin(at)postgresql(dot)org |
Subject: | Trigger problem |
Date: | 2002-05-03 11:17:38 |
Message-ID: | F1865G5skRBzRsx6Eyj00009c24@hotmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-admin |
Hi,
I am new to postgresql and to this moment I am using oracle.
I use posgresql 7.1.2
I try to create very simple ( from doc. examples ) trigger:
CREATE FUNCTION add_one (integer) RETURNS INTEGER AS '
BEGIN
RETURN $1 + 1;
END;
' LANGUAGE 'pgsql';
But the system report:
ERROR: Unrecognized language specified in a CREATE FUNCTION: 'pgsql'.
Recognized languages are sql, C, internal, and created procedural
languages.
I readet in documentation that pgsql is good solution for SP.
Where is the problem?
Many thanks in advance.
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com
From: | Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com> |
---|---|
To: | jquest jquest <jquest_j(at)hotmail(dot)com> |
Cc: | <pgsql-admin(at)postgresql(dot)org> |
Subject: | Re: Trigger problem |
Date: | 2002-05-03 15:57:54 |
Message-ID: | 20020503085607.R67939-100000@megazone23.bigpanda.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-admin |
On Fri, 3 May 2002, jquest jquest wrote:
> Hi,
> I am new to postgresql and to this moment I am using oracle.
> I use posgresql 7.1.2
>
> I try to create very simple ( from doc. examples ) trigger:
>
> CREATE FUNCTION add_one (integer) RETURNS INTEGER AS '
> BEGIN
> RETURN $1 + 1;
> END;
> ' LANGUAGE 'pgsql';
>
> But the system report:
> ERROR: Unrecognized language specified in a CREATE FUNCTION: 'pgsql'.
> Recognized languages are sql, C, internal, and created procedural
> languages.
>
> I readet in documentation that pgsql is good solution for SP.
>
> Where is the problem?
You'll want to use 'plpgsql' which is the full name of the procedural
language. If it still fails, it means that createlang was not used on
the database, and you'll want to issue a
createlang plpgsql <database>
as the postgres user from a shell.
From: | Aaron Spiteri <aaron(at)m1group(dot)com(dot)au> |
---|---|
To: | jquest jquest <jquest_j(at)hotmail(dot)com>, pgsql-admin(at)postgresql(dot)org |
Subject: | Re: Trigger problem |
Date: | 2002-05-05 22:29:10 |
Message-ID: | 20020505.22291000@scooby.m1group.com.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-admin |
In postgres you the plsql equivalent is 'plpgsql' not 'plsql'.
>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<
On 3/05/02, 21:17:38, "jquest jquest" <jquest_j(at)hotmail(dot)com> wrote
regarding [ADMIN] Trigger problem:
> Hi,
> I am new to postgresql and to this moment I am using oracle.
> I use posgresql 7.1.2
> I try to create very simple ( from doc. examples ) trigger:
> CREATE FUNCTION add_one (integer) RETURNS INTEGER AS '
> BEGIN
> RETURN $1 + 1;
> END;
> ' LANGUAGE 'pgsql';
> But the system report:
> ERROR: Unrecognized language specified in a CREATE FUNCTION: 'pgsql'.
> Recognized languages are sql, C, internal, and created procedural
> languages.
> I readet in documentation that pgsql is good solution for SP.
> Where is the problem?
> Many thanks in advance.
> _________________________________________________________________
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)