From wweng@kencast.com Thu Jan 23 23:16:11 2003 Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 450D84777A5 for ; Thu, 23 Jan 2003 18:16:11 -0500 (EST) Received: from mta5.snet.net (mta5.snet.net [204.60.203.77]) by postgresql.org (Postfix) with ESMTP id 1615F477519 for ; Thu, 23 Jan 2003 17:01:41 -0500 (EST) Received: from pop.snet.net (pop.snet.net [204.60.203.72]) by mta5.snet.net (8.12.3/8.12.3/SNET-mx-1.2/D-1.1.1.1/O-1.1.1.1) with ESMTP id h0NLwDlh021392 for ; Thu, 23 Jan 2003 16:58:14 -0500 (EST) X-Originating-IP: [64.252.95.167] X-SBCIS-MTA: [pop.snet.net] Received: from monet (167.95.252.64.snet.net [64.252.95.167]) by pop.snet.net (8.12.3/8.12.3/SNET-pop-1.2/D-1.1.1.1/O-1.1.1.1) with SMTP id h0NM1TgM028366 for ; Thu, 23 Jan 2003 17:01:30 -0500 (EST) Message-ID: <000c01c2c32b$09526500$5301a8c0@monet> From: "Wei Weng" To: Subject: Rename database? Date: Thu, 23 Jan 2003 17:01:51 -0500 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0009_01C2C301.1FA1DB80" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/374 X-Sequence-Number: 11239 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
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-- From GPatnude@adelphia.net Fri Jan 24 05:26:27 2003 Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 3306B47739D for ; Fri, 24 Jan 2003 00:26:27 -0500 (EST) Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id C706D475E4A for ; Thu, 23 Jan 2003 22:40:14 -0500 (EST) Received: by news.hub.org (Postfix, from userid 8) id AFAB443A439; Thu, 23 Jan 2003 22:40:14 -0500 (EST) From: "codeWarrior" X-Newsgroups: comp.databases.postgresql.sql Subject: Re: Rename database? Date: Thu, 23 Jan 2003 19:47:24 -0800 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 56 Message-ID: References: <000c01c2c32b$09526500$5301a8c0@monet> Reply-To: "codeWarrior" X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 To: pgsql-sql@postgresql.org X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/466 X-Sequence-Number: 11331 No. Try instead CREATE DATABASE newname FROM TEMPLATE oldname; DROP DATABASE oldname; ""Wei Weng"" 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 > > > > 2"> > > > > >
Can I use a SQL statement to rename database? IV> >
 
>
e.g Rename Database Bank to Database Bank_backup= >
>
 
>
Thanks!
>
 
>
Wei
>
 
> > ------=_NextPart_000_0009_01C2C301.1FA1DB80-- > From pgman@candle.pha.pa.us Mon Jan 27 18:41:47 2003 Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 69D10476B49 for ; Mon, 27 Jan 2003 13:41:47 -0500 (EST) Received: from candle.pha.pa.us (momjian.navpoint.com [207.106.42.251]) by postgresql.org (Postfix) with ESMTP id 46A86476B30 for ; Mon, 27 Jan 2003 13:41:18 -0500 (EST) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id h0RIfBc16053; Mon, 27 Jan 2003 13:41:11 -0500 (EST) From: Bruce Momjian Message-Id: <200301271841.h0RIfBc16053@candle.pha.pa.us> Subject: Re: Rename database? In-Reply-To: <000c01c2c32b$09526500$5301a8c0@monet> To: Wei Weng Date: Mon, 27 Jan 2003 13:41:11 -0500 (EST) Cc: pgsql-sql@postgresql.org X-Mailer: ELM [version 2.4ME+ PL99 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/421 X-Sequence-Number: 11286 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