Fix Error “date field value out of range” when using make_date() in PostgreSQL

If you’re getting an error that reads ‘date field value out of range‘ in PostgreSQL while using the make_date() function, it’s probably because one or more of the date parts you’re providing is out of range for that date part.

It’s possible that you’ve got the month and day in the wrong order.

To fix this issue, be sure that each date part you provide is within the valid range for that date part. It may be that all you need to do is switch the day and the month around.

Continue reading

Fix Error “function generate_subscripts(numeric, integer) does not exist” in PostgreSQL

If you’re getting a PostgreSQL error that reads “function generate_subscripts(numeric, integer) does not exist“, it’s probably because your first argument is not an array. This specific error message implies that the first argument is a numeric value, but we’d get a similar error when passing an integer.

The first argument for this function must be an array.

To fix this error, be sure that your first argument to generate_subscripts() is an array.

Continue reading