incomplete CTE declaration and "column reference x is ambiguous" - Mailing list pgsql-general

From Marc Mamin
Subject incomplete CTE declaration and "column reference x is ambiguous"
Date
Msg-id B6F6FD62F2624C4C9916AC0175D56D880CE0135F@jenmbs01.ad.intershop.net
Whole thread Raw
Responses Re: incomplete CTE declaration and "column reference x is ambiguous"  (David Johnston <polobo@yahoo.com>)
List pgsql-general
Hello,
 
I've lost some time to debug a large Query with many CTE.
I couldn't  really believe the error message.
 
it was correct after all , though surprising.
a short version to illustrate my error:
 
WITH t1 (a,b) AS (
        SELECT
                        1 as x,
                2 as a,
                3 as b
        )
select * from t1 WHERE b =0
 
ERROR: column reference "b" is ambiguous.
 
 
It would be nice, if extra undeclared columns would not be visible outside the CTE.
 
regards,
 
Marc Mamin
 
 

pgsql-general by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: (Default) Group permissions
Next
From: Michael Orlitzky
Date:
Subject: Re: (Default) Group permissions