Re: PreparedStatement error for date parameter with overlaps - Mailing list pgsql-jdbc

From Tom Lane
Subject Re: PreparedStatement error for date parameter with overlaps
Date
Msg-id 26246.1306851022@sss.pgh.pa.us
Whole thread Raw
In response to Re: PreparedStatement error for date parameter with overlaps  (Simon Mitchell <simon@jseb.com>)
Responses Re: PreparedStatement error for date parameter with overlaps  (Simon Mitchell <simon@jseb.com>)
List pgsql-jdbc
Simon Mitchell <simon@jseb.com> writes:
> So from what I understand using the date function in jdbc stuff requires
> brackets like most functions do,
> but the psql is happy for me to use the date function with or without
> brackets.

Craig Ringer already posted a much more long-winded response, but the
short answer is that this syntax is *not* a function.  The SQL spec
defines
        type_name 'literal string'
as a way of writing a literal constant of a specific type.  (The spec
actually only seems to allow this for certain type names, but Postgres
extends that to allow any known type name to be used.)  This is not a
function and it doesn't work for any case except where the second part
is a quoted literal string.  Personally I think it's a wart best
avoided, but we're stuck with supporting it because of the standard.

            regards, tom lane

pgsql-jdbc by date:

Previous
From: Craig Ringer
Date:
Subject: Re: PreparedStatement error for date parameter with overlaps
Next
From: Emi Lu
Date:
Subject: "postgresql-9.0-801.jdbc4.jar" Causing "Error committing transaction. Cause: org.postgresql.util.PSQLException: Cannot commit when autoCommit is enabled." Exception