Re: PreparedStatement error for date parameter with overlaps

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: PreparedStatement error for date parameter with overlaps
Дата
Msg-id 26246.1306851022@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: PreparedStatement error for date parameter with overlaps  (Simon Mitchell <simon@jseb.com>)
Ответы Re: PreparedStatement error for date parameter with overlaps  (Simon Mitchell <simon@jseb.com>)
Список 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 по дате отправления:

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: PreparedStatement error for date parameter with overlaps
Следующее
От: Emi Lu
Дата:
Сообщение: "postgresql-9.0-801.jdbc4.jar" Causing "Error committing transaction. Cause: org.postgresql.util.PSQLException: Cannot commit when autoCommit is enabled." Exception