pg.ddx.io pgsql-admin@postgresql.org mailing list archivehelp / color / mirror / Atom feed
FW: 2 instances 3+ messages / 2 participants [nested] [flat]
* FW: 2 instances @ 2006-07-04 11:21 H.J. Sanders <hjs@rmax.nl> 2006-07-04 11:27 ` Re: FW: 2 instances Andy Shellam <andy@andycc.net> 0 siblings, 1 reply; 3+ messages in thread From: H.J. Sanders @ 2006-07-04 11:21 UTC (permalink / raw) To: pgsql-admin Hello. I would like to run 2 instances of postgresql with 2 different data-directories: dir-a en dir-b. Looking trough the archives I came to the next setup: I created this 2 different directories and 2 users each with a different PGDATA(dir-a and dir-b) in their .profile Using this 2 users i did twice initdb and createdb xyz with the first user. in postgresql.conf of the second directory I changed the port to 5433 and also entered this port in /etc/services and started the second postmaster, ps -f shows it is running. If I now want to create the same database xyz in the second directory using the second user, the database is already there! What am I missing? Many thanks Henk Sander ^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: FW: 2 instances 2006-07-04 11:21 FW: 2 instances H.J. Sanders <hjs@rmax.nl> @ 2006-07-04 11:27 ` Andy Shellam <andy@andycc.net> 0 siblings, 0 replies; 3+ messages in thread From: Andy Shellam @ 2006-07-04 11:27 UTC (permalink / raw) To: 'H.J. Sanders' <hjs@rmax.nl>; +Cc: pgsql-admin How are you connecting to Postgres? Note that you'll always need to give the port 5433 to connect to the second instance in any tool you use (psql, pg_dump, other management utilities etc), otherwise you'll always connect to the "default" instance on 5432. Andy _____ From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of H.J. Sanders Sent: 04 July 2006 12:22 pm To: pgsql-admin@postgresql.org Subject: [ADMIN] FW: 2 instances Hello. I would like to run 2 instances of postgresql with 2 different data-directories: dir-a en dir-b. Looking trough the archives I came to the next setup: I created this 2 different directories and 2 users each with a different PGDATA(dir-a and dir-b) in their .profile Using this 2 users i did twice initdb and createdb xyz with the first user. in postgresql.conf of the second directory I changed the port to 5433 and also entered this port in /etc/services and started the second postmaster, ps -f shows it is running. If I now want to create the same database xyz in the second directory using the second user, the database is already there! What am I missing? Many thanks Henk Sander !DSPAM:14,44aa4fb8256841932014477! ^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: FW: 2 instances @ 2006-07-04 13:27 Andy Shellam <andy@andycc.net> 0 siblings, 0 replies; 3+ messages in thread From: Andy Shellam @ 2006-07-04 13:27 UTC (permalink / raw) To: 'H.J. Sanders' <hjs@rmax.nl>; +Cc: pgsql-admin The problem you've got is that there'll always be 2 configurations - one for your "default" instance and one for your 5433 instance. I believe (I could be wrong here), that postgresql.conf is just for the server side - it's the client tools you're connecting with, so they need to know which port to connect to (of which 5432 is default, unless changed in your configure script.) You could put: PGPORT=XXXX export PGPORT in each of your user's .profile (or .bash_profile) scripts (replacing XXXX with either 5432 or 5433 dependent on which cluster you want the user to connect to.) Then the PG client tools will read that as the port number (to save putting "-p 5433" in the command line.) Regards Andy _____ From: H.J. Sanders [mailto:hjs@rmax.nl] Sent: 04 July 2006 1:54 pm To: andy@andycc.net Subject: RE: [ADMIN] FW: 2 instances Hello Andy. This does indeed the tric ( -p 5433). I expected that this port 5433 would be taken from $PGDATA/postgresql.conf Is this also possible? Many thanks Henk -----Oorspronkelijk bericht----- Van: Andy Shellam [mailto:andy@andycc.net] Verzonden: dinsdag 4 juli 2006 13:28 Aan: 'H.J. Sanders' CC: pgsql-admin@postgresql.org Onderwerp: RE: [ADMIN] FW: 2 instances How are you connecting to Postgres? Note that you'll always need to give the port 5433 to connect to the second instance in any tool you use (psql, pg_dump, other management utilities etc), otherwise you'll always connect to the "default" instance on 5432. Andy _____ From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of H.J. Sanders Sent: 04 July 2006 12:22 pm To: pgsql-admin@postgresql.org Subject: [ADMIN] FW: 2 instances Hello. I would like to run 2 instances of postgresql with 2 different data-directories: dir-a en dir-b. Looking trough the archives I came to the next setup: I created this 2 different directories and 2 users each with a different PGDATA(dir-a and dir-b) in their .profile Using this 2 users i did twice initdb and createdb xyz with the first user. in postgresql.conf of the second directory I changed the port to 5433 and also entered this port in /etc/services and started the second postmaster, ps -f shows it is running. If I now want to create the same database xyz in the second directory using the second user, the database is already there! What am I missing? Many thanks Henk Sander !DSPAM:14,44aa651c256842130418775! ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2006-07-04 13:27 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2006-07-04 11:21 FW: 2 instances H.J. Sanders <hjs@rmax.nl> 2006-07-04 11:27 ` Andy Shellam <andy@andycc.net> 2006-07-04 13:27 Re: FW: 2 instances Andy Shellam <andy@andycc.net>
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