DDC-3236: Quote table names #4006

Closed
opened 2026-01-22 14:33:37 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Jul 31, 2014).

Originally assigned to: @ostrolucky on GitHub.

Jira issue originally created by user BenjaminHorn:

Different dbs have different reserved words. I started my project with mysql where i couldnt name my table as "order". After changing to postgre it turned out that "user" is reserved. Although

ALTER TABLE "member" RENAME TO "user";

works.

I know i could use prefixes in yml eg

Com\ApiBundle\Entity\User:
    type: entity
    table: prefix_user

but
-i build my db
-automatically generate my yaml files from it
-then i generate the entities

If i have prefixed table names my entities will have them too.
Besides doctrine is a layer on top of different dbs, it would be nice not to worry about reserved words when i naming my tables.

What is your opinion on this feature.

Originally created by @doctrinebot on GitHub (Jul 31, 2014). Originally assigned to: @ostrolucky on GitHub. Jira issue originally created by user BenjaminHorn: Different dbs have different reserved words. I started my project with mysql where i couldnt name my table as "order". After changing to postgre it turned out that "user" is reserved. Although `ALTER TABLE "member" RENAME TO "user";` works. I know i could use prefixes in yml eg ``` Com\ApiBundle\Entity\User: type: entity table: prefix_user ``` but -i build my db -automatically generate my yaml files from it -then i generate the entities If i have prefixed table names my entities will have them too. Besides doctrine is a layer on top of different dbs, it would be nice not to worry about reserved words when i naming my tables. What is your opinion on this feature.
admin added the Improvement label 2026-01-22 14:33:37 +01:00
admin closed this issue 2026-01-22 14:33:38 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jul 31, 2014):

Comment created by @deeky666:

[~BenjaminHorn] this looks more like a DBAL related issue. Can you please give more details how the broken SQL is created by you? Also please provide information about which DBAL and/or ORM version you are referring to as we have fixed a lot of quotation problems with DDL statements in current DBAL master over the last few months. So please also try using the latest master and see if you can reproduce the issue.
If the issue still persists it would be helpfult to know which database vendor and which version you are using (as different vendors and versions have different reserved keywords).

@doctrinebot commented on GitHub (Jul 31, 2014): Comment created by @deeky666: [~BenjaminHorn] this looks more like a DBAL related issue. Can you please give more details how the broken SQL is created by you? Also please provide information about which DBAL and/or ORM version you are referring to as we have fixed a lot of quotation problems with DDL statements in current DBAL master over the last few months. So please also try using the latest master and see if you can reproduce the issue. If the issue still persists it would be helpfult to know which database vendor and which version you are using (as different vendors and versions have different reserved keywords).
Author
Owner

@ostrolucky commented on GitHub (Aug 6, 2018):

In Doctrine 3.x, everything is always quoted

@ostrolucky commented on GitHub (Aug 6, 2018): In Doctrine 3.x, everything is always quoted
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4006