Home » Php » php – Error Symfony Doctrine PostgreSQL : SQLSTATE[42703]: Undefined column: 7 ERROR

php – Error Symfony Doctrine PostgreSQL : SQLSTATE[42703]: Undefined column: 7 ERROR

Posted by: admin February 25, 2020 Leave a comment

Questions:

Hi i’m using Symfony and i’m trying to connect my project to a PostgreSQL server version 9.6. I’have already edited the .env file. Then i did my migrations. So I have my new tables in the database, but when i’m creating an account in my web app i have this error.

An exception occurred while executing 'SELECT t0.id AS id_1, t0.username AS username_2, t0.password AS password_3, t0.email AS email_4, t0.confirmation_token AS confirmation_token_5, t0.account_activated AS account_activated_6 FROM user t0 WHERE t0.email = ?' with params ["[email protected]"]:

SQLSTATE[42703]: Undefined column: 7 ERROR: column t0.id does not exist
LINE 1: SELECT t0.id AS id_1, t0.username AS username_2, t0.password...

I’ve already used

php bin/console doctrine:schema:update --force

But it changed nothing. I have also added the corrects extensions to the php.ini file.

How to&Answers:

Finally found an issue : “user” is keyword in postgreSQL. I renamed my entity and made migrations. Now it’s working