Skip site navigation (1) Skip section navigation (2)

Re: renaming a db

From: jik(at)foxinternet(dot)net
To: psql <pgsql-novice(at)postgresql(dot)org>
Subject: Re: renaming a db
Date: 2001-09-03 20:27:51
Message-ID: 3B93E7C7.4E58CA75@foxinternet.net (view raw or flat)
Thread:
Lists: pgsql-novice
Tom Lane wrote:
> 
> jik(at)foxinternet(dot)net writes:
> > I have a feeling I can't do it, but is there a way to rename a dB?
> 
> In 7.1 or later I think it would work to just UPDATE the db's row in
> pg_database.  But don't blame me if this fails to work ... make a
> backup before you try it.
> 
>                         regards, tom lane

Doesn't look like that works....you ruined my database, I bet they fire
me :P

jik-=# UPDATE pg_database SET datname='test34' WHERE datname='test2';
UPDATE 1
jik-=# \c test34
FATAL 1:  Database "test34" does not exist in the system catalog.
Previous connection kept

In response to

Responses

pgsql-novice by date

Next:From: Tom LaneDate: 2001-09-03 21:35:41
Subject: Re: renaming a db
Previous:From: Tom LaneDate: 2001-09-03 20:11:32
Subject: Re: renaming a db

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group