Thread: Pgaccess doesn't connect
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello and sorry for my bad english ;-) I've a lot of problems with my postgreSQL. I use mandrake linux 9.0 with postgres 7.2.2 and i eliminated postgres user password... I logged as postgres user and i created "prova_db" database. Then i created "indirizzi" table in which i put three addresses. If i manage my postgres database as postgres user with "psql" command all works fine. Problems arrive if i do not log as postgres user but as my usual user (nathanvi). If i launch pgaccess and try to open my database as in the attached PNG my system responds in this way: "Error trying to connect to database 'prova_db' on host localhost PostgreSQL error message: Connection to database failed could not connect to server running on host localhost and accepting TCP/IP connection on port 5432?" In the same way if i try to connect to database with a PERL script with Pg module that i've attached as "prova_db_connessione2.pl" and i try to add a record, it responds: Variabile result: PG_results=SCALAR(0x804c130) What can i do? Please help me.... PS Obviusly postgreSQL is running on my server and in /etc/services i find two rows in which it declares that port 5432 is for postgres connection... ... *********************************************************************** Vittorio Zuccala' ICQ#20318568 YMess: nathanvit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE+a0t6wmoaRob4t3wRAub0AJ4jHUj3H30GNz4dnHQF9QWu5Y4ATwCfWtH9 5nr/5V12N50uSdPfdQOeiA8= =eZ+L -----END PGP SIGNATURE-----
Vittorio...... > If i manage my postgres database as postgres user with "psql" command > all works fine. > > Problems arrive if i do not log as postgres user but as my usual user > (nathanvi). The postgres user acts like the root user for the postgreSQL server, you only use it for admin things. I think you need to log into the postgers user account and CREATE USER (maybe it's create user) for nathanvi. Also I think then you'll have to make entries in pg_hba.conf to set where that user can access the db from (on the local machine, over tcp-ip, etc.). I think pgadmin requires tcp-ip access. > In the same way if i try to connect to database with a PERL script with > Pg module that i've attached as "prova_db_connessione2.pl" and i try to > add a record, it responds: Variabile result: > PG_results=SCALAR(0x804c130) Not sure but I think maybe pg_results wants to return a hash and there is a scalar (that is, a single variable) there to be returned instead. If the perl script is running as user nathanvi then you've created that user OK, maybe you just need to make the right entry in pg_hba.conf to allow tcp-ip connections from that user. Anyway, this is all detailed in the docs better than I can write it for you. brew
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Il giorno Sun, 9 Mar 2003 19:06:16 -0500 (EST), tu oh prode brew@theMode.com, picchiettando sui tasti hai scritto: > The postgres user acts like the root user for the postgreSQL server, you > only use it for admin things. I think you need to log into the postgers > user account and CREATE USER (maybe it's create user) for nathanvi. Also > I think then you'll have to make entries in pg_hba.conf to set where that > user can access the db from (on the local machine, over tcp-ip, etc.). I > think pgadmin requires tcp-ip access. Thanks for the answer. I create nathanvi user but i can't find pg_hba.conf Where is it? In my /etc directory there is a "pgsql" subdirectory in which there's only a file named odbcinst.ini. Its rows are: [PostgreSQL] Description = ODBC for PostgreSQL Driver = /usr/lib/libodbcpsql.so Setup = /usr/lib/libodbcpsqlS.so FileUsage = 1 Do you know others names of pg_hba.conf? ... ********************************************************************** The UNIX Guru's view of sex: unzip; strip; touch; finger; mount; fsck; more; yes; umount; sleep ********************************************************************** L'unica accelerazione possibile per windows: (9.81 m/s2) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE+bJvGwmoaRob4t3wRAsovAJsGW2Exf8j5CZS8IIQ1Vb6CpRTOuQCfWVI2 VJ5wtUGt/D54IzRTEUNKDjk= =wHPC -----END PGP SIGNATURE-----
> I create nathanvi user but i can't find pg_hba.conf > Where is it? > In my /etc directory there is a "pgsql" subdirectory in which there's only > a file named odbcinst.ini. Its rows are: > Do you know others names of pg_hba.conf? I'm running Debian linux...... there are two pg_hba.conf files..... /etc/postgresql/pg_hba.conf /var/lib/postgres/data/pg_hba.conf I'm not sure which one is the working conf file. Sorry I can't help more, maybe some one running your linux can better point out it's location... which one are you running again? brew ========================================================================== Strange Brew (brew@theMode.com) Check out my Musician's Online Database Exchange (The MODE Pages) http://www.TheMode.com ==========================================================================
On Mon, 10 Mar 2003 brew@theMode.com wrote: > > > I create nathanvi user but i can't find pg_hba.conf > > Where is it? > > In my /etc directory there is a "pgsql" subdirectory in which there's only > > a file named odbcinst.ini. Its rows are: > > > Do you know others names of pg_hba.conf? > > I'm running Debian linux...... there are two pg_hba.conf files..... > > /etc/postgresql/pg_hba.conf > /var/lib/postgres/data/pg_hba.conf The /var/... file is a symbollic link to the one under /etc. Gord -- Matter Realisations http://www.materialisations.com/ Gordon Haverland, B.Sc. M.Eng. President 101 9504 182 St. NW Edmonton, AB, CA T5T 3A7 780/481-8019 ghaverla @ freenet.edmonton.ab.ca 780/993-1274 (alt.)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Il giorno Mon, 10 Mar 2003 20:59:29 -0700 (MST), tu oh prode <ghaverla@freenet.edmonton.ab.ca>, picchiettando sui tasti haiscritto: > The /var/... file is a symbollic link to the one under /etc. Ok i found it. Probably my "find" command failed to search it (or probably i didn't use it well ;-) It is in /var/pgsql. Please can help me also to edit these files to accept connection from localhost and my internal lan pc (10.0.0.0/24)? Really thanks!! ... *********************************************************************** Vittorio Zuccala' ICQ#20318568 YMess: nathanvit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE+cbj1wmoaRob4t3wRAgenAJ46qIQPhhPE6dZQxQygMYW4JXBNNwCeMjDr TVX4gRV25M6Egl1dxuPpqu4= =oUzN -----END PGP SIGNATURE-----