Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

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.

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
add comment

Your Answer

 
discard

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.