page 200 : operator does not exists

Got as far as page 200 ;) However, trying to run the unit test on this page gives me the following error

  1. ProjectTest::testUserAccessBasedOnProjectRole

CDbException: CDbCommand failed to execute the SQL statement: SQLSTATE[42883]: U

ndefined function: 7 ERROR: operator does not exist: character varying = intege

r

LINE 1: SELECT * FROM authassignment WHERE userid=2

                                             ^

HINT: No operator matches the given name and argument type(s). You might need t

o add explicit type casts.

I’ve checked what I can , but am at a bit of a loss. I presume because 2 is int and authassigment.userid is varchar(64) there is a conflict, but don’t know how, why or where to fix this ;)

Thanks

Julian

ok, managed to find a solution. I am using Postgresql 9.0, which seems to have removed implicit casts (?) Apparently MySql does an automatic casting when using an integer against a char field in a query.

I’ve added this to my catalog (http://wiki.postgresql.org/images/d/d1/Pg83-implicit-casts.sql) and this seems to have fixed the issue.

I can’t help wondering why, though, the userid field in authassignment is a char, and not an int like the rest of the user_id columns in the database