Re: Query will execute when inner query have issue - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: Query will execute when inner query have issue
Date
Msg-id CAKFQuwZx=0T+P_kGJ38mCFHUwmkO8Mi4ow6ADZ5hMnsOkAFQaw@mail.gmail.com
Whole thread Raw
In response to RE: Query will execute when inner query have issue  (selva kumar <selva.logic@hotmail.com>)
List pgsql-bugs
On Thu, Jan 23, 2020 at 9:19 AM selva kumar <selva.logic@hotmail.com> wrote:

But the following query will executed

select * from product where productid in (select productid from sales where salesdate='2020-01-22')



Which isn't the same as what you first posted because of the absence of table qualifications.  That single difference, explained by Tom, completely explains why the original post did in fact provoke and error and this query does not.

The take-away is make sure to test your queries; and when dealing with sub-queries its usually a good idea of add a table qualification to your fields.

David J.

pgsql-bugs by date:

Previous
From: selva kumar
Date:
Subject: RE: Query will execute when inner query have issue
Next
From: Andrew Roffey
Date:
Subject: Re: BUG #16225: EL8 - PGDG postgresql* packages conflict withappstream postgresql packages