I have two postgres database servers. Let's name that A and B respectively.

When I create a database in A, I don't have to run the following command to install a language.

createlang -U postgres plpgsql {database name}

Somehow...I have to run the above command in B.

How do I make it so that server B installs 'plpgsql' language when I create a database?

link|improve this question

@ChrisS // You're totally right. I forgot to choose an answer for all my questions...bad bad...!! – Moon Oct 27 '11 at 21:50
feedback

1 Answer

up vote 2 down vote accepted

Install the language onto the template databases. The default template-database is named template1, and is the one copied when you create new databases. Any modifications you make to this database, should appear on new databases.

Check out http://www.postgresql.org/docs/8.4/interactive/manage-ag-templatedbs.html for more information.

link|improve this answer
Note, the above answer mostly applies to pre-9.0 versions of postgres; as of 9.0 plpgsql is installed by default. – xzilla Oct 29 '11 at 14:44
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.