Re: [GENERAL] Fwd: Query parameter types not recognized

2017-02-13 Thread Roberto Balarezo
Hmmm... I didn't know PostgreSQL had a facility for query logging and debugging of parameters to a logfile. Thought I had to execute a describe or something like that. Thanks, I'll try it to see what's happening! 2017-02-10 16:57 GMT-05:00 Adrian Klaver : > On

Re: [GENERAL] Fwd: Query parameter types not recognized

2017-02-13 Thread Roberto Balarezo
Hi Rob, Thanks for your answer. The query is just an example I made to illustrate the problem. In the database I'm working with, duedate is a timestamp without timezone column, which can contain null values. The parameter is supposed to be of type DATE. From Java, I'm sending a Date object (which

Re: [GENERAL] Fwd: Query parameter types not recognized

2017-02-13 Thread Roberto Balarezo
Hi, The parameter defaultDueDate is a java.sql.Date object, an actual Date. When I run the query with the value in it, it works: ```sql db=> select COALESCE(duedate, date '2017-02-01' + 1) from invoices order by duedate desc; coalesce - 2017-02-02 00:00:00 2017-02-02

Re: [GENERAL] Fwd: Query parameter types not recognized

2017-02-13 Thread Roberto Balarezo
Hi Arjen, I already tried that too. In that case, the error changes to `org.postgresql.util.PSQLException: ERROR: COALESCE types timestamp without time zone and interval cannot be matched`. I listed all the operators available for dates, and `+` and `-` take a date and an integer to return a

Re: [GENERAL] Fwd: Query parameter types not recognized

2017-02-11 Thread Jan de Visser
On Friday, February 10, 2017 6:46:08 PM EST David G. Johnston wrote: > In short - this is the wrong list (pgsql-j...@postgresql.org is the > appropriate one; or the official GitHub repo) and you need to provide some > working self-contained examples showing exactly what you are doing.​​ > > On

Re: [GENERAL] Fwd: Query parameter types not recognized

2017-02-10 Thread David G. Johnston
In short - this is the wrong list (pgsql-j...@postgresql.org is the appropriate one; or the official GitHub repo) and you need to provide some working self-contained examples showing exactly what you are doing.​​ On Fri, Feb 10, 2017 at 8:17 AM, Roberto Balarezo wrote: > Hi,

Re: [GENERAL] Fwd: Query parameter types not recognized

2017-02-10 Thread rob stone
Hello Roberto, On Fri, 2017-02-10 at 16:43 -0500, Roberto Balarezo wrote: > Hi Rob, > > Thanks for your answer. The query is just an example I made to > illustrate the problem. In the database I'm working with, duedate is > a timestamp without timezone column, which can contain null values. > The

Re: [GENERAL] Fwd: Query parameter types not recognized

2017-02-10 Thread Adrian Klaver
On 02/10/2017 02:14 PM, Roberto Balarezo wrote: Hmmm... I didn't know PostgreSQL had a facility for query logging and debugging of parameters to a logfile. Thought I had to execute a describe or something like that. Thanks, I'll try it to see what's happening! Start here:

Re: [GENERAL] Fwd: Query parameter types not recognized

2017-02-10 Thread Adrian Klaver
On 02/10/2017 01:51 PM, Roberto Balarezo wrote: Hi, The parameter defaultDueDate is a java.sql.Date object, an actual Date. When I run the query with the value in it, it works: ```sql db=> select COALESCE(duedate, date '2017-02-01' + 1) from invoices order by duedate desc; coalesce

Re: [GENERAL] Fwd: Query parameter types not recognized

2017-02-10 Thread Adrian Klaver
On 02/10/2017 01:33 PM, Arjen Nienhuis wrote: On Feb 10, 2017 8:11 PM, "Roberto Balarezo" > wrote: Hi, I would like to know why this is happening and some advice if there is a way to solve this problem: I have a query like this:

Re: [GENERAL] Fwd: Query parameter types not recognized

2017-02-10 Thread Arjen Nienhuis
On Feb 10, 2017 8:11 PM, "Roberto Balarezo" wrote: Hi, I would like to know why this is happening and some advice if there is a way to solve this problem: I have a query like this: select COALESCE(duedate, ? + 1) from invoices order by duedate desc limit 10; where ? is a

Re: [GENERAL] Fwd: Query parameter types not recognized

2017-02-10 Thread Adrian Klaver
On 02/10/2017 07:17 AM, Roberto Balarezo wrote: Hi, I would like to know why this is happening and some advice if there is a way to solve this problem: I have a query like this: |select COALESCE(duedate, ? + 1) from invoices order by duedate desc limit 10; | What is the 1 in ? + 1 supposed

Re: [GENERAL] Fwd: Query parameter types not recognized

2017-02-10 Thread rob stone
Hello Roberto, On Fri, 2017-02-10 at 10:17 -0500, Roberto Balarezo wrote: > Hi, I would like to know why this is happening and some advice if > there is a way to solve this problem: > > I have a query like this: > > select COALESCE(duedate, ? + 1) from invoices order by duedate desc > limit 10;

[GENERAL] Fwd: Query parameter types not recognized

2017-02-10 Thread Roberto Balarezo
Hi, I would like to know why this is happening and some advice if there is a way to solve this problem: I have a query like this: select COALESCE(duedate, ? + 1) from invoices order by duedate desc limit 10; where ? is a query parameter. I’m using JDBC to connect to the database, and sending