Datagrip removing needed paratheses in creating view in postgresql

Its a pretty simple thing. I'm creating a view with a query that has a WHERE (THIS AND THAT) and Datagrip turns it into a WHERE THIS AND THAT

create view dealer__zip_union_scrubbed
...
FROM sp_geo_coverages.dealerlocator__zip_union
WHERE dealerlocator__zip_union."Dealer_Locator_Object" <> 'a3x2T000001g23g'
AND dealerlocator__zip_union.usps_zip_pref_state <> 'OK';

Becomes the following in the DLL.  I simply want the view to exclude the Dealer_Locator object specified if it is in Oklahoma not exclude everything matching the object AND everything in Oklahoma

create view dealer__zip_union_scrubbed
...
FROM sp_geo_coverages.dealerlocator__zip_union
WHERE dealerlocator__zip_union."Dealer_Locator_Object" <> 'a3x2T000001g23g'::text
AND dealerlocator__zip_union.usps_zip_pref_state <> 'OK'::text;
1
3 comments
Avatar
Yuriy Vinogradov

So what is the problem? This code will work as expected.

0

Actually it doesn't because it now eliminates everything in Oklahoma and everything that is attached to that particular object rather than the conjoint of the two.

0

David K Fickes,

Could you share original DDL to reproduce the issue?

0

Please sign in to leave a comment.