pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Renaming a database
2+ messages / 2 participants
[nested] [flat]

* Renaming a database
@ 2002-07-01 15:41 Florian Weimer <Weimer@CERT.Uni-Stuttgart.DE>
  2002-07-01 17:14 ` Re: Renaming a database Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: Florian Weimer @ 2002-07-01 15:41 UTC (permalink / raw)
  To: pgsql-admin

Is there a way to rename an existing database, short of dumping and
restoring it?

-- 
Florian Weimer 	                  Weimer@CERT.Uni-Stuttgart.DE
University of Stuttgart           http://CERT.Uni-Stuttgart.DE/people/fw/
RUS-CERT                          fax +49-711-685-5898





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Renaming a database
  2002-07-01 15:41 Renaming a database Florian Weimer <Weimer@CERT.Uni-Stuttgart.DE>
@ 2002-07-01 17:14 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2002-07-01 17:14 UTC (permalink / raw)
  To: Florian Weimer <Weimer@CERT.Uni-Stuttgart.DE>; +Cc: pgsql-admin

Florian Weimer <Weimer@CERT.Uni-Stuttgart.DE> writes:
> Is there a way to rename an existing database, short of dumping and
> restoring it?

In 7.1 or later a quick UPDATE on pg_database.datname should do it,
I believe.

It might be a bad idea to do it while there are any connections to
the target database --- I know that backends remember the name of the
DB they are connected to, but I forget whether it's actually used for
anything significant.

Also, vacuuming pg_database after committing the UPDATE might be
necessary, depending on just which version you are running.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2002-07-01 17:14 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-07-01 15:41 Renaming a database Florian Weimer <Weimer@CERT.Uni-Stuttgart.DE>
2002-07-01 17:14 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox