Problem with PL/pgSQL

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

Problem with PL/pgSQL

От:
"Vladimir Terziev" <vlady@school.digsys.bg>
Дата:

   Hi

   I try to create the next function:

create function ttt() RETURNS OPAQUE AS '
BEGIN
RAISE EXCEPTION "Hello"
END' language 'plpgsql';

The result is:

ERROR:  Unrecognized language specified in a CREATE FUNCTION: 'plpgsql'.  
Recognized languages are sql, C, internal and the created procedural languages.

   I have postgres SQL ver. 6.5.2. 

   What's going on?
Vladimir





Re: [SQL] Problem with PL/pgSQL

От:
Vince Gonzalez <vince@nycrc.net>
Дата:
On Tue, Feb 08, 2000 at 03:46:14PM +0200, Vladimir Terziev wrote:
>     I try to create the next function:

> The result is:
> ERROR:  Unrecognized language specified in a CREATE FUNCTION: 'plpgsql'.  
> Recognized languages are sql, C, internal and the created procedural languages.

You need to do createlang on the table, like so:

$ createlang plpgsql test

Where test is the database.

--vince

Re: [SQL] Problem with PL/pgSQL

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
"Vladimir Terziev"  writes:
> ERROR:  Unrecognized language specified in a CREATE FUNCTION: 'plpgsql'.  
>     What's going on?

You didn't install plpgsql into your database.  It's optional (just
in case a dbadmin doesn't want it available for some reason).
See the createlang script.
		regards, tom lane

Re: [SQL] Problem with PL/pgSQL

От:
wieck@debis.com (Jan Wieck)
Дата:
>
>
>     Hi
>
>
>     I try to create the next function:
>
> create function ttt() RETURNS OPAQUE AS '
> BEGIN
> RAISE EXCEPTION "Hello"
> END' language 'plpgsql';
>
> The result is:
>
> ERROR:  Unrecognized language specified in a CREATE FUNCTION: 'plpgsql'.
> Recognized languages are sql, C, internal and the created procedural languages.
>
>
>     I have postgres SQL ver. 6.5.2.
>
>
>     What's going on?
   As  the  message  says, only the created procedural languages   can be recognized.  You haven't enabled the language  and  it   isn't installed by default.  Use
       createlang 
   to  install  it  in  your  database. If you install it in the   template1 database, than  all  subsequent  created  databases   automatically inherit this.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#========================================= wieck@debis.com (Jan Wieck) #



FAQ