-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Raphael Melo wrote: | |>If I /etc/init.d/postgresql start, it works like a charm. |> |>Note that both servers are configured to listen on tcp port 5432. So |>this is not the problem :) | | | Only one server per port. If one is running, the other is blocked. So, | change the port of the first one to 5433 or something and both | instances will run fine at the same time. |
Hmmm, I imagined that my two postgresql would give this type of interpretation :)
I run one process each time :)
I will use emerge postgresql to talk about the postgresql installed with emerge which *works*
I will use home postgresql to talk about hte postgresql which is installed in my home and started by my user which *doesn't work*.
| As for the compile from sources, did you edit the pg_hba.conf on the | folder where your database is stored? It specifies the hosts that can | connect to postgre and the authentication methods. With the sources, | it blocks almost everything by default. |
I also was pointed to that. But just to make sure, I checked both pg_hba.conf, mine from home install and from the emerge. They are both identical. I even had to edit the emerge version because after connecting, postgresql complained about no pg_hba conf for my host.
When I start my home version, I can't even stablish the connection. I don't know if postgresql can control the tcp at this level even before a client socket connect to it, so I think this may be some type of permission in socket. The issue is that I couldn't find how it is done with emerge postgresql.
| If these don't work, | | # netstat -anp | grep tcp | | and you'll see what processes are listening or | | # netstat -anp | grep post | | to see if postgre or postmaster are listening on any door. |
Yeap, I can confirm that it is working. netstat -an | grep 5432 tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN unix 2 [ ACC ] STREAM LISTENING 25216 /tmp/.s.PGSQL.5432
This is from my home postgresql.
Indeed, if I try to connect in my own linux host to it, I connect without any problem.
But when I try telnet myhost 5432, I get the connection refused.
Does this make sense?
Can you shed some light?
Hmmmmmm, after doing the netstat with my home postgresql, I saw the 127.0.0.1:5432, which if I remember from my tcp classes that it would be only listening on 127.0.0.1 interface...
If I run the same netstat with emerge postgresql I get:
netstat -an | grep 5432 tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN unix 2 [ ACC ] STREAM LISTENING 26743 /tmp/.s.PGSQL.5432
And here I get 0.0.0.0:5432, which would mean I can connect from any interface.
Hmmm, now the question is: How do I make my postgresql listen to all?
Ok, ok, nevermind....
after some checking on postgresql config files, I found the following:
home postgresql 8.0.0:
#listen_addresses = 'localhost' # what IP interface(s) to listen on; ~ # defaults to localhost, '*' = any
emerge postgresql 7.4.2: #virtual_host = '' # what interface to listen on; defaults to any
And after doing the correct configuration.....
Voilą!! It worked!!!
Thank you very much all for your help!
- -- Regards,
Francisco Figueiredo Jr. Membro Fundador do Projeto MonoBrasil - MonoBrasil Project Founder Member http://monobrasil.softwarelivre.org
- ------------- "Science without religion is lame; religion without science is blind."
~ ~ Albert Einstein -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iQEVAwUBQh/kBf7iFmsNzeXfAQKJfggAkbmuaEdug3kVfV4Qw+E6S3xTtPAscYXx 9qWZZdanS01fP7IZSPgLCcZP1UInkernNSpXxDwwljaQlarbjJeUrD3/dMbEGphf F6ZxTlRTXo3Y61dRbw360Ovc9SYvdqV/BHNSNBUbQTdr5eLv5+cAGuD6sBh1u7Fx Kexo29+SXyRjtPForb99SjWj8xp5f9o4CWkBTSgu8R5hm+oPuGD94XWat30Bjia5 1plHyM7Zou4y8yS2ytoJ5vOJr0jmuFojXssoAti9csTIZoISvGwx6zqgMa8L3M7R eDEvm+UvBI5oFlicQnkkfEJe0n5ls6DgY6xaIrikk4B7gXiOrxBnGg== =aaNH -----END PGP SIGNATURE-----
-- gentoo-user@gentoo.org mailing list