Showing Different results in Datagrip than other client(psql) for Postgres

 I am using Postgres and I have a strange problem.  When I run a select query in datagrip, the result is different from the query when I ran through psql client.

Result from Datagrip


Result from Psql

If you look at has_not_tampered column, the result set is different.


Note that I have connected through same credentials and queried same table from both clients. No changes done in between.

I have run "Synchronize" and "Invalidate Cache and Restart" couple of times, but still the data is not refreshed.


Appreciate anyone who can point me in right direction.


Comment actions Permalink

Seshagiri S.T,

Make sure you set transaction control to Auto and committed all transactions

Comment actions Permalink

I too am experiencing this.  I really wanted DataGrip to work for me. I will not pay $25/mon for. a product that cannot return valid results from a simple query.

For reference, this is the query being run:


with current_downloads as (
select download_item_id, quota_used_km2, total_download_km2, timestamp
from downloads
where date_trunc('week', timestamp)::date = '2020-1-6'::date
and total_download_km2 != 0
select to_char(date_trunc('day', timestamp), 'YYYY-mm-dd') as week,
count(download_item_id) as number_of_images, sum(quota_used_km2) as quota_used, sum(total_download_km2) as total_sqkm
from current_downloads
group by 1
order by 1;


Here are the results from PGAdmin:


The results from DataGrip.

And finally. The results from DBeaver.

I'm getting consistent results from 2 open source FREE tools and cannot trust the results from a premium product.  I am using and will continue to use the Professional versions of PyCharm and IntelliJ.  Please fix this.

Comment actions Permalink

David W Vick,

It's strange.
Could you check you set transaction control to Auto and committed all transactions?

It would be great, if you can execute the same query in psql console and provide an output.

Comment actions Permalink

Hello David W VickSeshagiri S.T

Sorry for slow response

I cannot reproduce the problem.

Could you please provide a self-contained example?
Also what version of DataGrip, Postgres and JDBC driver do you use?

Here is how you can check driver version:

1. Choose 'go to driver'

2. Here is the version


Comment actions Permalink

Hello! I have a similar problem with datagrip and postgres. I get different results from datagrip and psql for the same query. Explain me, please, how it's possible?

I use: DataGrip 2019.3.2; PostgreSQL (ver. 12.2); PostgreSQL JDBC Driver (ver. 42.2.5, JDBC4.2) 


Please sign in to leave a comment.