Re: Another Data directory for second database -

Поиск
Список
Период
Сортировка
От Tomeh, Husam
Тема Re: Another Data directory for second database -
Дата
Msg-id C45835824D00A844BBD0F032D5CDED920116DA57@pisgana01sxch01.ana.firstamdata.com
обсуждение исходный текст
Список pgsql-admin
Thanks for the feedback. I have tried this way and seems to be working
just fine. For this approach, I have a postmaster for each databases,
correct?

The approach that another gentleman pointed out is the use of
alternative location where it actually uses one postmaster and creates a
symbolic link in the default base directory (using initlocation).

Both are great options and I think for my specific situation, I'd go
with your way, since it'll allow me more flexibility on maintaining the
different databases. I can shutdown one postmaster for maintenance for
instance, without affecting the other database.


--
 Husam


-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Chris Browne
Sent: Friday, April 22, 2005 11:44 AM
To: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Another Data directory for second database -
feasible?

htomeh@firstam.com ("Tomeh, Husam") writes:
> I have a postgres installation with one database on a server. I'd need

> to create another database; however, I'm curious if there's a way to
> create the second database in a different directory than the existing
> one. Is that feasible and how? Or does postgres only point to one data

> directory?  Thanks in advance.

We have plenty of servers with multiple databases, handled in just this
fashion.

At the simplest level, it involves running initdb three times, on three
directories:

$ initdb -D /opt/DB1
$ initdb -D /opt/DB2
$ initdb -D /opt/DB3
$ vi /opt/DB?/postgresql.conf
[change port numbers for each]
$ for db in 1 2 3; do
  pg_ctl -D /opt/DB$db start
done

You probably want to set up some set of "init" scripts that manage
telling the instances where to stow log files and such, and which can be
auto-started upon system bootup.

One of my coworkers has built a really nice init script that's good at
building the directory structure where the DBs will be stowed, hence...

$ vi init_db3.sh
[modify config]
$ ./init_db3.sh mkdir
[builds directory structure]
$ ./init_db3.sh initdb
[runs initdb for you]
$ ./init_db3.sh start

At one point, he was trying to come up with a way of releasing it to the
community; hopefully poking Drew can lead to that coming available,
someday...
--
(format nil "~S@~S" "cbbrowne" "acm.org")
http://www.ntlug.org/~cbbrowne/sap.html
Rules of the Evil Overlord #78.  "I will not tell my Legions of Terror
"And he must  be taken alive!" The command will be:  ``And try to take
him alive if it is reasonably practical.''"
<http://www.eviloverlord.com/>

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

**********************************************************************
This message contains confidential information intended only for the
use of the addressee(s) named above and may contain information that
is legally privileged.  If you are not the addressee, or the person
responsible for delivering it to the addressee, you are hereby
notified that reading, disseminating, distributing or copying this
message is strictly prohibited.  If you have received this message by
mistake, please immediately notify us by replying to the message and
delete the original message immediately thereafter.

Thank you.                                       FADLD Tag
**********************************************************************


В списке pgsql-admin по дате отправления:

Предыдущее
От: Michelle Konzack
Дата:
Сообщение: Re: Another Data directory for second database - feasible?
Следующее
От: "Ryan J. Cavicchioni"
Дата:
Сообщение: Re: UNSUSCRIBE