Editor: PostgresException: 42883: operator does not exist: text = integer

Editor: PostgresException: 42883: operator does not exist: text = integer

dhutton@creativeone.comdhutton@creativeone.com Posts: 59Questions: 15Answers: 0

I stumbled onto what I think may be a bug today and found a few forum posts that may be describing the issue I'm finding.

If you add a where clause to your editor instance, any value you give it that's all numbers seems to be converted to an integer on the back end, even if you surround it with quotes. See below image. If I change 1264 to a1264, my query goes through fine. If I change it back to 1264, I get the postgresql error message you see above in the summary because (I think) the value is being converted to an integer even though I defined it as a string. I of course started out by using a string variable (strongly typed) with the same results. When I couldn't figure out what was going on, I removed the variables and hard-coded values to check behavior.

If this is the same issue as the 2 below URLs, I need to digest the workaround posted to see if it will work for me. If it's not the same issue, can you reproduce and help me understand how to get around this issue? I'm using .NET core 2.1, DT 1.10 I think and editor 1.9.0 (postgresql 11 / latest)
* https://datatables.net/forums/discussion/56404
* https://datatables.net/forums/discussion/28156

Answers

  • allanallan Posts: 61,438Questions: 1Answers: 10,052 Site admin

    Are you reading the value to apply to the condition from the POST data - specifically the DTRequest object? If so, then yes, it will automatically convert anything that looks like a number into a number. You could use the .ToString() method of the parameter to assign it across to a string if you need.

    Allan

This discussion has been closed.