Search Postgresql Archives

incomplete CTE declaration and "column reference x is ambiguous"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
 
 

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux