If you’re getting an error that reads “source array too small” when updating an array in PostgreSQL, it’s probably because you’re passing a slice that’s smaller than your specified range. For example, if you specify a range that covers four elements but provide an array that contains just three elements, then you’d get this error.
To fix the error, be sure to provide an an array that contains at least as many elements as are specified in the range.
Continue reading