Re: [HACKERS] Little Suggestion for 6.6 - Mailing list pgsql-hackers

From The Hermit Hacker
Subject Re: [HACKERS] Little Suggestion for 6.6
Date
Msg-id Pine.BSF.4.05.9906292303140.36396-100000@thelab.hub.org
Whole thread Raw
In response to Re: [HACKERS] Little Suggestion for 6.6  (Daniele Orlandi <daniele@orlandi.com>)
List pgsql-hackers
On Wed, 30 Jun 1999, Daniele Orlandi wrote:

> 
> 
> The Hermit Hacker wrote:
> > 
> > > tacacs=> SELECT * FROM users,counters WHERE users.username=counters.username 
> > > AND username='foobar';
> > > ERROR:  Column 'username' is ambiguous
> > >
> > > ...username is NOT ambiguous...
> > 
> > Of course it is...which username do you want to match on, users.username
> > or counters.username?
> 
> IMHO it's the same, since they have to be equal...
> 
> Pardon me if I'm not seeing something obvious :^)

If I understand things (which could be pushing it), the join that is being
attempted (simplistically) gets broken down as something like:

a) find all usernames in users that exist in counters
b) find all usernames in ?? that equals foobar
c) find all a AND b

Very simplistic, mind you...

IN the above sample, b can't be resolved, since you don't tell it which
table to search for the username...

Marc G. Fournier                   ICQ#7615664               IRC Nick: Scrappy
Systems Administrator @ hub.org 
primary: scrappy@hub.org           secondary: scrappy@{freebsd|postgresql}.org 



pgsql-hackers by date:

Previous
From: Adam Haberlach
Date:
Subject: Re: [HACKERS] User requests now that 6.5 is out
Next
From: Todd Graham Lewis
Date:
Subject: Re: [HACKERS] Hot Backup Ability