Re: How to split an array into columns - Mailing list pgsql-general

From Tom Lane
Subject Re: How to split an array into columns
Date
Msg-id 25445.1535118064@sss.pgh.pa.us
Whole thread Raw
In response to Re: How to split an array into columns  (Thomas Kellerer <spam_eater@gmx.net>)
List pgsql-general
Thomas Kellerer <spam_eater@gmx.net> writes:
> Maybe I am missing something, but: 
>    select id, data[1], data[2]
>    from the_table;
> will work just fine. 

If the arrays are of varying length, unnest() might be what the OP
is looking for.

            regards, tom lane


pgsql-general by date:

Previous
From: Abhinav Mehta
Date:
Subject: Re: PG-Sample | Error | Equality operator for type json
Next
From: Tom Lane
Date:
Subject: Re: Hungarian collation in English Windows server