Re: [HACKERS] PL/pgSQL definition - Mailing list pgsql-hackers

From jwieck@debis.com (Jan Wieck)
Subject Re: [HACKERS] PL/pgSQL definition
Date
Msg-id m0zdC5s-000EBYC@orion.SAPserv.Hamburg.dsh.de
Whole thread Raw
In response to PL/pgSQL definition  ("Jose' Soares" <jose@sferacarta.com>)
List pgsql-hackers
>
> --postgresql-v6.4/src/pl/plpgsql/src/INSTALL says:
> ...
>         If you declare the language in the template1 database,
>         any subsequently created database will have PL/pgSQL
>         support installed automatically.
>
>
> --I declared PL/pgSQL in the template1 database but I have an ERROR
> message when I try to
> --use PL/pgSQL language in another database.
>
>
> ERROR:  Unrecognized language specified in a CREATE FUNCTION:
> 'plpgsql'.  Recogn
> ized languages are sql, C, internal and the created procedural
> languages.
>
> --Seems that I  must to declare PL/pgSQL in every database.
> --Any ideas?
>

    You  must declare PL/pgSQL in template1 BEFORE you create the
    other databases. At createdb time, the template1 database  is
    copied  into  the  new created database. All definitions, you
    made until then are automatically in the new db. So you could
    also  create  tables, functions and anything else you want to
    have by default in any new db.

> --Please relply to sferac@bo.nettuno.it
>
> --Jose-
>
>


Jan

--

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

pgsql-hackers by date:

Previous
From: "Jose' Soares"
Date:
Subject: PL/pgSQL definition
Next
From: Brook Milligan
Date:
Subject: include/port directory?