Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5fMs-0000C6-1z for pgsql-jdbc@arkaria.postgresql.org; Wed, 25 May 2016 20:25:26 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1b5fMr-0006Kd-KP for pgsql-jdbc@arkaria.postgresql.org; Wed, 25 May 2016 20:25:25 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1b5fBb-0005mo-CO for pgsql-jdbc@postgresql.org; Wed, 25 May 2016 20:13:47 +0000 Received: from mail-pa0-x231.google.com ([2607:f8b0:400e:c03::231]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1b5fBT-0008R4-JT for pgsql-jdbc@postgresql.org; Wed, 25 May 2016 20:13:45 +0000 Received: by mail-pa0-x231.google.com with SMTP id eu11so11666313pad.3 for ; Wed, 25 May 2016 13:13:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gobalto-com.20150623.gappssmtp.com; s=20150623; h=message-id:date:from:user-agent:mime-version:to:subject; bh=/xikivH/awx/QPQ4TpI420sG6hYr445PIwGhHsuRld8=; b=BHjt9Zd0Q/bAco+M9DlM7vdmsAoLgttI2DG8aC40NRWGdDq3AAovu/3ZxyfOvQJOpN KsIooVgfa/wp+vontvu7o2ERo/J2pE5eNynxZoqgAvquusEcnYFDVqeuHz/lS2/kISbz x9nb7qGZ5JmDYOIpaRWkG0r6iTuKdMVrAwuHBybu9XsJ30yYU24oGRe5dlRHG+8gnA8C bC8FeCrnesTWcIjSnmdUCag6tGbUPWgI7WBLFACLNSPuOwQT3UuWIZnWTLbjzxlVpqF2 oJqTTqLcbYigQKUjLnzMgjbzUTVSg5FRk5WqYpZo0YbhcZ21QpXNyo5tuxSzehspxn3r 6TeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject; bh=/xikivH/awx/QPQ4TpI420sG6hYr445PIwGhHsuRld8=; b=k2QCZRm569aLJTfLYTAGwypwGSfHKKIidlvA+qJUwsfQpu+nb54133zDYMtAQBX33q uShzIto2xiYMWBPZPdzO2wyOjfyP3WONxrVhdWlin5VPXe+/ZhQ0IzBZ6NzTqJPqJZvq apH/F4+QgZalU+pW1MJ2rAxzjTdR2FsCz20oJx8WpgOr+E69Eip5VP+37gE3ZISHKZS2 /P+YGsVsgKmM8fSVmkHTLqU4DCPGPJ8CaKpO3YHL2QGomIFg0dA9WLGvNQNSvvrV04l/ XvaE1poyfflBZw5OR3F+p388xvm+M/cvwT/OJ8YNxXLbYIda7n+3DeU6I5YW+pILwqI9 YIQw== X-Gm-Message-State: ALyK8tJEkjHbcJebuqz0mUCTNwRlVZaurkYaIKCKaiWD7XYKltmOBd0ZYA2u4WD+cQDNkzgr X-Received: by 10.66.159.102 with SMTP id xb6mr8414867pab.73.1464207217780; Wed, 25 May 2016 13:13:37 -0700 (PDT) Received: from Operationss-MacBook-Pro-4.local ([50.59.9.34]) by smtp.googlemail.com with ESMTPSA id ez6sm14748342pab.12.2016.05.25.13.13.36 for (version=TLSv1/SSLv3 cipher=OTHER); Wed, 25 May 2016 13:13:36 -0700 (PDT) Message-ID: <5746076F.6040403@gobalto.com> Date: Wed, 25 May 2016 13:13:35 -0700 From: Ravi Rangaswamy User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Support for WITH Queries (Common Table Expressions) Content-Type: multipart/alternative; boundary="------------040706080301040309040903" X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org This is a multi-part message in MIME format. --------------040706080301040309040903 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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 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 --------------040706080301040309040903 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit 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 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
--------------040706080301040309040903--