Skip to content
Advertisement

Tag: arrays

Normalize array subscripts so they start with 1

PostgreSQL can work with array subscripts starting anywhere. Consider this example that creates an array with 3 elements with subscripts from 5 to 7: Returns: We get the first element at subscript 5: I want to normalize 1-dimensional arrays to start with array subscript 1. The best I could come up with: The same, easier the read: Do you know

Advertisement