Postgres column casting...
- by Simon
I have a query
SELECT assetid, type_code, version, name, short_name, status, languages,
charset, force_secure, created, created_userid, updated, updated_userid,
published, published_userid, status_changed, status_changed_userid
FROM sq_ast WHERE assetid = 7
which doesn't work and throws
ERROR: operator does not exist: character varying = integer LINE 4: FROM sq_ast WHERE assetid = 7
I can get it to work by doing
SELECT assetid, type_code, version, name, short_name, status, languages,
charset, force_secure, created, created_userid, updated, updated_userid,
published, published_userid, status_changed, status_changed_userid
FROM sq_ast WHERE assetid = '7'
Please note the quoting of the 7 in the WHERE clause...
I am deploying an huge application and I cannot rewrite the core... similarly I don't want to risk changing the type of the column...
I'm no Postgres expert... please help...
Is there an option for strict casting of columns???