# Postgresql error

**URL:** <https://discuss.elastic.co/t/postgresql-error/55652>\
**Category:** Logstash\
**Created:** [July 15, 2016, 8:13pm UTC](https://discuss.elastic.co/t/postgresql-error/55652 "2016-07-15T20:13:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ggp](https://avatars.discourse-cdn.com/v4/letter/g/278dde/32.png) [@ggp](https://discuss.elastic.co/u/ggp)\
**Post date:** [July 15, 2016, 8:13pm UTC](https://discuss.elastic.co/t/postgresql-error/55652/1 "2016-07-15T20:13:02Z")

</div>

hello i am trying to load data from postgresql db to ES , below is my configuration on the INPUT

input {  
jdbc {  
# Postgres jdbc connection string to our database, mydb  
jdbc\_connection\_string =\> "jdbc:postgresql://xxx:5432/svcpgst"  
# The user we wish to execute our statement as  
jdbc\_user =\> "xxx"  
jdbc\_password=\>"xxx"  
# The path to our downloaded jdbc driver  
jdbc\_driver\_library =\> "/root/software/postgresql-9.4.1208.jar"  
# The name of the driver class for Postgresql  
jdbc\_driver\_class =\> "org.postgresql.Driver"  
jdbc\_paging\_enabled =\> "true"  
jdbc\_page\_size =\> "10000"  
schedule =\> "\* \* \* \* \*"  
# our query  
statement =\> "SELECT t.id,t.global\_transaction\_id,t.service\_name,t.status,t.date\_time from table t where t.DATE\_TIME \> :sql\_last\_start"  
}  
}

when i try to run the logstash i see below error

> Java::OrgPostgresqlUtil::PSQLException: ERROR: syntax error at or near ":"  
> Position: 170: SELECT count(\*) AS "count" FROM (SELECT t.id,t.global\_transaction\_id,t.service\_name,t.status,t.date\_time from table t where t.DATE\_TIME \> :sql\_last\_start) AS "t1" LIMIT 1 {:level=\>:error}  
> Exception when executing JDBC query {:exception=\>#\<Sequel::DatabaseError: Java::OrgPostgresqlUtil::PSQLException: ERROR: syntax error at or near ":"  
> Position: 170\>, :level=\>:warn}

i have refered [Logstash and databse - #4 by talevy](https://discuss.elastic.co/t/logstash-and-databse/26225/4) to use **sql\_last\_start**  
so any input is very helpful here

---

<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, 4:47am UTC](https://discuss.elastic.co/t/postgresql-error/55652/2 "2017-07-06T04:47:47Z")

</div>


