Re: [HACKERS] CTE containing ambiguous columns

2009-11-13 Thread Dan Colish
> > > Can't you disambiguate it using a column list on beings? > > Sure, after I figured out what the real problem was. Maybe I'm a > dope, but when I get an error cursor pointed at an ambiguous column > reference, my thought is "oh, I need to qualify that reference" - not > "oh, some completely u

Re: [HACKERS] CTE containing ambiguous columns

2009-11-13 Thread Robert Haas
On Fri, Nov 13, 2009 at 8:32 AM, Andrew Dunstan wrote: > > > Robert Haas wrote: >> >> create table animals (id serial primary key, name varchar not null); >> >> >> > > ... >> >> with beings as (select * from animals a1, animals a2) select * from >> beings where id = 1; >> >> >> > > "Doctor, it hur

Re: [HACKERS] CTE containing ambiguous columns

2009-11-13 Thread Andrew Dunstan
Robert Haas wrote: create table animals (id serial primary key, name varchar not null); ... with beings as (select * from animals a1, animals a2) select * from beings where id = 1; "Doctor, it hurts when I do this." "So stop doing that." Can't you disambiguate it using a column l

Re: [HACKERS] CTE containing ambiguous columns

2009-11-12 Thread Tom Lane
Robert Haas writes: > Suppose you do this: > create table animals (id serial primary key, name varchar not null); > Then you can do this: > with beings as (select * from animals) select * from beings where id = 1; > But not this: > with beings as (select * from animals a1, animals a2) select *

[HACKERS] CTE containing ambiguous columns

2009-11-12 Thread Robert Haas
Suppose you do this: create table animals (id serial primary key, name varchar not null); Then you can do this: with beings as (select * from animals) select * from beings where id = 1; But not this: with beings as (select * from animals a1, animals a2) select * from beings where id = 1; Beca