Re: Upgrade to Scientific Linux 6.5 x86_64 breaks query

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Upgrade to Scientific Linux 6.5 x86_64 breaks query
Date: 2014-07-23 19:33:09
Message-ID: 53D00DF5.3030806@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Tom Lane 2014-07-23 19:39:35 Re: Upgrade to Scientific Linux 6.5 x86_64 breaks query
Previous Message John Neal 2014-07-23 19:25:36 JBDC LDAP support for connection parameters