Re: Weird behaviour with subquery

From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Weird behaviour with subquery
Date: 2004-03-23 03:15:18
Message-ID: 405FABC6.8010601@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Doh - I think I understand now why this is normal behavior - sorry!

Chris

Christopher Kings-Lynne wrote:

> 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
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
> joining column's datatypes do not match

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Neil Conway 2004-03-23 04:03:38 Re: float8 regression test failure in head
Previous Message Christopher Kings-Lynne 2004-03-23 03:08:49 Weird behaviour with subquery