We are using Doctrine 2 for a new project and have run into an issue: Doctrine 2 chokes on Postgres table column names with spaces in them. For example, say there is a column named “Sales Person.” While you and I know there should not be a space in the column name, it exists just the same. The databases were designed many years ago, and critical business systems run on them, so the column names cannot be changed. Is there a way around this issue without hacking Doctrine to handle this situation? If not, how would you propose solving this on the Doctrine end?
Share
Looks like another badly coded ORM
http://docs.doctrine-project.org/projects/doctrine-orm/en/2.0.x/reference/limitations-and-known-issues.html
http://docs.doctrine-project.org/projects/doctrine-orm/en/2.0.x/reference/basic-mapping.html
Says helpful things like: “You cannot use non [a-zA-Z0-9_]+ characters, they will break several SQL statements” and “Identifier quoting should not be used to enable the use non-standard-characters such as a dash” and “Schema-Tool will likely have troubles when quoting is used for case-sensitivity reasons”.
Looks like it’s another ORM that’s been built by someone who doesn’t want it to work with actual databases. Having columns with spaces etc. in them is not a brilliant idea but it’s perfectly legal in SQL.
You’ve only really got three options:
None of them ideal, and I’m not sure what’s going to be easiest in your case.