ERROR: function expression in FROM may not refer to other relations of same query level

From: Joseph S <jks(at)selectacast(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: ERROR: function expression in FROM may not refer to other relations of same query level
Date: 2009-07-09 01:22:41
Message-ID: h33got$17dc$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I've seen this asked in the archives, but there was never any answer.

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? None of these work: (xunnest is my
version of unnest since I'm using 8.2.x)

select * FROM xunnest(tempa.ids);

SELECT * FROM (select * FROM xunnest(tempa.ids) AS aa) AS ab, tempa;

SELECT * FROM ( select * FROM xunnest(ta.ids) AS aa) AS ab, tempa ta;

SELECT * FROM tempa ta, ( select * FROM xunnest(ta.ids) AS aa) AS ab;

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2009-07-09 01:58:51 Re: ERROR: function expression in FROM may not refer to other relations of same query level
Previous Message Rob Sargent 2009-07-08 21:19:26 Moving text columns, when it actually is large