pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
rename a cluster
10+ messages / 5 participants
[nested] [flat]

* rename a cluster
@ 2007-02-15 17:19  Ray Stell <stellr@cns.vt.edu>
  0 siblings, 1 reply; 10+ messages in thread

From: Ray Stell @ 2007-02-15 17:19 UTC (permalink / raw)
  To: pgsql-admin

Is there a method to rename a cluster? 



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

* Re: rename a cluster
@ 2007-02-15 17:36  Peter Eisentraut <peter_e@gmx.net>
  parent: Ray Stell <stellr@cns.vt.edu>
  0 siblings, 1 reply; 10+ messages in thread

From: Peter Eisentraut @ 2007-02-15 17:36 UTC (permalink / raw)
  To: pgsql-admin; +Cc: Ray Stell <stellr@cns.vt.edu>

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/



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

* Re: rename a cluster
@ 2007-02-15 18:01  Ray Stell <stellr@cns.vt.edu>
  parent: Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 2 replies; 10+ messages in thread

From: Ray Stell @ 2007-02-15 18:01 UTC (permalink / raw)
  To: Peter Eisentraut <peter_e@gmx.net>; +Cc: pgsql-admin

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.



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

* Re: rename a cluster
@ 2007-02-15 18:21  Andy Shellam (Mailing Lists) <andy.shellam-lists@mailnetwork.co.uk>
  parent: Ray Stell <stellr@cns.vt.edu>
  1 sibling, 1 reply; 10+ messages in thread

From: Andy Shellam (Mailing Lists) @ 2007-02-15 18:21 UTC (permalink / raw)
  To: Ray Stell <stellr@cns.vt.edu>; +Cc: pgsql-admin

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

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

* Re: rename a cluster
@ 2007-02-15 18:31  Peter Eisentraut <peter_e@gmx.net>
  parent: Ray Stell <stellr@cns.vt.edu>
  1 sibling, 1 reply; 10+ messages in thread

From: Peter Eisentraut @ 2007-02-15 18:31 UTC (permalink / raw)
  To: Ray Stell <stellr@cns.vt.edu>; +Cc: pgsql-admin

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/



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

* Re: rename a cluster
@ 2007-02-15 18:31  Ray Stell <stellr@cns.vt.edu>
  parent: Andy Shellam (Mailing Lists) <andy.shellam-lists@mailnetwork.co.uk>
  0 siblings, 1 reply; 10+ messages in thread

From: Ray Stell @ 2007-02-15 18:31 UTC (permalink / raw)
  To: Andy Shellam (Mailing Lists) <andy.shellam-lists@mailnetwork.co.uk>; +Cc: pgsql-admin


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.



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

* Re: rename a cluster
@ 2007-02-15 18:34  Andy Shellam (Mailing Lists) <andy.shellam-lists@mailnetwork.co.uk>
  parent: Ray Stell <stellr@cns.vt.edu>
  0 siblings, 0 replies; 10+ messages in thread

From: Andy Shellam (Mailing Lists) @ 2007-02-15 18:34 UTC (permalink / raw)
  To: Ray Stell <stellr@cns.vt.edu>; +Cc: pgsql-admin

It comes under Server Startup:

http://www.postgresql.org/docs/8.2/static/server-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.
>>     



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

* Re: rename a cluster
@ 2007-02-16 21:35  Bruce Momjian <bruce@momjian.us>
  parent: Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 2 replies; 10+ messages in thread

From: Bruce Momjian @ 2007-02-16 21:35 UTC (permalink / raw)
  To: Peter Eisentraut <peter_e@gmx.net>; +Cc: Ray Stell <stellr@cns.vt.edu>; pgsql-admin

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



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

* Re: rename a cluster
@ 2007-02-16 21:58  Ray Stell <stellr@cns.vt.edu>
  parent: Bruce Momjian <bruce@momjian.us>
  1 sibling, 0 replies; 10+ messages in thread

From: Ray Stell @ 2007-02-16 21:58 UTC (permalink / raw)
  To: Bruce Momjian <bruce@momjian.us>; +Cc: Peter Eisentraut <peter_e@gmx.net>; pgsql-admin

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



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

* Re: rename a cluster
@ 2007-02-16 23:57  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Bruce Momjian <bruce@momjian.us>
  1 sibling, 0 replies; 10+ messages in thread

From: Tom Lane @ 2007-02-16 23:57 UTC (permalink / raw)
  To: Bruce Momjian <bruce@momjian.us>; +Cc: Peter Eisentraut <peter_e@gmx.net>; Ray Stell <stellr@cns.vt.edu>; pgsql-admin

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



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


end of thread, other threads:[~2007-02-16 23:57 UTC | newest]

Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-02-15 17:19 rename a cluster Ray Stell <stellr@cns.vt.edu>
2007-02-15 17:36 ` Peter Eisentraut <peter_e@gmx.net>
2007-02-15 18:01   ` Ray Stell <stellr@cns.vt.edu>
2007-02-15 18:21     ` Andy Shellam (Mailing Lists) <andy.shellam-lists@mailnetwork.co.uk>
2007-02-15 18:31       ` Ray Stell <stellr@cns.vt.edu>
2007-02-15 18:34         ` Andy Shellam (Mailing Lists) <andy.shellam-lists@mailnetwork.co.uk>
2007-02-15 18:31     ` Peter Eisentraut <peter_e@gmx.net>
2007-02-16 21:35       ` Bruce Momjian <bruce@momjian.us>
2007-02-16 21:58         ` Ray Stell <stellr@cns.vt.edu>
2007-02-16 23:57         ` Tom Lane <tgl@sss.pgh.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