Re: SELECT does not find table created by itself - Mailing list pgsql-general

From Albe Laurenz
Subject Re: SELECT does not find table created by itself
Date
Msg-id D960CB61B694CF459DCFB4B0128514C203938104@exadv11.host.magwien.gv.at
Whole thread Raw
In response to Re: SELECT does not find table created by itself  (Magnus Hagander <magnus@hagander.net>)
List pgsql-general
Magnus Hagander wrote:
> > select * FROM (select 1 as a) t2 left join t2 t3 ON TRUE
> > causes error
> > ERROR:  relation "t2" does not exist

> Not entirely sure if this is what you're looking for, but I think a
> CTE can solve your problem:
> WITH t2 AS (SELECT 1 AS a)
> SELECT * FROM t2 LEFT JOIN t3 ON TRUE

Shouldn't that be:
WITH t2 AS (SELECT 1 AS a)
SELECT * FROM t2 LEFT JOIN t2 t3 ON TRUE

Yours,
Laurenz Albe

pgsql-general by date:

Previous
From: "Daniel Verite"
Date:
Subject: Re: set-level update fails with unique constraint violation
Next
From: "Greg Sabino Mullane"
Date:
Subject: Re: Migration of db