PHP:
<?php
$c = pg_connect("user=derek dbname=webcalendar");
?>
which produces this error in the browser:
Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: IDENT
authentication failed for user "derek" .
in /home/derek/public_html/misc/testpg.php4 on line 3
And yet, from the command line, it works OK:
psql -U derek -d webcalendar
Welcome to psql 7.4.2, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit
webcalendar=# \dt
List of relations
Schema | Name | Type | Owner
--------+--------------------------+-------+-------
public | webcal_asst | table | derek
public | webcal_categories | table | derek
public | webcal_config | table | derek
....
There is no password to access this DB, but adding password='' to the
connection string didn't help. The postgresql error log contains the
message: '2004-10-18 13:47:26 FATAL: IDENT authentication failed for user
"derek"'.
Can anyone tell me what I'm doing wrong?