X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id C6AA4D1B345 for ; Wed, 26 May 2004 11:01:48 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 68697-10 for ; Wed, 26 May 2004 11:01:31 -0300 (ADT) Received: from tomts13-srv.bellnexxia.net (tomts13-srv.bellnexxia.net [209.226.175.34]) by svr1.postgresql.org (Postfix) with ESMTP id 0D736D1C952 for ; Wed, 26 May 2004 11:01:26 -0300 (ADT) Received: from acer.sympatico.ca ([65.95.163.227]) by tomts13-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20040526140129.CRTQ14150.tomts13-srv.bellnexxia.net@acer.sympatico.ca> for ; Wed, 26 May 2004 10:01:29 -0400 Message-Id: <5.2.1.1.0.20040526091656.02306cb0@pop6.sympatico.ca> X-Sender: b1wudu74@pop6.sympatico.ca X-Mailer: QUALCOMM Windows Eudora Version 5.2.1 Date: Wed, 26 May 2004 09:50:06 -0400 To: pgsql-php@postgresql.org From: Frank Bax Subject: Re: unable to connect to pgsql server In-Reply-To: References: <5.2.1.1.0.20040524141824.02d7b060@pop6.sympatico.ca> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.2 tagged_above=0.0 required=5.0 tests=RCVD_IN_NJABL, RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200405/51 X-Sequence-Number: 2770 At 01:02 PM 5/25/04, Keary Suska wrote: >on 5/24/04 2:59 PM, fbax@sympatico.ca purportedly said: > > > I couldn't figure out OpenBSD options for netstat. Do these prove the same > > thing? > > # netstat -l | grep 5432 > > 0xd187f7d8 stream 0 0 0xe8844498 0x0 0x0 0x0 > > /tmp/.s.PGSQL.5432 > >You could probably do this: ># netstat -ln | grep 5432 > >Which should show two entries--one for TCP/IP, one for Unix Domain Socket. # netstat -ln | grep 5432 tcp 0 0 192.168.1.90.29958 192.168.1.90.5432 TIME_WAIT 0xd187f7d8 stream 0 0 0xe8844498 0x0 0x0 0x0 /tmp/.s.PGSQL.5432 > > # fstat | head -n 1 ; fstat | grep 5432 > > USER CMD PID FD MOUNT INUM MODE R/W DV|SZ > > _pgsql postgres 5444 3* internet stream tcp 0xd18729dc *:5432 > >I am not familiar with this command, but it seems to be saying that you have >a listening connection on the right port. > >Some other questions: > >1) If you use the IP instead of host name, do you get the same effect? First I got error about ip not in pg_hba.conf, so I added host all all 192.168.1.90 255.255.255.255 trust - when I fixed that and rebooted, the system works!!! I then removed the above line, rebooted and tried host=127.0.0.1 in pg_connect instead of host=localhost and that works too! So why doesn't host=localhost work? >2) Have you tried not specifying a host--in which case the Unix domain >socket will be used--and does it work? It doesn't work - but different error. PHP Warning: pg_connect(): Unable to connect to PostgreSQL server: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"? in /php/class/phplib-7.4/db_pgsql.inc on line 51 I think I know what's causing this problem - apache is running with "chroot /var/www" - a change in default install sometime between OpenBSD 2.9 and 3.5 - could this also be causing the problem with tcpip socket?