Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not create table user in postgresql #3

Open
sergiovier opened this issue May 31, 2010 · 7 comments
Open

can not create table user in postgresql #3

sergiovier opened this issue May 31, 2010 · 7 comments

Comments

@sergiovier
Copy link
Contributor

In PostgreSQL database, the word "user" is a reserved one. See http://www.postgresql.org/docs/8.4/interactive/sql-keywords-appendix.html.

It's possible rename to something like doauth_user, so all tables can have a suffix?

@DavertMik
Copy link
Owner

Yep, sure. Need to think on that

@DavertMik
Copy link
Owner

Yeah, just what I thought :)

@sergiovier
Copy link
Contributor Author

With tableName i can change the related name of the table.

@miamibc
Copy link
Contributor

miamibc commented Jun 3, 2010

You can turn on identifier quoting using the Doctrine_Core::ATTR_QUOTE_IDENTIFIER attribute so that the reserved word is escaped with quotes.

In Symfony you can try add one line to config/databases.yml:

all:
  doctrine:
    class: sfDoctrineDatabase
    param:
      dsn:      your dsn string here
      username: username
      password: password
      attributes:
        quote_identifier: true

@DavertMik
Copy link
Owner

Oh, thanks. I really thought Doctrine should do that bu default :) But if it doesn't that's really the best fix for it.

@miamibc
Copy link
Contributor

miamibc commented Jun 3, 2010

http://trac.doctrine-project.org/ticket/1209

Bugs like this, is another side of this solution. Dunno, i've never used quote_identifier: true, prefer to rename tables ;) Good luck!

@DavertMik
Copy link
Owner

Ok, I will update a prefix in next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants