Weird behaviour with subquery - Mailing list pgsql-hackers

From Christopher Kings-Lynne
Subject Weird behaviour with subquery
Date
Msg-id 405FAA41.2020707@familyhealth.com.au
Whole thread Raw
Responses Re: Weird behaviour with subquery  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
List pgsql-hackers
What's going on here:

usa=> select user_id from users_users where joindate >= '2004-03-09';
ERROR:  column "user_id" does not exist

usa=> select * from shop_orders where user_id in (select user_id from 
users_users where joindate >= '2004-03-09');
[waits and waits and waits...have to cancel]
^CCancel request sent
ERROR:  canceling query due to user request

How come using a field that doesn't exist in the subquery actually works 
and doesn't cause a syntax error?

Chris



pgsql-hackers by date:

Previous
From: "Matthew T. O'Connor"
Date:
Subject: Re: [DEFAULT] Daily digest v1.4346 (20 messages)
Next
From: Christopher Kings-Lynne
Date:
Subject: Re: Weird behaviour with subquery