They discuss the reasoning here: If it were to allow expand_dbname, people could override username etc, variables that need to be fixed, by setting them in the dbname connection string. But this just seems like a bug. It should prioritize non-expanded variables over expanded ones.