On Wed, 2 Jul 2003, Ian Barwick wrote: > On Wednesday 02 July 2003 09:18, Daniel Seichter wrote: > > Hello, > > I want to discuss a little bit about the following situation: > > I only have one server for my databases.I had to develope on this server > > and also had to manage several databases, so I can expect problems if I had > > to restart postgreSQL, if I changed the logging..... > > What do you think about this solution: > > For each database I want to let run one server, and the different servers a > > located in > > /usr/local/pgsql-733-1 data-dir: /db/pgsql-1 > > /usr/local/pgsql-733-2 data....................... > > > > Is this a good idea? What problems can happen? I compile postgreSQL only > > with the --prefix flag. What things I should do? > > Each db got his own user, like postgres1, postgres2 or pgsql7331,....... > > > > I sometimes need to log everything, but this is maybe once or twice a week, > > but I can't restart the server during the day. > > You only need to compile PostgreSQL once (e.g. with > --prefix=/usr/local/pgsql-733); by supplying different data directories and > logfiles etc. on server start you can run multiple instances simultaneously > under the same system user. This can be done e.g. by passing the appropriate > parameters to pg_ctl along these lines: > > /usr/local/pgsql-733/bin/pg_ctl -D /db/pgsql-1 -l /db/pgsql-1.log > -o '-i -p 5431' start > /usr/local/pgsql-733/bin/pg_ctl -D /db/pgsql-2 -l /db/pgsql-2.log > -o '-i -p 5432' start > etc.
Note that even if you ARE going to run each cluster under a different user (I recommend running each cluster under a different user so you can do 'insane' things like let each person have C as an untrusted language and be their own superuser in a mostly sane way) you still only need to compile Postgresql only once. Unless you're going to run multiple versions you shouldn't need multiple installs / seperate --prefix switches. ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster