Yii Framework Forum: page 200 : operator does not exists - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

page 200 : operator does not exists

#1 User is offline   JulianLS 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 12-January 11

Posted 13 January 2011 - 09:48 AM

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
0

#2 User is offline   JulianLS 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 12-January 11

Posted 13 January 2011 - 10:20 AM

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.postgres...licit-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
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users