db rename
db rename
От:
Jodi Kanter <jkanter@virginia.edu>
Дата:
I thought there was an option to rename a database? I cannot seem to find the syntax in any of my books or on the web site. Am I incorrect? We are running 7.3.4. We have to bring our sytem down to upgrade the release this afternoon. There are a number of db changes taking place so I was thinking instead of taking the system down for an extended amount of time I could build another database with all our new items and then just rename it when we are ready.
Is there a rename option out there for our version?
thanks
Jodi
Is there a rename option out there for our version?
thanks
Jodi
--
_______________________________
Jodi L Kanter
BioInformatics Database Administrator
University of Virginia
(434) 924-2846
jkanter@virginia.edu
Re: db rename
От:
Rajesh Kumar Mallah <mallah@trade-india.com>
Дата:
Dear Jodi,
psql>\h CREATE DATABASE
Command: CREATE DATABASE
Description: create a new database
Syntax:
CREATE DATABASE name
[ [ WITH ] [ OWNER [=] dbowner ]
[ LOCATION [=] 'dbpath' ]
[ TEMPLATE [=] template ]
[ ENCODING [=] encoding ] ]
tradein_clients=#
You might consider using the TEMPLATE=template option
by default its template1 , if you put the existing database name
a replica of specified database is made
Hope it helps.
Regds
Mallah.
Jodi Kanter wrote: I thought there was an option to rename a database? I cannot seem to find the syntax in any of my books or on the web site. Am I incorrect? We are running 7.3.4. We have to bring our sytem down to upgrade the release this afternoon. There are a number of db changes taking place so I was thinking instead of taking the system down for an extended amount of time I could build another database with all our new items and then just rename it when we are ready.
Is there a rename option out there for our version?
thanks
Jodi
--
_______________________________
Jodi L Kanter
BioInformatics Database Administrator
University of Virginia
(434) 924-2846
jkanter@virginia.edu
-- regds Mallah. Rajesh Kumar Mallah +---------------------------------------------------+ | Tradeindia.com (3,11,246) Registered Users | | Indias' Leading B2B eMarketPlace | | http://www.tradeindia.com/ | +---------------------------------------------------+
Re: db rename
syntax is: update pg_database set datname= where datname=; checkpoint; HTH, Chris ------------------( Forwarded letter 1 follows )--------------------- Date: Mon, 25 Oct 2004 08:59:03 -0400 To: Postgres.Admin.List[pgsql-admin]@postgresql.org.comp From: Jodi.Kanter[jkanter]@virginia.edu.comp Sender: pgsql-admin-owner+m15321@postgresql.org.comp Subject: [ADMIN] db rename I thought there was an option to rename a database? I cannot seem to find the syntax in any of my books or on the web site. Am I incorrect? We are running 7.3.4. We have to bring our sytem down to upgrade the release this afternoon. There are a number of db changes taking place so I was thinking instead of taking the system down for an extended amount of time I could build another database with all our new items and then just rename it when we are ready. Is there a rename option out there for our version? thanks Jodi -- _______________________________ Jodi L Kanter BioInformatics Database Administrator University of Virginia (434) 924-2846 jkanter@virginia.edu
Re: db rename
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Jodi Kanter writes: > I thought there was an option to rename a database? No, but you could always do an UPDATE on pg_database. It might be a good idea to ensure there are no backends running in the target database when you do the update. (I think that recent releases wouldn't care particularly, but I'm less sure about 7.3.4.) regards, tom lane