pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Rename database?
3+ messages / 3 participants
[nested] [flat]

* Rename database?
@ 2003-01-23 22:01  Wei Weng <wweng@kencast.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Wei Weng @ 2003-01-23 22:01 UTC (permalink / raw)
  To: pgsql-sql

Can I use a SQL statement to rename database?

e.g Rename Database Bank to Database Bank_backup

Thanks!

Wei

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

* Re: Rename database?
@ 2003-01-24 03:47  codeWarrior <GPatnude@adelphia.net>
  parent: Wei Weng <wweng@kencast.com>
  1 sibling, 0 replies; 3+ messages in thread

From: codeWarrior @ 2003-01-24 03:47 UTC (permalink / raw)
  To: pgsql-sql

No.

Try instead

CREATE DATABASE newname FROM TEMPLATE oldname;
DROP DATABASE oldname;


""Wei Weng"" <wweng@kencast.com> wrote in message
news:000c01c2c32b$09526500$5301a8c0@monet...
> This is a multi-part message in MIME format.
>
> ------=_NextPart_000_0009_01C2C301.1FA1DB80
> Content-Type: text/plain;
> charset="Windows-1252"
> Content-Transfer-Encoding: quoted-printable
>
> Can I use a SQL statement to rename database?
>
> e.g Rename Database Bank to Database Bank_backup
>
> Thanks!
>
> Wei
>
> ------=_NextPart_000_0009_01C2C301.1FA1DB80
> Content-Type: text/html;
> charset="Windows-1252"
> Content-Transfer-Encoding: quoted-printable
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD>
> <META http-equiv=3DContent-Type content=3D"text/html;
charset=3Dwindows-125=
> 2">
> <META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR>
> <STYLE></STYLE>
> </HEAD>
> <BODY bgColor=3D#ffffff>
> <DIV><FONT size=3D2>Can I use a SQL statement to rename
database?</FONT></D=
> IV>
> <DIV><FONT size=3D2></FONT>&nbsp;</DIV>
> <DIV><FONT size=3D2>e.g Rename Database Bank to Database
Bank_backup</FONT>=
> </DIV>
> <DIV><FONT size=3D2></FONT>&nbsp;</DIV>
> <DIV><FONT size=3D2>Thanks!</FONT></DIV>
> <DIV><FONT size=3D2></FONT>&nbsp;</DIV>
> <DIV><FONT size=3D2>Wei</FONT></DIV>
> <DIV>&nbsp;</DIV></BODY></HTML>
>
> ------=_NextPart_000_0009_01C2C301.1FA1DB80--
>





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

* Re: Rename database?
@ 2003-01-27 18:41  Bruce Momjian <pgman@candle.pha.pa.us>
  parent: Wei Weng <wweng@kencast.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Bruce Momjian @ 2003-01-27 18:41 UTC (permalink / raw)
  To: Wei Weng <wweng@kencast.com>; +Cc: pgsql-sql


Uh, we have ALTER DATABASE, but it doesn't rename.  If no one is
connected, you can connect to template1 and modify pg_database table to
rename.  That _should_ work.

---------------------------------------------------------------------------

Wei Weng wrote:
> Can I use a SQL statement to rename database?
> 
> e.g Rename Database Bank to Database Bank_backup
> 
> Thanks!
> 
> Wei

-- 
  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



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


end of thread, other threads:[~2003-01-27 18:41 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-01-23 22:01 Rename database? Wei Weng <wweng@kencast.com>
2003-01-24 03:47 ` codeWarrior <GPatnude@adelphia.net>
2003-01-27 18:41 ` Bruce Momjian <pgman@candle.pha.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