Kostadin Solakov wrote:
Anyway I managed to connect to localhost, but after I made changes to
pg_connect and I removed the host name
FROM

   1. pg_pconnect("host=localhost dbname=mydb user=myuser
password=mypassword");

TO

   1. pg_pconnect("dbname=mydb user=myuser password=mypassword");


Now it works, but VERY SLOWER than before.
One of the scripts I'm running on the previous host took below 2 sec for
1000 entries and now it takes 1 sec for 100 entries.

thats odd, as a domain socket should be slightly -faster- than a tcp/ip socket. now, since you say 'previous host' I could wonder if other configuration items are impacting this, such as buffer sizes in postgresql.conf, relative speed of disk controllers, etc. or perhaps this new database hasn't been analyzed since it was populated, or its indexes need rebuilding, or something similar...


working pg_hba.conf looks like this:

   1. # IPv4 local connections:
   2.  local   all         all                               trust
   3.  local   all         my_user                          ident sameuser
   4.  local my_db my_user password
line 2 masks lines 3,4 as it accepts any connection to any database over 'local' (unix domain socket), so it would never bother to try the others.


   5.  host my_db my_user 0.0.0.0/0 password

that line would allow anyone anywhere (assuming listen_address = '*' in postgresql.conf, and no firewalls intervene) to connect as myuser to mydb with a password





--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to