"Reshat Sabiq" <sabiq(at)purdue(dot)edu> writes:
> P.P.P.S. The localhost-based app is running as myself on port 8080,
> whereas the non-localhost-based app is running as root on port 80.
Well, then IDENT is going to reject the connection, because the actual
Unix login name on the client side doesn't match the postgres username
you're trying to use. (There's also theory B: you don't have a working
IDENT service on the client machine at all.)
Since I cannot imagine any good reason for running a client as root when
it doesn't absolutely have to be root, my advice is to use a saner login
setup on the client: viz, run the app as postgres, or whatever userid
you want it to be for postgres purposes. Otherwise, use some different
authentication setup than "ident sameuser".
regards, tom lane