In symfony with doctrine and postgres
I have this configuration
doctrine:
dbal:
server_version: '16.3'
dbname: 'dev'
host: 'postgres'
port: 5432
user: 'app'
password: 'pass'
driver: 'pgsql'
charset: 'utf8'
as you can see my postgres user for connection is app
Now if I do in my controller
$sql = 'SELECT * FROM user';
$em = $this->getEntityManager();
$stmt = $em->getConnection()->prepare($sql);
$a = $stmt->executeQuery()->fetchAssociative();;
The result is app
!
So doctrine is actually looking in the wrong database because it is retrieving the Postgres user and not user from my dev
database
I do not understand why. Can someone shed some light ?