Weird behaviour with subquery

From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Weird behaviour with subquery
Date: 2004-03-23 03:08:49
Message-ID: 405FAA41.2020707@familyhealth.com.au
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2004-03-23 03:15:18 Re: Weird behaviour with subquery
Previous Message Christopher Kings-Lynne 2004-03-23 02:58:46 bug in 7.4 SET WITHOUT OIDs