# Jdbc query error (postgresql)

**URL:** <https://discuss.elastic.co/t/jdbc-query-error-postgresql/40142>\
**Category:** Logstash\
**Created:** [January 26, 2016, 5:09pm UTC](https://discuss.elastic.co/t/jdbc-query-error-postgresql/40142 "2016-01-26T17:09:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![carmelom](https://avatars.discourse-cdn.com/v4/letter/c/e19adc/32.png) [@carmelom](https://discuss.elastic.co/u/carmelom)\
**Post date:** [January 26, 2016, 5:09pm UTC](https://discuss.elastic.co/t/jdbc-query-error-postgresql/40142/1 "2016-01-26T17:09:44Z")

</div>

I connected to the db through jdbc  
I am using this query :  
`select *, (end_time - start_time) as duration from system.connection_log order by start_time desc`

it is parsing most of the field, but for **duration** field I am getting this error:  
`Java::OrgPostgresqlUtil::PGInterval:0x3091c80c`

How can I write a proper query ? The same query is working directly in to the db.

Regards  
Carmelo

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 5:14am UTC](https://discuss.elastic.co/t/jdbc-query-error-postgresql/40142/2 "2017-07-06T05:14:13Z")

</div>

Closed on July 6, 2017, 5:14am UTC


