This is quite odd feature in PostgreSQL. Try this:
select pg_database.datname from pg_user;
You will get all database names, each repeated by number of users and a note:
NOTICE: Adding missing FROM-clause entry for table "pg_database"
You see, in SELECT you referred a table that is not in FROM clause and PostgreSQL is adding it automatically! Seems
prettyconfusing to me, but I didn't dig any further, why is it needed or when it this was included.
Tambet