I'm creating an API with PHP and PostgreSQL. This is one of the query I use:
SELECT id, email, first_name, last_name, [...] FROM clients WHERE id = ?
The column "id" is an integer and I don't need a bigger type. ? is replaced by a value coming from the user.
But if the user sends a too big integer (9999999999999) PostgreSQL returns an error:
SQLSTATE[22003]: Numeric value out of range: 7 ERROR: value \"99999999999999999999999\" is out of range for type integer
Should I check the overflow in the PHP logic ?
Can I turn this error into warning ? The same query on MySQL doesn't fail...
Thank you