Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.

Cast unknown data types to TEXT to avoid query errors with postgresql?

bherila's profile image bherila posted 3 years ago in General Permalink

When using the "Multi-column filter" function postgresql throws an error if we try to compare a non-string column value to a string. This can be bypassed by casting the field to a string, i.e.

select * from mytable where mycolumn::text LIKE '%filtertext%'

Consider adding the ::text to columns which aren't already VARCHAR or TEXT or have a matching regex as in numbers, UUIDs, and maybe-soon datetimes?

Thanks, Ben

Code modification/commit 7bd29f0 from ansgarbecker, 3 years ago, revision 5130
Cast unknown data type columns as text when generating a multi column filter from user input. See http://www.heidisql.com/forum.php?t=22562
ansgar's profile image ansgar posted 3 years ago Permalink

r5130 should cast unknown data type columns to ::text.

Please login to leave a reply, or register at first.