PostgreSQL come with a user called postgres . If you want to use it with PHP, you might end up using the following from its documentation:
$dbconn2 = pg_connect("host=localhost port=5432 dbname=mary");
Bad news, it doesn't work on me.
pg_connect(): Unable to connect to PostgreSQL server: FATAL: Ident authentication failed for user
To fix the error, all you need to do is to omit the "host" and the port parameter so that you just use something like this:
$dbconn2 = pg_connect("dbname=mary user=postgres password="yourpassword");