Bug: array starting index seems incorrect (different for 1D and 2D arrays) - Mailing list pgsql-bugs

From Zachary Smith
Subject Bug: array starting index seems incorrect (different for 1D and 2D arrays)
Date
Msg-id CAN4qkmF0=s8iRtcooKaJjY13vao1KQO3f80C_zJshYQfhhYDog@mail.gmail.com
Whole thread Raw
Responses Re: Bug: array starting index seems incorrect (different for 1D and2D arrays)
List pgsql-bugs
Hi,

Some behaviour that I recently came across in PostgreSQL seems suspicious - I'm not sure whether it's a bug or not, but it seems like it could be. 

I found that, using arrays, I have different starting indices when accessing 1D arrays nested in 2D arrays. A full description of the bugs (and the code to reproduce) is on dba.stackechange: https://dba.stackexchange.com/questions/249035/why-do-postgresql-arrays-have-different-starting-indices-for-1d-and-2d-arrays

A short description: For a 2D array arr = ( (x, y), (x, y) ), the first element of the outer array is at position 1, but the first element of an inner array is at position 0.

Best regards,
Zach

pgsql-bugs by date:

Previous
From: Robert Lichtenberger
Date:
Subject: Restricted interval data type
Next
From: Dmitry Dolgov
Date:
Subject: Re: Bug: array starting index seems incorrect (different for 1D and2D arrays)