Re: ERROR: function expression in FROM may not refer to other relations of same query level - Mailing list pgsql-sql

From Tom Lane
Subject Re: ERROR: function expression in FROM may not refer to other relations of same query level
Date
Msg-id 16881.1247104731@sss.pgh.pa.us
Whole thread Raw
In response to ERROR: function expression in FROM may not refer to other relations of same query level  (Joseph S <jks@selectacast.net>)
List pgsql-sql
Joseph S <jks@selectacast.net> 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


pgsql-sql by date:

Previous
From: Joseph S
Date:
Subject: ERROR: function expression in FROM may not refer to other relations of same query level
Next
From: Richard Huxton
Date:
Subject: Re: Moving text columns, when it actually is large