Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|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
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 for more information.

share|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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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