|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-08-23 13:45 UTC] webmaster at touchingvirus dot net
Description: ------------ When connecting to a pgSQL server (I use 8.2) with a wrong username, password or port in the connection string, the error given is really uninformative to the user and actually suggests a problem with the postgreSQL server: "Unable to connect to PostgreSQL server: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request." The server didn't terminate & the connection was refused/aborted Expected result: ---------------- To be honest, I expected an error that was similar to that of mySQL - though I know that is because mySQL actually produces good error messages =) e.g. Access denied for: root@localhost (Using Password: YES) The psql binary errors with the expect errors like: psql: FATAL: password authentication failed for user "root" PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 04:00:02 2025 UTC |
This is because PostgreSQL library set these uninformative error message. php > $db = pg_connect('host=192.168.100.50 user=postgres password=dummy'); Warning: pg_connect(): Unable to connect to PostgreSQL server: could not connect to server: Connection refused Is the server running on host "192.168.100.50" and accepting TCP/IP connections on port 5432? in php shell code on line 1