7

Schema and table name in Postgres are case sensitive. How can I specify correct schema in docblock annotations so they are not converted to lowercase?

Neither of these works:

@Table(name="MySchema.MyTable") // gets converted to lowercase
@Table(name="`MySchema`.`MyTable`") // invalid table
@Table(name="`MySchema.MyTable`") // also invalid table

Doctrine ORM is 2.0.4

Theres no word about schema in documentation either, only found that schema param/keyword is no longer supported.

Ross
  • 46,186
  • 39
  • 120
  • 173
Peter
  • 904
  • 1
  • 13
  • 26
  • 4
    possible duplicate of [Case problem with doctrine2, symfony2 and postgresql entities](http://stackoverflow.com/questions/5573865/case-problem-with-doctrine2-symfony2-and-postgresql-entities) – Ross May 12 '11 at 11:51
  • @Ross - Solution in mentioned thread works, thanks. – Peter May 12 '11 at 13:05
  • 1
    @Ross, you might want to put this as an answer. – Ignacio May 17 '11 at 13:55

1 Answers1

3

As mentioned in this thread, Postgres is case-sensitive and each word must be escaped:

@Table(name="""MySchema"".""MyTable""")
Community
  • 1
  • 1
Ross
  • 46,186
  • 39
  • 120
  • 173