Midwest Online <mo@midwestonline.com> writes:
> Connection was unsuccessful...
> Error message returned: fe_setauthsvc: invalid name: , ignoring...
> Anybody have any clue why this happens, or what it means? Better yet,
> anybody know how to fix it?
The error message is pretty much useless --- it looks like the actual
error is being overwritten thanks to a bug in PgConnection::Connect().
You might try diking out the last seven lines of that routine (it's
in src/interfaces/libpq++/pgconnection.cc) and seeing if you get a
more useful message.
My guess is that the execution environment is different for your CGI
program, with respect to either username or lack of one of the
environment variables that libpq pays attention to (PGPORT, etc).
Another possibility is that the database server sees the connection
as being made from a different IP address than what you get from the
command line (I dunno enough about "virtual web servers" to know if that
would happen, but it seems possible), and the IP address is not one of
those listed as permitted to connect in the server's host authentication
file.
BTW, hackers: when I looked into pgconnection.cc, I was astonished
and dismayed by the number of instantly visible bugs. This code is in
*horrible* shape --- it's amazing it works at all. Someone is going to
have to adopt libpq++ and give it a close going-over.
regards, tom lane