Unix Technical Forum

rename a cluster

This is a discussion on rename a cluster within the pgsql Admins forums, part of the PostgreSQL category; --> Is there a method to rename a cluster? ---------------------------(end of broadcast)--------------------------- TIP 7: You can help support the PostgreSQL ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Admins

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 08:13 AM
Ray Stell
 
Posts: n/a
Default rename a cluster

Is there a method to rename a cluster?

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 08:13 AM
Peter Eisentraut
 
Posts: n/a
Default Re: rename a cluster

Ray Stell wrote:
> Is there a method to rename a cluster?


Clusters don't have names in the first place.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 08:13 AM
Ray Stell
 
Posts: n/a
Default Re: rename a cluster

On Thu, Feb 15, 2007 at 06:36:23PM +0100, Peter Eisentraut wrote:
> Ray Stell wrote:
> > Is there a method to rename a cluster?

>
> Clusters don't have names in the first place.


So, from 16.2 "Creating a Database Cluster"

"...you must initialize a database storage area on disk.
We call this a database cluster."

then, directory = cluster, no?

What I was trying to get at is, is mv of the dir ok or
is there something else that needs to be considered? Thx.

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-10-2008, 08:13 AM
Andy Shellam
 
Posts: n/a
Default Re: rename a cluster

The cluster's "name" is only the file-system's directory path.

You can easily rename this directory, as long as you pass the relevant
directory name to pg_ctl's -D parameter (which tells PostgreSQL which
database "cluster" to use.)

It goes without saying, don't move the directory while PostgreSQL is
running.


Ray Stell wrote:
> On Thu, Feb 15, 2007 at 06:36:23PM +0100, Peter Eisentraut wrote:
>
>> Ray Stell wrote:
>>
>>> Is there a method to rename a cluster?
>>>

>> Clusters don't have names in the first place.
>>

>
> So, from 16.2 "Creating a Database Cluster"
>
> "...you must initialize a database storage area on disk.
> We call this a database cluster."
>
> then, directory = cluster, no?
>
> What I was trying to get at is, is mv of the dir ok or
> is there something else that needs to be considered? Thx.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>
> !DSPAM:37,45d4a11118511420134615!
>
>
>



--
Andy Shellam
NetServe Support Team

the Mail Network
"an alternative in a standardised world"

p: +44 (0) 121 288 0832/0839
m: +44 (0) 7818 000834


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-10-2008, 08:13 AM
Peter Eisentraut
 
Posts: n/a
Default Re: rename a cluster

Ray Stell wrote:
> What I was trying to get at is, is mv of the dir ok or
> is there something else that needs to be considered? Thx.


Renaming the directory is OK. Just make sure your init script or
whatever finds it.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-10-2008, 08:13 AM
Ray Stell
 
Posts: n/a
Default Re: rename a cluster


Many thx. It that in the doc?


On Thu, Feb 15, 2007 at 06:21:05PM +0000, Andy Shellam (Mailing Lists) wrote:
> The cluster's "name" is only the file-system's directory path.
>
> You can easily rename this directory, as long as you pass the relevant
> directory name to pg_ctl's -D parameter (which tells PostgreSQL which
> database "cluster" to use.)
>
> It goes without saying, don't move the directory while PostgreSQL is
> running.
>
>
> Ray Stell wrote:
> >On Thu, Feb 15, 2007 at 06:36:23PM +0100, Peter Eisentraut wrote:
> >
> >>Ray Stell wrote:
> >>
> >>>Is there a method to rename a cluster?
> >>>
> >>Clusters don't have names in the first place.
> >>

> >
> >So, from 16.2 "Creating a Database Cluster"
> >
> >"...you must initialize a database storage area on disk.
> >We call this a database cluster."
> >
> >then, directory = cluster, no?
> >
> >What I was trying to get at is, is mv of the dir ok or
> >is there something else that needs to be considered? Thx.
> >
> >---------------------------(end of broadcast)---------------------------
> >TIP 2: Don't 'kill -9' the postmaster
> >
> >!DSPAM:37,45d4a11118511420134615!
> >
> >
> >

>
>
> --
> Andy Shellam
> NetServe Support Team
>
> the Mail Network
> "an alternative in a standardised world"
>
> p: +44 (0) 121 288 0832/0839
> m: +44 (0) 7818 000834
>


--
You have no chance to survive make your time.

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-10-2008, 08:13 AM
Andy Shellam
 
Posts: n/a
Default Re: rename a cluster

It comes under Server Startup:

http://www.postgresql.org/docs/8.2/s...ver-start.html



Ray Stell wrote:
> Many thx. It that in the doc?
>
>
> On Thu, Feb 15, 2007 at 06:21:05PM +0000, Andy Shellam (Mailing Lists) wrote:
>
>> The cluster's "name" is only the file-system's directory path.
>>
>> You can easily rename this directory, as long as you pass the relevant
>> directory name to pg_ctl's -D parameter (which tells PostgreSQL which
>> database "cluster" to use.)
>>
>> It goes without saying, don't move the directory while PostgreSQL is
>> running.
>>


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-10-2008, 08:13 AM
Bruce Momjian
 
Posts: n/a
Default Re: rename a cluster

Peter Eisentraut wrote:
> Ray Stell wrote:
> > What I was trying to get at is, is mv of the dir ok or
> > is there something else that needs to be considered? Thx.

>
> Renaming the directory is OK. Just make sure your init script or
> whatever finds it.


Oh, and make sure the postmaster isn't running when you do the rename.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 04-10-2008, 08:13 AM
Ray Stell
 
Posts: n/a
Default Re: rename a cluster

On Fri, Feb 16, 2007 at 04:35:40PM -0500, Bruce Momjian wrote:
> Peter Eisentraut wrote:
> > Renaming the directory is OK. Just make sure your init script or
> > whatever finds it.

>
> Oh, and make sure the postmaster isn't running when you do the rename.



Right, there are a few operational considerations. I think this topic
should be get documented. I didn't know if there was anything internal
from the initdb and didn't see the answer anywhere.

Really good news found here on this topic. Everyday seems to bring more good
stuff from pg-land. I go live with three more apps with pg backends in the
morning, converted from oracle, btw

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 04-10-2008, 08:13 AM
Tom Lane
 
Posts: n/a
Default Re: rename a cluster

Bruce Momjian <bruce@momjian.us> writes:
> Peter Eisentraut wrote:
>> Renaming the directory is OK. Just make sure your init script or
>> whatever finds it.


> Oh, and make sure the postmaster isn't running when you do the rename.


While that's surely good practice, I don't think it's actually critical
since 8.1 or whenever we switched the code over to
all-relative-pathnames. Part of the point of that change was to make
sure that a DBA couldn't accidentally corrupt a database by renaming it
while live.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:49 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com