scott.marlowe wrote:
> On 27 Feb 2003, Hadley Willan wrote:
>
> > Hello,
> > I'd like to rename one of my databases. Is it is simple as changing
> > the datname field in the pg_databases table?
> >
> > If so, is it done through ALTER database or a SQL update?
>
> The way I do it is:
>
> # createdb newdb
> # pg_dump olddb|psql -e newdb
> ... check to make sure it's all there working, then...
> # dropdb olddb
The coolest way I have seen it done is to do CREATE DATABASE with
TEMPLATE old_dbname, then drop the old database.
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073