From: | Maciek Sakrejda <msakrejda(at)truviso(dot)com> |
---|---|
To: | Matthias Böhm <fliegenblues(at)gmx(dot)net> |
Cc: | pgsql-jdbc(at)postgresql(dot)org |
Subject: | Re: Bug with PreparedStatements using EXTRACT function |
Date: | 2012-03-28 20:53:34 |
Message-ID: | CAH_hXRY4uCLT9=MJ211Kmu8sLhe4jJ9Ur9M16=aHRfTRQyx18w@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Maciek Sakrejda | 2012-03-28 21:16:45 | Re: oid int issue with CachedRowSet upgrading from JDBC 8.4 to 9.1 |
Previous Message | Dave Cramer | 2012-03-28 18:21:35 | Re: Maven based build and refactoring |