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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joseph S <jks(at)selectacast(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: ERROR: function expression in FROM may not refer to other relations of same query level
Date: 2009-07-09 01:58:51
Message-ID: 16881.1247104731@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Joseph S <jks(at)selectacast(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Huxton 2009-07-09 08:09:05 Re: Moving text columns, when it actually is large
Previous Message Joseph S 2009-07-09 01:22:41 ERROR: function expression in FROM may not refer to other relations of same query level