Re: Upgrade to Scientific Linux 6.5 x86_64 breaks query - Mailing list pgsql-jdbc

From John R Pierce
Subject Re: Upgrade to Scientific Linux 6.5 x86_64 breaks query
Date
Msg-id 53D00DF5.3030806@hogranch.com
Whole thread Raw
In response to Re: Upgrade to Scientific Linux 6.5 x86_64 breaks query  (CG <cgg007@yahoo.com>)
List pgsql-jdbc
On 7/23/2014 12:13 PM, CG wrote:
The parenthesis don't work, but if I explicitly cast that second parameter to interval "CAST( $2 AS interval)" I can force it to work. That's not ideal.

I don't think it is the lack of an operator. Timestamptz should not be comparable directly to an interval, right? That's like saying "2 + 2 >= Orange" or "today is greater than a minute". I think something is eating that first "now() -" so that what is being prepared looks like "trans_date between $2 and now()".

The question is what is causing valid SQL, prepared properly on 32bit linux to fail to prepare properly on 64bit linux? Based on that log, it looks like client-side prepare is falling down.

I think I'd try some experiments with  select pg_typeof($1),    passing it your 'interval' value and see what it thinks it is.


test=# select pg_typeof(interval '1 day');
 pg_typeof
-----------
 interval
(1 row)

test=# select pg_typeof('1 day');        
 pg_typeof
-----------
 unknown
(1 row)


-- 
john r pierce                                      37N 122W
somewhere on the middle of the left coast

pgsql-jdbc by date:

Previous
From: John Neal
Date:
Subject: JBDC LDAP support for connection parameters
Next
From: Tom Lane
Date:
Subject: Re: Upgrade to Scientific Linux 6.5 x86_64 breaks query