Re: Query will execute when inner query have issue

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: selva kumar <selva(dot)logic(at)hotmail(dot)com>
Cc: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: Query will execute when inner query have issue
Date: 2020-01-23 09:55:53
Message-ID: 35DEDE9B-385E-49BA-A872-8D43279784B2@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> On 23 Jan 2020, at 08:34, selva kumar <selva(dot)logic(at)hotmail(dot)com> wrote:
>
> Greetings,
>
> We tried query in a following manner.
>
> SELECT * FROM A where A.id IN (SELECT B.id from B);
>
> In the above query Table B does not have id. But this query return all A table records
>
> Note : If we run inner query alone, It throws error like “Field is not found”

This is not reproducible for me, it fails as expected:

db=# select * from a where a.id in (select b.id from b);
ERROR: column b.id does not exist
LINE 1: select * from a where a.id in (select b.id from b);
^
HINT: Perhaps you meant to reference the column "a.id".

Which version of postgres are you using, and how are you executing the query?

cheers ./daniel

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2020-01-23 10:03:37 BUG #16227: Loss database tables automatically in a couple of days
Previous Message Vadim Yatsenko 2020-01-23 09:03:02 Re: BUG #16226: background worker "logical replication worker" (PID <pid>) was terminated by signal 11: Segmentation