Re: Bug with PreparedStatements using EXTRACT function
| От | Maciek Sakrejda |
|---|---|
| Тема | Re: Bug with PreparedStatements using EXTRACT function |
| Дата | |
| Msg-id | CAH_hXRY4uCLT9=MJ211Kmu8sLhe4jJ9Ur9M16=aHRfTRQyx18w@mail.gmail.com обсуждение исходный текст |
| Ответ на | Bug with PreparedStatements using EXTRACT function (Matthias Böhm <fliegenblues@gmx.net>) |
| Список | pgsql-jdbc |
That's because the 'date' is not a cast but some sort of type
specification inherent to the expression. I don't understand the
details of the grammar, but you can see this if you try to run it via
PREPARE (the closest language-level thing you can use to JDBC's
parameterized statements):
cqdb=# prepare foo(date) as select extract (year from date '2000-01-01');
PREPARE
cqdb=# prepare bar(date) as select extract (year from date $1);
ERROR: syntax error at or near "$1"
LINE 1: prepare bar(date) as select extract (year from date $1);
^
cqdb=# prepare baz(date) as select extract (year from $1);
PREPARE
cqdb=#
---
Maciek Sakrejda | System Architect | Truviso
1065 E. Hillsdale Blvd., Suite 215
Foster City, CA 94404
(650) 242-3500 Main
www.truviso.com
В списке pgsql-jdbc по дате отправления: