Bug: array starting index seems incorrect (different for 1D and 2D arrays)

From: Zachary Smith <zachsmith(dot)sa(at)gmail(dot)com>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Bug: array starting index seems incorrect (different for 1D and 2D arrays)
Date: 2019-09-18 10:40:20
Message-ID: CAN4qkmF0=s8iRtcooKaJjY13vao1KQO3f80C_zJshYQfhhYDog@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Dmitry Dolgov 2019-09-18 11:09:02 Re: Bug: array starting index seems incorrect (different for 1D and 2D arrays)
Previous Message Robert Lichtenberger 2019-09-18 06:10:50 Restricted interval data type