Re: Rename database?

From: "codeWarrior" <GPatnude(at)adelphia(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Rename database?
Date: 2003-01-24 03:47:24
Message-ID: b0qcit$1vpv$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

No.

Try instead

CREATE DATABASE newname FROM TEMPLATE oldname;
DROP DATABASE oldname;

""Wei Weng"" <wweng(at)kencast(dot)com> wrote in message
news:000c01c2c32b$09526500$5301a8c0(at)monet(dot)(dot)(dot)
> 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--
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Roberto Mello 2003-01-24 03:52:41 Re: SQL to list databases?
Previous Message Horst Herb 2003-01-24 02:58:14 Re: SQL to list databases?