Fix postgresql failures related to Data type to API-v3 fixed-ip

Postgresql is kind of sensitive about different kind of data in a query, so it
was failing in cases like looking for an ip using a filter which wasn't a valid
ip or ids values greater than the id type on the table.

This patch fix this behavior to fixed ips in API-v3.
In v2 this was fixed by change I83d532c28c9aec690e8e1ffad8b58e71d619d728

Fixes bug 1182754
Fixes bug 1204503

Change-Id: I9aa14bea2f29f1df85dfd1f07eb0b1947d2c1100
Merge "Fix postgresql failures related to Data type to API-v3 fixed-ip"