looking for an array-extract-item-as-it operator

From: Peter Krauss <ppkrauss(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: looking for an array-extract-item-as-it operator
Date: 2016-01-06 22:40:52
Message-ID: CAHEREttBhBwya=yNeWrAHBpdystjjfOpqt-+VHTEEv+8EKF7tA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I need to access an array-item from an array of arrays. Suppose

WITH t AS (SELECT '{{1,2,3},{33,44,55}}'::int[][] as a)SELECT
a[2], -- returns null (!), why not works?
a[2:2], -- returns array-into-array, not a simple arrayFROM t;

There are a simple function or operator to acess it as it?

Summarizing: I am looking for a f(a,2) that returns {33,44,55}, not
{{33,44,55}}.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-01-06 22:50:48 Re: looking for an array-extract-item-as-it operator
Previous Message Robert Haas 2016-01-06 20:18:49 Re: No Issue Tracker - Say it Ain't So!