pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adam Rauch <adam@labkey.com>
To: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Subject: Simple queries with JDBC escaped scalar functions result in exceptions
Date: Fri, 26 Aug 2016 21:31:40 -0700
Message-ID: <02c61eb2-e2da-4e9c-281b-18bf60ea48b1@labkey.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

I upgraded to postgresql-9.4.1209.jar and fixed all the places in our 
code that used JDBC escaped scalar functions (e.g., {fn now()}) inside 
function definitions. However, we continued to see the telltale 
exception (org.postgresql.util.PSQLException: ERROR: syntax error at or 
near "{") when executing straightforward SELECT queries that included 
scalar functions. I tracked this down to comments; a simple repro is to 
execute the following query via JDBC:

    SELECT /* $ */ {fn curdate()}

The original comments included many characters, but the dollar sign 
seems to be the culprit. I think this indicates a problem with the 
parser that's attempting to detect string literals.

Thanks,
Adam

view thread (7+ messages)  latest in thread

Message-ID: <02c61eb2-e2da-4e9c-281b-18bf60ea48b1@labkey.com>
Permalink:  ../02c61eb2-e2da-4e9c-281b-18bf60ea48b1@labkey.com/
Also on:    postgresql.org/message-id/02c61eb2-e2da-4e9c-281b-18bf60ea48b1@labkey.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: adam@labkey.com
  Subject: Re: Simple queries with JDBC escaped scalar functions result in exceptions
  In-Reply-To: <02c61eb2-e2da-4e9c-281b-18bf60ea48b1@labkey.com>
  References: <02c61eb2-e2da-4e9c-281b-18bf60ea48b1@labkey.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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