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 ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 |
| |||
| 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 |
| |||
| 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 |
| |||
| 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 |
| |||
| 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 |
| |||
| 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 |
| |||
| 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 |
| |||
| 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 |
| |||
| 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 |
| ||||
| 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 |