Re: creating a function in psql

Поиск
Список
Период
Сортировка
От Julie Hunt
Тема Re: creating a function in psql
Дата
Msg-id 38EAC8EF.7402ED85@chac.qld.edu.au
обсуждение исходный текст
Ответ на creating a function in psql  (rachel cox <rachel@kiwiconsulting.com>)
Список pgsql-general
Hi
I've just done the very same thing today and found how to add plpgsql
into the pg_languages.
Firstly I located where plpgsql was on our server.
In that directory there was a file called install which gives
instructions using make file and then adding the language to your
pg_language table.
It also gives instructions on how to add it to the template1 so all
created databases will include the language.
I found that I didn't need to use makefile and was able to just do the
psql dbname <mklang.sql

This was the instruction and location of our plpgsql:-

psql test
</usr/ports/databases/postgresql/work/postgresql-6.5.2/src/pl/plpgsql/src/mklang.sql

Once this is created successfully, then you can write the functions
using plpgsql.

Hope this helps

Regards,
Julie

rachel cox wrote:

> hi,
>
> i'm trying to create a very basic function in psql and i keep getting
> the error:
> QUERY: CREATE FUNCTION add_one () RETURNS int4 AS '
>     BEGIN
>         RETURN 1 + 1;
>     END;
> ' LANGUAGE 'plpgsql';
> ERROR:  Unrecognized language specified in a CREATE FUNCTION:
> 'plpgsql'.  Recognized languages are sql, C, internal and the created
> procedural languages.
>
> does anyone know how i can get this language to be recognized?
>
> also, this is probably related, i was trying to set the date string
> using
> SET DATESTYLE
>
> and it doesn't seem to know what i'm talking about.
>
> can anyone help??? thanks so much in advance,
>
> rachel


В списке pgsql-general по дате отправления:

Предыдущее
От: "Bruce Bantos"
Дата:
Сообщение: startup / shutdown scripts for *BSD?
Следующее
От: Julie Hunt
Дата:
Сообщение: Re: creating a function in psql