0

Has anyone encountered a bug with table names using the PostgreSQL adapter in ZF2?

I have a column named UserId and when I try to update/delete a row based on this I get this error:

ERROR:  column 'userid' does not exist

as opposed to UserId.

This is my code:

$delete = $this->delete(
        'Users'
        , array(
             'UserId = ?' => $UserId
        )
    );

Might have something to do with autoQuoteIdentifiers but I couldn't find much online about it.

Any ideas?

2
  • Did you check this topic? stackoverflow.com/questions/15940765/… Commented Mar 11, 2015 at 7:16
  • 2
    I've had yes. The problem was that camel case column names need to be enclosed in double quotes so the array should have been array('"UserId" = ?' => $UserId) Commented Mar 11, 2015 at 8:15

1 Answer 1

1

The problem was that camel cased column names need to be enclosed in double quotes so the array should be:

array('"UserId" = ?' => $UserId)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.