Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 69B98632D9F for ; Wed, 8 Jul 2009 22:59:04 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 97680-07 for ; Wed, 8 Jul 2009 22:58:53 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 99F946332A5 for ; Wed, 8 Jul 2009 22:58:53 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id n691wpWN016882; Wed, 8 Jul 2009 21:58:51 -0400 (EDT) To: Joseph S cc: pgsql-sql@postgresql.org Subject: Re: ERROR: function expression in FROM may not refer to other relations of same query level In-reply-to: References: Comments: In-reply-to Joseph S message dated "Wed, 08 Jul 2009 21:22:41 -0400" Date: Wed, 08 Jul 2009 21:58:51 -0400 Message-ID: <16881.1247104731@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200907/38 X-Sequence-Number: 32779 Joseph S writes: > Supposed I have this table: > create temp table tempa (ids int[]); > insert into tempa SELECT ARRAY[1 , 2, 3]; > Now how do I get output from that? Uh, you didn't actually say what output you're looking for, but I'm going to guess it's this: regression=# select unnest(ids) from tempa; unnest -------- 1 2 3 (3 rows) Pre-8.4, you need a version of unnest() that's coded in C or SQL; plpgsql won't do. regards, tom lane