Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ftCKz-0001xg-89 for pgsql-general@arkaria.postgresql.org; Fri, 24 Aug 2018 13:41:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ftCKu-0000DI-Ev for pgsql-general@arkaria.postgresql.org; Fri, 24 Aug 2018 13:41:12 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ftCKu-0000D5-2z for pgsql-general@lists.postgresql.org; Fri, 24 Aug 2018 13:41:12 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ftCKr-0007cN-0q for pgsql-general@lists.postgresql.org; Fri, 24 Aug 2018 13:41:10 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w7ODf4Y0025446; Fri, 24 Aug 2018 09:41:04 -0400 From: Tom Lane To: Thomas Kellerer cc: pgsql-general@lists.postgresql.org Subject: Re: How to split an array into columns In-reply-to: References: Comments: In-reply-to Thomas Kellerer message dated "Fri, 24 Aug 2018 11:09:58 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <25444.1535118064.1@sss.pgh.pa.us> Date: Fri, 24 Aug 2018 09:41:04 -0400 Message-ID: <25445.1535118064@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Thomas Kellerer 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