Re: Scripting a new db server setup - Mailing list pgsql-general

From bpalmer
Subject Re: Scripting a new db server setup
Date
Msg-id Pine.BSO.4.58.0401041122540.1679@psidion.crimelabs.net
Whole thread Raw
In response to Scripting a new db server setup  (A E <cooljoint@yahoo.com>)
List 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@crimelabs.net           pgp:crimelabs.net/bpalmer.pgp5

pgsql-general by date:

Previous
From: "Keith C. Perry"
Date:
Subject: Re: TPC-C and Postgres
Next
From: Scott Ribe
Date:
Subject: Re: Scripting a new db server setup