pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Support for WITH Queries (Common Table Expressions)
2+ messages / 2 participants
[nested] [flat]

* Support for WITH Queries (Common Table Expressions)
@ 2016-05-25 20:13  Ravi Rangaswamy <rrangaswamy@gobalto.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Ravi Rangaswamy @ 2016-05-25 20:13 UTC (permalink / raw)
  To: pgsql-jdbc

Hi,

Does the PostgreSQL JDBC driver support WITH Queries (Common Table 
Expressions)? When I execute the query using 
Statement.executeQuery(sql), I get an error an error "syntax error at 
end of input". I tried with the sample query listed in the PostgreSQL 
documentation of CTEs 
<https://www.postgresql.org/docs/9.1/static/queries-with.html; and still 
get the same error.

Version used:
     postgresql-9.4-1205.jdbc4

Exception:
org.postgresql.util.PSQLException: ERROR: syntax error at end of input
   Position: 189
     at 
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2182)
     at 
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1911)
     at 
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:173)
     at 
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:645)
     at 
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:481)
     at 
org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:361)

Regards,
Ravi

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Support for WITH Queries (Common Table Expressions)
@ 2016-05-25 20:26  Dave Cramer <pg@fastcrypt.com>
  parent: Ravi Rangaswamy <rrangaswamy@gobalto.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Dave Cramer @ 2016-05-25 20:26 UTC (permalink / raw)
  To: Ravi Rangaswamy <rrangaswamy@gobalto.com>; +Cc: pgsql-jdbc

Can you provide the entire relevant code ?

Also I'd suggest using the latest driver

Dave Cramer

davec@postgresintl.com
www.postgresintl.com

On 25 May 2016 at 16:13, Ravi Rangaswamy <rrangaswamy@gobalto.com> wrote:

> Hi,
>
> Does the PostgreSQL JDBC driver support WITH Queries (Common Table
> Expressions)? When I execute the query using Statement.executeQuery(sql), I
> get an error an error "syntax error at end of input". I tried with the
> sample query listed in the PostgreSQL documentation of CTEs
> <https://www.postgresql.org/docs/9.1/static/queries-with.html; and still
> get the same error.
>
> Version used:
>     postgresql-9.4-1205.jdbc4
>
> Exception:
> org.postgresql.util.PSQLException: ERROR: syntax error at end of input
>   Position: 189
>     at
> org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2182)
>     at
> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1911)
>     at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:173)
>     at
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:645)
>     at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:481)
>     at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:361)
>
> Regards,
> Ravi
>

^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2016-05-25 20:26 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-05-25 20:13 Support for WITH Queries (Common Table Expressions) Ravi Rangaswamy <rrangaswamy@gobalto.com>
2016-05-25 20:26 ` Dave Cramer <pg@fastcrypt.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox