Re: Scripting a new db server setup

From: bpalmer <bpalmer(at)crimelabs(dot)net>
To: A E <cooljoint(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Scripting a new db server setup
Date: 2004-01-04 16:24:33
Message-ID: Pine.BSO.4.58.0401041122540.1679@psidion.crimelabs.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Was wondering if there are ways to completely script a new postgresql installation. I need to be able to create the db, users, and db elements from one command so that I can included it in a setup routine.

That's rather easy.

A shell script can do roughly the following:

- initdb somewhere
- start PG
- run 'psql template1 < myload.sql'

The myload.sql would connect to template1, do a "createdb newdbname" and
start creating tables, etc.

Almost the same concept as doing a restore from a pg_dumpall.

- Brandon

----------------------------------------------------------------------------
c: 917-697-8665 h: 201-435-6226
b. palmer, bpalmer(at)crimelabs(dot)net pgp:crimelabs.net/bpalmer.pgp5

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dave Cramer 2004-01-04 16:55:31 Re: website doc search is extremely SLOW
Previous Message Keith C. Perry 2004-01-04 16:17:24 Re: TPC-C and Postgres