Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XAhLS-0005Kq-1h for pgsql-jdbc@arkaria.postgresql.org; Fri, 25 Jul 2014 15:23:43 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XAhLR-0002uN-CF for pgsql-jdbc@arkaria.postgresql.org; Fri, 25 Jul 2014 15:23:41 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XAhLQ-0002uH-1R for pgsql-jdbc@postgresql.org; Fri, 25 Jul 2014 15:23:40 +0000 Received: from nm34.bullet.mail.ne1.yahoo.com ([98.138.229.27]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XAhLK-0007T9-Gy for pgsql-jdbc@postgresql.org; Fri, 25 Jul 2014 15:23:37 +0000 Received: from [127.0.0.1] by nm34.bullet.mail.ne1.yahoo.com with NNFMP; 25 Jul 2014 15:23:33 -0000 Received: from [98.138.100.117] by nm34.bullet.mail.ne1.yahoo.com with NNFMP; 25 Jul 2014 15:20:45 -0000 Received: from [66.196.81.174] by tm108.bullet.mail.ne1.yahoo.com with NNFMP; 25 Jul 2014 15:20:45 -0000 Received: from [98.139.212.247] by tm20.bullet.mail.bf1.yahoo.com with NNFMP; 25 Jul 2014 15:20:44 -0000 Received: from [127.0.0.1] by omp1056.mail.bf1.yahoo.com with NNFMP; 25 Jul 2014 15:20:44 -0000 X-Yahoo-Newman-Property: ymail-4 X-Yahoo-Newman-Id: 759592.67110.bm@omp1056.mail.bf1.yahoo.com Received: (qmail 34120 invoked by uid 60001); 25 Jul 2014 15:20:44 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1406301644; bh=9AmGYN0sep8ej21OjvRauW/xVCoS4NJVTr31thaPOLQ=; h=References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=TWK2E8IcDmDQ2VylOtyy4nDWcbjMiAk6Syngb5+la1bxzMTs8y8SOz6Lc/ve/3Eihttye93nTnq13xj0P75N+5OzsXeL+fujwwUTWkCaQyjFjbVvk6uOY0Es4sWGnuqLW2oyihrHvrAFtNDRCm6g1qnNLfjaAEEOwvKVJoksq7o= X-YMail-OSG: PUI7Aj4VM1mjQ_ImAQ9PR3x38dL9UBuhvxvQL99cb8BgOn1 tVs.GN81e.JiLO8ws6zjOAkz0VHvu38X8W3jFl7UJ5xr1qPl17TOsY8ex58h HgEVVYgKIrtcUmrmACZ6UMRDHu.512WGRbhS2_esm9eTTMFJAVgrc1YIi6B_ FcPaSqGZN4yfoCmirwkXfM965XtvFJqqJOjoc7Vmi22pyktYnO9yRjYK6r_2 hgaZ5ckMpzRp8Go3_oZ_1awZV3J74VLOcNTYD75DO5Ar5Az8y9oywhbur.xO cf4.hyNdbhv73rfeJBpCqCBah1.nT1lBs5nv87hEJXnuk2dFRpqEkLKcmDzp LQwIjoihSGflPfwdeVFHs9RXgNoT9ylmjq_Nd7mHG3i4JgF1wXJETZjhI1wg gmUlWfj9MePSKy3VLFrkMunGy5LIzWIeNQayCseB4166t_p.7KlwVg2Q6Oi5 mw7kDcDbAzwgrMqrLhhNtr.jzpAZz9Aj9_BcLfOLJC4n1qu2gRaRsnDNbnrg QkQpWW.JtTru3DSanI3yd1Om.UB5BGmTYI5Er22wxckij8NirypYj1kHzfOV WfaIOOsLVMj8BIiqXlx4x..Lf_3b3BbQKH5NVKqtdOj0YGUZ4GAe43crLAw- - Received: from [207.156.55.2] by web162906.mail.bf1.yahoo.com via HTTP; Fri, 25 Jul 2014 08:20:44 PDT X-Rocket-MIMEInfo: 002.001, QFRvbSA6IERpZ2dpbmcgYXJvdW5kIGluIHRoZSBKREJDIG91dHB1dCBsb2dzLCBJIGhhdmUgY29uZmlybWVkIHRoYXQgYm90aCAzMmJpdCBhbmQgNjRiaXQgc2VydmVycyBhcmUgdXNpbmcgcHJvdG9jb2wgdmVyc2lvbiAzIHRvIGNvbW11bmljYXRlIHdpdGggb3VyIFBvc3RncmVTUUwgc2VydmVyLiBBbHNvLCB3ZSd2ZSBiZWVuIHZlcnkgbWV0aG9kaWNhbCB0byBrZWVwIHRoZSBlbnZpcm9ubWVudCBhcy1zYW1lLWFzLXBvc3NpYmxlIGJldHdlZW4gdGhlIHNlcnZlcnMuIEFsbCB0aGUgYXJ0aWZhY3RzIGFuZCABMAEBAQE- X-Mailer: YahooMailWebService/0.8.196.685 References: <1406131842.96108.YahooMailNeo@web162901.mail.bf1.yahoo.com> <1406142837.33674.YahooMailNeo@web162903.mail.bf1.yahoo.com> Message-ID: <1406301644.98332.YahooMailNeo@web162906.mail.bf1.yahoo.com> Date: Fri, 25 Jul 2014 08:20:44 -0700 From: CG Reply-To: CG Subject: Re: Upgrade to Scientific Linux 6.5 x86_64 breaks query To: Dave Cramer Cc: "pgsql-jdbc@postgresql.org" In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="-1372000244-172904144-1406301644=:98332" X-Pg-Spam-Score: -1.5 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org ---1372000244-172904144-1406301644=:98332 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable @Tom : Digging around in the JDBC output logs, I have confirmed that both 3= 2bit and 64bit servers are using protocol version 3 to communicate with our= PostgreSQL server. Also, we've been very methodical to keep the environmen= t as-same-as-possible between the servers. All the artifacts and configs we= re copied over unchanged.=0A=0A=0A@Dave : As you suggest, my next steps are= going to be trying to create the simplest example that can repeatably demo= nstrate the problem.=A0=0A=0APsql is fine. "PREPARE foo (interval) AS SELEC= T * FROM t_vectors WHERE trans_date BETWEEN now() - $1 AND now();" executes= as expected.=0A=0AThe full application environment has quite a few working= parts. On one side, we're using MyBatis 2.3.5 to handle data access at the= code level. On the other side is Tomcat's JNDI connection pooling. Right i= n the middle is the PostgreSQL JDBC driver. My gut says there's something u= p with JDBC client-side prepare, but I'll start by eliminating MyBatis and = connection pooling so I'm not pointing my finger at the wrong thing.=0A=0AI= 'll be back with some more data soon! Thanks all.=0A=0ACG=0A=0A=0AOn Thursd= ay, July 24, 2014 8:09 AM, Dave Cramer wrote:=0A =0A=0A= =0ADo you still have access to the 32 bit system?=0A=0AI'd be curious what = happens if you try preparing a statement on each that just has the between= =A0=0A=0Aso prepare foo (interval) as select * from xxx where trans_date be= tween now()-?=0A=0Ausing psql ?=0A=0A=0ADave Cramer=0A=0Adave.cramer(at)cre= dativ(dot)ca=0Ahttp://www.credativ.ca=0A=0A=0A=0AOn 23 July 2014 15:13, CG = wrote:=0A=0A=0A>=0A>I can change the SQL statement aroun= d to get it to run.=A0=0A>=0A>=0A>The parenthesis don't work, but if I expl= icitly cast that second parameter to interval "CAST( $2 AS interval)" I can= force it to work. That's not ideal.=0A>=0A>=0A>I don't think it is the lac= k of an operator. Timestamptz should not be comparable directly to an inter= val, right? That's like saying "2 + 2 >=3D Orange" or "today is greater tha= n a minute". I think something is eating that first "now() -" so that what = is being prepared looks like "trans_date between $2 and now()".=0A>=0A>=0A>= 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 li= ke client-side prepare is falling down.=0A>=0A>=0A>=0A>On Wednesday, July 2= 3, 2014 1:49 PM, Dave Cramer wrote:=0A> =0A>=0A>=0A>The = crux of the problem is this: =A0ERROR: operator does not exist: timestamp w= ith time zone >=3D interval=0A>=0A>=0A>which appears to be caused by=A0tran= s_date between now() - $2 and now()=0A>=0A>=0A>What happens if you change i= t to :=0A>=0A>=0A>trans_date between (now() - $2) and now()=0A>=0A>=0A>=0A>= =0A>=0A>=0A>=0A>Dave Cramer=0A>=0A>dave.cramer(at)credativ(dot)ca=0A>http:/= /www.credativ.ca=0A>=0A>=0A>=0A>On 23 July 2014 12:10, CG wrote:=0A>=0A>Using PostgreSQL 9.1.3; JDBC3 driver (tried several version= s-- all suffer from the same issue); MyBatis 2.3.5=A0=0A>>=0A>>We're migrat= ing our app to a virtualized 64bit Linux server from a virtualized 32bit Li= nux server, same farm. What worked fine on 32bit Scientific Linux breaks on= 64bit... Same JVM version (although we tried 64 and 32 bit JVM both with s= ame issue). We've done our best to make sure the ONLY thing different is th= e 64bit OS. Hitting the same 9.1.3 back end...=0A>>=0A>>We've been sifting = through everything and we can't conceive of what could possibly cause this = problem. Also, this query runs fine on other platforms.=0A>>=0A>>Maybe you = can see something I can't:=0A>>=0A>>10:02:40.596 (2) =A0<=3DBE ReadyForQuer= y(I)=0A>>10:02:40.601 (2) simple execute, handler=3Dorg.postgresql.jdbc2.Ab= stractJdbc2Statement$StatementResultHandler@1792d2c, maxRows=3D0, fetchSize= =3D0, flags=3D1=0A>>10:02:40.601 (2) =A0FE=3D> Bind(stmt=3DS_1,portal=3Dnul= l)=0A>>10:02:40.601 (2) =A0FE=3D> Execute(portal=3Dnull,limit=3D0)=0A>>10:0= 2:40.601 (2) =A0FE=3D> Parse(stmt=3Dnull,query=3D" =A0 =A0 =A0select =A0 = =A0t_uuid as t_uuid, =A0 =A0last(latitude) as latitude, =A0 =A0last(longitu= de) as longitude, =A0 =A0last(trans_date) as trans_date, =A0 =A0last(speed)= as speed, =A0 =A0last(direction) as direction, =A0 =A0last(revision) as re= vision =A0 from ( =A0 =A0 =A0 SELECT =A0 =A0 trans_date, =A0 =A0 t_uuid, = =A0 =A0 latitude, =A0 =A0 longitude, =A0 =A0 speed, =A0 =A0 direction, =A0 = =A0 revision =A0 =A0FROM =A0 =A0 t_vectors =A0 =A0WHERE =A0 =A0 group_uuid = =3D $1 =A0 =A0 and trans_date between now() - $2 and now() =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 AND =A0 =A0 =A0 t_uuid in =A0 =A0 =A0 =A0( =A0 = =A0 =A0 =A0$3 =A0 =A0 =A0 , =A0 =A0 =A0 =A0$4 =A0 =A0 =A0 ,=0A =A0 =A0 =A0 = =A0$5 =A0 =A0 =A0 , =A0 =A0 =A0 =A0$6 =A0 =A0 =A0 , =A0 =A0 =A0 =A0$7 =A0 = =A0 =A0 , =A0 =A0 =A0 =A0$8 =A0 =A0 =A0 , =A0 =A0 =A0 =A0$9 =A0 =A0 =A0 , = =A0 =A0 =A0 =A0$10 =A0 =A0 =A0 , =A0 =A0 =A0 =A0$11 =A0 =A0 =A0 , =A0 =A0 = =A0 =A0$12 =A0 =A0 =A0 , =A0 =A0 =A0 =A0$13 =A0 =A0 =A0 , =A0 =A0 =A0 =A0$1= 4 =A0 =A0 =A0 , =A0 =A0 =A0 =A0$15 =A0 =A0 =A0 , =A0 =A0 =A0 =A0$16 =A0 =A0= =A0 , =A0 =A0 =A0 =A0$17 =A0 =A0 =A0 , =A0 =A0 =A0 =A0$18 =A0 =A0 =A0 , = =A0 =A0 =A0 =A0$19 =A0 =A0 =A0 , =A0 =A0 =A0 =A0$20 =A0 =A0 =A0 , =A0 =A0 = =A0 =A0$21 =A0 =A0 =A0 , =A0 =A0 =A0 =A0$22 =A0 =A0 =A0 ,=0A =A0 =A0 =A0 = =A0$23 =A0 =A0 =A0 , =A0 =A0 =A0 =A0$24 =A0 =A0 =A0 , =A0 =A0 =A0 =A0$25 = =A0 =A0 =A0 ,=0A>>=A0 =A0 $26 =A0 =A0 =A0 , =A0 =A0 =A0 =A0$27 =A0 =A0 =A0 = , =A0 =A0 =A0 =A0$28 =A0 =A0 =A0 , =A0 =A0 =A0 =A0$29 =A0 =A0 =A0 , =A0 =A0= =A0 =A0$30 =A0 =A0 =A0 , =A0 =A0 =A0 =A0$31 =A0 =A0 =A0 , =A0 =A0 =A0 =A0$= 32 =A0 =A0 =A0 , =A0 =A0 =A0 =A0$33 =A0 =A0 =A0 , =A0 =A0 =A0 =A0$34 =A0 = =A0 =A0 , =A0 =A0 =A0 =A0$35 =A0 =A0 =A0 , =A0 =A0 =A0 =A0$36 =A0 =A0 =A0 ,= =A0 =A0 =A0 =A0$37 =A0 =A0 =A0 , =A0 =A0 =A0 =A0$38 =A0 =A0 =A0 , =A0 =A0 = =A0 =A0$39 =A0 =A0 =A0 , =A0 =A0 =A0 =A0$40 =A0 =A0 =A0 , =A0 =A0 =A0 =A0$4= 1 =A0 =A0 =A0 , =A0 =A0 =A0 =A0$42 =A0 =A0 =A0 , =A0 =A0 =A0 =A0$43 =A0 =A0= =A0 , =A0=0A =A0 =A0 =A0$44 =A0 =A0 =A0 , =A0 =A0 =A0 =A0$45 =A0 =A0 =A0 ,= =A0 =A0 =A0 =A0$46 =A0 =A0 =A0 , =A0 =A0 =A0 =A0$47 =A0 =A0 =A0 , =A0 =A0 = =A0 =A0$48 =A0 =A0 =A0 , =A0 =A0 =A0 =A0$49 =A0 =A0 =A0 ) =A0 =A0 =A0 =A0 = =A0 =A0 =A0 order by =A0 =A0 trans_date asc =A0 =A0 =A0 ) foo =A0 group by = =A0 =A0t_uuid =A0",oids=3D{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,= 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0})=0A>>10:02:40.601 (2) = =A0FE=3D> Bind(stmt=3Dnull,portal=3Dnull,$1=3D<394fa90e-75a3-4dd1-9205-3414= 09bcba4b>,$2=3D<0 years 0 mons 0 days 1 hours 0 mins 0.00=0A>>=0A=A0secs>,$= 3=3D,$4=3D<3552acd6-e294-4d88-bd67-a8= 56b4f5965c>,$5=3D<881d0513-37b9-4935-8051-b66552bada74>,$6=3D,$7=3D,$8=3D<= 13c75de7-1e73-4dcd-906b-cee83ee0212e>,$9=3D<362d4c76-c09d-4e4f-8c05-821e9d4= 6ba83>,$10=3D<76e02c3d-c108-443a-9cb3-6a1e138f00c6>,$11=3D,$12=3D<197c368a-669c-4d44-867b-6382726bae99>,$13=3D<8= ae1f446-8364-4061-a89e-0058735cd35a>,$14=3D,$15=3D<7a4777eb-3767-43f8-9d67-f1caf3eff2b4>,$16=3D,$17=3D<8f4c2594-b368-43d2-8a27-8af24dc92512>,$18=3D<1= 0ad0508-9eca-47e3-96f5-99745fbdcede>,$19=3D<112944c7-eef0-49c3-af79-9b54b48= 4ca0c>,$20=3D,$21=3D,$22=3D<3448505e-b740-4084-8=0A91e-e2ff34c3754f>,$23= =3D<8a3b486d-5e41-46e1-99fa-51f4f38af2fa>,$24=3D,$25=3D<12a70091-0853-44=0A>>99-8f05-d80e3045ce5e>,$26=3D,$27=3D<5b41b6cb-de51-40ff-8488-7f3403b1f0a8= >,$28=3D<83a3fe9b-cfb5-4908-b5fb-5b32a7be5eb1>,$29=3D<0a963150-eea0-4396-aa= 2a-9319ca9c9866>,$30=3D<0346505e-98be-4585-aeea-3b38df4a56a2>,$31=3D<069bf5= 4d-c230-4bef-884b-46e54e28c65e>,$32=3D<8286bd41-ccd1-47bd-a1aa-1631d3ccbd56= >,$33=3D,$34=3D<72f2af01-c359-45f9-bb= 20-37c7479869f3>,$35=3D<0143076a-3f9e-487d-bdec-c1a6a110f748>,$36=3D<2bc64e= 73-c771-43c8-aa83-b11059512a0f>,$37=3D,$38=3D<3c43a0dd-292a-44cc-a097-ab2f77757d25>,$39=3D<8b84e953-d6a9-42ae-9c= aa-481c164354db>,$40=3D<26d842b6-71e2-438f-a147-e18d102d21d5>,$41=3D,$42=3D,$43=3D,$44=3D,$45=3D<70d=0A2924f-c8cb-4594-a67b-261ca300406e>,$46=3D<60a= d8ae8-4722-4a02-8d4f-88a0052299fc>,$47=3D<350558cc-e56f-4fb2-86f8-3d3252b56= bce>=0A>>=0A>>,$48=3D,$49=3D<2e5ecda2= -bfdd-400a-a48a-e08e07d4ced4>)=0A>>10:02:40.602 (2) =A0FE=3D> Describe(port= al=3Dnull)=0A>>10:02:40.602 (2) =A0FE=3D> Execute(portal=3Dnull,limit=3D0)= =0A>>10:02:40.602 (2) =A0FE=3D> Sync=0A>>10:02:40.604 (2) =A0<=3DBE BindCom= plete [null]=0A>>10:02:40.604 (2) =A0<=3DBE CommandStatus(BEGIN)=0A>>10:02:= 40.607 (2) =A0<=3DBE ErrorMessage(ERROR: operator does not exist: timestamp= with time zone >=3D interval=0A>>=A0 Hint: No operator matches the given n= ame and argument type(s). You might need to add explicit type casts.=0A>>= =A0 Position: 410)=0A>>org.postgresql.util.PSQLException: ERROR: operator d= oes not exist: timestamp with time zone >=3D interval=0A>>=A0 Hint: No oper= ator matches the given name and argument type(s). You might need to add exp= licit type casts.=0A>>=A0 Position: 410=0A>>=A0 =A0 =A0 =A0 at org.postgres= ql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:15= 92)=0A>>=A0 =A0 =A0 =A0 at org.postgresql.core.v3.QueryExecutorImpl.process= Results(QueryExecutorImpl.java:1327)=0A>>=A0 =A0 =A0 =A0 at org.postgresql.= core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:192)=0A>>=A0 =A0 = =A0 =A0 at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc= 2Statement.java:451)=0A>>=A0 =A0 =A0 =A0 at org.postgresql.jdbc2.AbstractJd= bc2Statement.executeWithFlags(AbstractJdbc2Statement.java:350)=0A>>=A0 =A0 = =A0 =A0 at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc= 2Statement.java:343)=0A>>=A0 =A0 =A0 =A0 at org.apache.tomcat.dbcp.dbcp.Del= egatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)=0A>>= =A0 =A0 =A0 =A0 at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.= execute(DelegatingPreparedStatement.java:172)=0A>>=A0 =A0 =A0 =A0 at com.ib= atis.sqlmap.engine.execution.DefaultSqlExecutor.executeQuery(DefaultSqlExec= utor.java:183)=0A>>=A0 =A0 =A0 =A0 at com.ibatis.sqlmap.engine.mapping.stat= ement.MappedStatement.sqlExecuteQuery(MappedStatement.java:221)=0A>>=A0 =A0= =A0 =A0 at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.exec= uteQueryWithCallback(MappedStatement.java:189)=0A>>=A0 =A0 =A0 =A0 at com.i= batis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForList(M= appedStatement.java:139)=0A>>=A0 =A0 =A0 =A0 at com.ibatis.sqlmap.engine.im= pl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:578)=0A>= >=A0 =A0 =A0 =A0 at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.qu= eryForList(SqlMapExecutorDelegate.java:552)=0A>>=A0 =A0 =A0 =A0 at com.ibat= is.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java= :118)=0A>>=A0 =A0 =A0 =A0 at com.foo.service.db.ibatis.lib.SqlMapExecutor.q= ueryForList(SqlMapExecutor.java:139)=0A>>=A0 =A0 =A0 =A0 at com.foo.service= .db.ibatis.DepDaoIbatis.usersList(DepDaoIbatis.java:3352)=0A>>=A0 =A0 =A0 = =A0 at com.foo.util.Util.fetchSettings(Util.java:109)=0A>>=A0 =A0 =A0 =A0 a= t com.foo.util.Util.fetchUpdates(Util.java:221)=0A>>=A0 =A0 =A0 =A0 at com.= foo.util.Util.fetchInit(Util.java:168)=0A>>=A0 =A0 =A0 =A0 at com.foo.servi= ce.process.InitProcessor.process(InitProcessor.java:57)=0A>>=A0 =A0 =A0 =A0= at com.foo.service.process.InitProcessor.process(InitProcessor.java:29)=0A= >>=A0 =A0 =A0 =A0 at com.foo.service.scaffolding.AbstractProcessor.process(= AbstractProcessor.java:55)=0A>>=A0 =A0 =A0 =A0 at com.foo.service.scaffoldi= ng.AbstractProcessor.process(AbstractProcessor.java:28)=0A>>=A0 =A0 =A0 =A0= at com.restservice.process.AuthenticatedProcessor.process(AuthenticatedPro= cessor.java:38)=0A>>=A0 =A0 =A0 =A0 at com.restservice.process.Authenticate= dProcessor.process(AuthenticatedProcessor.java:12)=0A>>=A0 =A0 =A0 =A0 at c= om.restservice.process.SerializedProcessor.processRequest(SerializedProcess= or.java:74)=0A>>=A0 =A0 =A0 =A0 at com.restservice.process.SerializedProces= sor.process(SerializedProcessor.java:59)=0A>>=A0 =A0 =A0 =A0 at com.restser= vice.RestService.process(RestService.java:224)=0A>>=A0 =A0 =A0 =A0 at com.r= estservice.RestService.processWrapper(RestService.java:122)=0A>>=A0 =A0 =A0= =A0 at com.restservice.RestService.doPost(RestService.java:101)=0A>>=A0 = =A0 =A0 =A0 at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)= =0A>>=A0 =A0 =A0 =A0 at javax.servlet.http.HttpServlet.service(HttpServlet.= java:727)=0A>>=A0 =A0 =A0 =A0 at org.apache.catalina.core.ApplicationFilter= Chain.internalDoFilter(ApplicationFilterChain.java:303)=0A>>=A0 =A0 =A0 =A0= at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil= terChain.java:208)=0A>>=A0 =A0 =A0 =A0 at org.apache.catalina.filters.SetCh= aracterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)=0A>>=A0= =A0 =A0 =A0 at org.apache.catalina.core.ApplicationFilterChain.internalDoF= ilter(ApplicationFilterChain.java:241)=0A>>=A0 =A0 =A0 =A0 at org.apache.ca= talina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208= )=0A>>=A0 =A0 =A0 =A0 at com.foo.util.GZIPFilter.doFilter(GZIPFilter.java:3= 3)=0A>>=A0 =A0 =A0 =A0 at org.apache.catalina.core.ApplicationFilterChain.i= nternalDoFilter(ApplicationFilterChain.java:241)=0A>>=A0 =A0 =A0 =A0 at org= .apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChai= n.java:208)=0A>>=A0 =A0 =A0 =A0 at org.apache.catalina.core.StandardWrapper= Valve.invoke(StandardWrapperValve.java:220)=0A>>=A0 =A0 =A0 =A0 at org.apac= he.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)= =0A>>=A0 =A0 =A0 =A0 at org.apache.catalina.authenticator.AuthenticatorBase= .invoke(AuthenticatorBase.java:501)=0A>>=A0 =A0 =A0 =A0 at org.apache.catal= ina.core.StandardHostValve.invoke(StandardHostValve.java:171)=0A>>=A0 =A0 = =A0 =A0 at com.googlecode.psiprobe.Tomcat70AgentValve.invoke(Tomcat70AgentV= alve.java:38)=0A>>=A0 =A0 =A0 =A0 at org.apache.catalina.valves.ErrorReport= Valve.invoke(ErrorReportValve.java:102)=0A>>=A0 =A0 =A0 =A0 at org.apache.c= atalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)=0A>>=A0 =A0 = =A0 =A0 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngi= neValve.java:116)=0A>>=A0 =A0 =A0 =A0 at org.apache.catalina.connector.Coyo= teAdapter.service(CoyoteAdapter.java:408)=0A>>=A0 =A0 =A0 =A0 at org.apache= .coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java= :1040)=0A>>=A0 =A0 =A0 =A0 at org.apache.coyote.AbstractProtocol$AbstractCo= nnectionHandler.process(AbstractProtocol.java:607)=0A>>=A0 =A0 =A0 =A0 at o= rg.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:= 314)=0A>>=A0 =A0 =A0 =A0 at java.util.concurrent.ThreadPoolExecutor$Worker.= runTask(ThreadPoolExecutor.java:886)=0A>>=A0 =A0 =A0 =A0 at java.util.concu= rrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)=0A>>=A0 = =A0 =A0 =A0 at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.r= un(TaskThread.java:61)=0A>>=A0 =A0 =A0 =A0 at java.lang.Thread.run(Thread.j= ava:662)=0A>>=0A>>=0A>>--=0A>>Sent via pgsql-jdbc mailing list (pgsql-jdbc@= postgresql.org)=0A>>To make changes to your subscription:=0A>>http://www.po= stgresql.org/mailpref/pgsql-jdbc=0A>>=0A>=0A>=0A> ---1372000244-172904144-1406301644=:98332 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
@Tom : Digging around in the JDBC output logs, = I have confirmed that both 32bit and 64bit servers are using protocol versi= on 3 to communicate with our PostgreSQL server. Also, we've been very metho= dical to keep the environment as-same-as-possible between the servers. All = the artifacts and configs were copied over unchanged.

<= /div>
@Dave : As you suggest, my next steps are going to be trying to cr= eate the simplest example that can repeatably demonstrate the problem. = ;

Psql is fine. "PREPARE foo (interval) AS SELECT * FROM t_vectors WHERE = trans_date BETWEEN now() - $1 AND now();" executes as expected.

The full = application environment has quite a few working parts. On one side, we're u= sing MyBatis 2.3.5 to handle data access at the code level. On the other side is Tomcat's JNDI connecti= on pooling. Right in the middle is the PostgreSQL JDBC driver. My gut says = there's something up with JDBC client-side prepare, but I'll start by elimi= nating MyBatis and connection pooling so I'm not pointing my finger at the = wrong thing.

I'll be back with some more data soon! Thanks all.

CG


On Thursday, = July 24, 2014 8:09 AM, Dave Cramer <pg@fastcrypt.com> wrote:


Do you still have access to the 32 bit system?

= I'd be curious what happens if you try preparing a statement on each that j= ust has the between 

so prepare foo (in= terval) as select * from xxx where trans_date between now()-?
=0A=0A
using psql ?
=0A

Dave = Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca
=0A

On 23 July 2014 1= 5:13, CG <cgg007@yahoo.com> wrote:
=0A= =0A

=0A=0AI can change the SQL statement around to get it to run.&= nbsp;

=0A=0AThe parent= hesis don't work, but if I explicitly cast that second parameter to interva= l "CAST( $2 AS interval)" I can force it to work. That's not ideal.
=0A=0A
I don= 't think it is the lack of an operator. Timestamptz should not be comparabl= e directly to an interval, right? That's like saying "2 + 2 >=3D Orange"= or "today is greater than a minute". I think something is eating that firs= t "now() -" so that what is being prepared looks like "trans_date between $= 2 and now()".
=0A=0A
=0A=0AThe question is what is causing valid SQL, prepared p= roperly on 32bit linux to fail to prepare properly on 64bit linux? Based on= that log, it looks like client-side prepare is falling down.


= =0A=0A
=0A=0A
On Wednesday, July 23, 2014 1:49 PM, Dave Cramer <pg@fastc= rypt.com> wrote:


=0A=0A
The crux of the problem is this:  ERROR: operat= or does not exist: timestamp with time zone >=3D=0A interval

=0A=0A
which = appears to be caused by trans_date between now() - $2 and now()

=0A=0A=0A=0A
What happens if you change it to :
trans_date between (now() - $2) and now()
=0A= =0A=0A=0A



Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca
=0A=0A=0A=0A
=0A

=0A=0AUsing = PostgreSQL 9.1.3; JDBC3 driver (tried several versions-- all suffer from th= e same issue); MyBatis 2.3.5 
= =0A
=0AWe're migrating our app to a= virtualized 64bit Linux server from a virtualized 32bit Linux server, same= farm. What worked fine on 32bit Scientific Linux breaks on 64bit... Same J= VM version (although we tried 64 and 32 bit JVM both with same issue). We'v= e done our best to make sure the ONLY thing different is the 64bit OS. Hitt= ing the same 9.1.3 back end...
=0A= =0A=0A=0A=0A
=0AWe've been sifting = through everything and we can't conceive of what could possibly cause this = problem. Also, this query runs fine on other platforms.
=0A
=0AMaybe y= ou can see something I can't:
=0A=0A10:02:40.596 (2)  <=3DBE = ReadyForQuery(I)
=0A10:02:40.601 (2= ) simple execute, handler=3Dorg.postgresql.jdbc2.AbstractJdbc2Statement$Sta= tementResultHandler@1792d2c, maxRows=3D0, fetchSize=3D0, flags=3D1
=0A10:02:40.601 (2)  FE=3D> Bind(st= mt=3DS_1,portal=3Dnull)
=0A10:02:40= .601 (2)  FE=3D> Execute(portal=3Dnull,limit=3D0)
=0A10:02:40.601 (2)  FE=3D> Parse(stmt=3Dnul= l,query=3D"      select    t_uuid as t_uuid,  = ;  last(latitude) as latitude,    last(longitude) as longitu= de,    last(trans_date) as trans_date,    last(speed) a= s speed,    last(direction) as direction,    last(revis= ion) as revision   from (       SELECT     tr= ans_date,     t_uuid,     latitude,     longi= tude,     speed,     direction,     revision =    FROM     t_vectors    WHERE     = group_uuid =3D $1     and trans_date between now() - $2 and now()=                     &nbs= p; AND       t_uuid in        (   &= nbsp;    $3       ,        $4 =       ,=0A        $5      = ; ,        $6       ,     &nbs= p;  $7       ,        $8   &nb= sp;   ,        $9       ,   &n= bsp;    $10       ,        $11=       ,        $12      = ,        $13       ,     &nbs= p;  $14       ,        $15   &= nbsp;   ,        $16       ,  =      $17       ,        = $18       ,        $19     &nb= sp; ,        $20       ,     &= nbsp;  $21       ,        $22  = ;     ,=0A        $23       , =        $24       ,       =  $25       ,
= =0A=0A=0A    $26       ,       &nbs= p;$27       ,        $28     &= nbsp; ,        $29       ,    =    $30       ,        $31 &nb= sp;     ,        $32       , &= nbsp;      $33       ,       &= nbsp;$34       ,        $35    = ;   ,        $36       ,   &nb= sp;    $37       ,        $38 =       ,        $39       = ,        $40       ,      = ;  $41       ,        $42   &n= bsp;   ,        $43       ,  = =0A      $44       ,       &nb= sp;$45       ,        $46     =   ,        $47       ,    = ;    $48       ,        $49 &n= bsp;     )               order= by     trans_date asc       ) foo   group by=    t_uuid  ",oids=3D{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,= 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0})
=0A=0A=0A=0A=0A10:02:40.601 (2)  FE=3D> = Bind(stmt=3Dnull,portal=3Dnull,$1=3D<394fa90e-75a3-4dd1-9205-341409bcba4= b>,$2=3D<0 years 0 mons 0 days 1 hours 0 mins 0.00
=0A secs>,$3=3D<cdd1aa29-48ae-4a8d-8= 84f-43ea795defde>,$4=3D<3552acd6-e294-4d88-bd67-a856b4f5965c>,$5= =3D<881d0513-37b9-4935-8051-b66552bada74>,$6=3D<fa21ec58-47e7-478a= -b8b0-42a937200e70>,$7=3D<ec909e6b-c214-4fbe-aea0-9baf4a33b54a>,$8= =3D<13c75de7-1e73-4dcd-906b-cee83ee0212e>,$9=3D<362d4c76-c09d-4e4f= -8c05-821e9d46ba83>,$10=3D<76e02c3d-c108-443a-9cb3-6a1e138f00c6>,$= 11=3D<dbc8ee6d-b04d-4f48-90a3-b2a2bbd5de6e>,$12=3D<197c368a-669c-4= d44-867b-6382726bae99>,$13=3D<8ae1f446-8364-4061-a89e-0058735cd35a>= ;,$14=3D<fd148cc9-4b13-4773-9b7b-d5f2d1ca3a00>,$15=3D<7a4777eb-376= 7-43f8-9d67-f1caf3eff2b4>,$16=3D<f526b7ee-7823-4e4b-8bd5-dca091ca6aea= >,$17=3D<8f4c2594-b368-43d2-8a27-8af24dc92512>,$18=3D<10ad0508-= 9eca-47e3-96f5-99745fbdcede>,$19=3D<112944c7-eef0-49c3-af79-9b54b484c= a0c>,$20=3D<da94401d-10c5-4607-9b09-fa2202bba846>,$21=3D<ce9a4d= dd-3c47-4bb9-af55-4d0c6c0600f8>,$22=3D<3448505e-b740-4084-8=0A91e-e2f= f34c3754f>,$23=3D<8a3b486d-5e41-46e1-99fa-51f4f38af2fa>,$24=3D<= a3260ac3-3811-4857-95a6-2cbcd1f8119b>,$25=3D<12a70091-0853-44
=0A=0A=0A99-8f05-d80e3045ce5e>,$26=3D&l= t;e21a63e8-2835-4942-9a9e-18e1310a74e6>,$27=3D<5b41b6cb-de51-40ff-848= 8-7f3403b1f0a8>,$28=3D<83a3fe9b-cfb5-4908-b5fb-5b32a7be5eb1>,$29= =3D<0a963150-eea0-4396-aa2a-9319ca9c9866>,$30=3D<0346505e-98be-458= 5-aeea-3b38df4a56a2>,$31=3D<069bf54d-c230-4bef-884b-46e54e28c65e>,= $32=3D<8286bd41-ccd1-47bd-a1aa-1631d3ccbd56>,$33=3D<f7a3f9e2-e94b-= 4ff7-8b03-4e8549be07cb>,$34=3D<72f2af01-c359-45f9-bb20-37c7479869f3&g= t;,$35=3D<0143076a-3f9e-487d-bdec-c1a6a110f748>,$36=3D<2bc64e73-c7= 71-43c8-aa83-b11059512a0f>,$37=3D<a5b56133-7cd2-476d-bde6-1b8af68bc26= 5>,$38=3D<3c43a0dd-292a-44cc-a097-ab2f77757d25>,$39=3D<8b84e953= -d6a9-42ae-9caa-481c164354db>,$40=3D<26d842b6-71e2-438f-a147-e18d102d= 21d5>,$41=3D<f588610a-507a-4c4c-93bb-a6466ed140ba>,$42=3D<d5a14= 5c8-f8bd-486f-a0d7-f897715915c5>,$43=3D<bd0ed505-27e8-43b4-be4e-664ad= c98a38c>,$44=3D<b0948960-11b7-4bca-9d9c-4f8d7b91962c>,$45=3D<70= d=0A2924f-c8cb-4594-a67b-261ca300406e>,$46=3D<60ad8ae8-4722-4a02-8d4f= -88a0052299fc>,$47=3D<350558cc-e56f-4fb2-86f8-3d3252b56bce>

=0A=0A=0A,$48=3D<de7259b4-e1c8-481c-9043-46f09a0926de>,$= 49=3D<2e5ecda2-bfdd-400a-a48a-e08e07d4ced4>)
=0A10:02:40.602 (2)  FE=3D> Describe(portal=3Dnull= )
=0A10:02:40.602 (2)  FE=3D&g= t; Execute(portal=3Dnull,limit=3D0)
=0A10:02:40.602 (2)  FE=3D> Sync
=0A10:02:40.604 (2)  <=3DBE BindComplete [null]
=0A10:02:40.604 (2)  <=3DBE CommandStat= us(BEGIN)
=0A10:02:40.607 (2)  = ;<=3DBE ErrorMessage(ERROR: operator does not exist: timestamp with time= zone >=3D interval
=0A  Hi= nt: No operator matches the given name and argument type(s). You might need= to add explicit type casts.
=0A&nb= sp; Position: 410)
=0Aorg.postgresq= l.util.PSQLException: ERROR: operator does not exist: timestamp with time z= one >=3D interval
=0A  Hint= : No operator matches the given name and argument type(s). You might need t= o add explicit type casts.
=0A = ; Position: 410
=0A    &n= bsp;   at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorRespons= e(QueryExecutorImpl.java:1592)
=0A&= nbsp;       at org.postgresql.core.v3.QueryExecutorImpl.proc= essResults(QueryExecutorImpl.java:1327)
=0A        at org.postgresql.core.v3.QueryExecuto= rImpl.execute(QueryExecutorImpl.java:192)
=0A        at org.postgresql.jdbc2.AbstractJdbc2= Statement.execute(AbstractJdbc2Statement.java:451)
=0A        at org.postgresql.jdbc2.Abs= tractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:350)
=0A        at org.po= stgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:3= 43)
=0A        = at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.execute(Delegati= ngPreparedStatement.java:172)
=0A&n= bsp;       at org.apache.tomcat.dbcp.dbcp.DelegatingPrepared= Statement.execute(DelegatingPreparedStatement.java:172)
=0A        at com.ibatis.sqlmap.en= gine.execution.DefaultSqlExecutor.executeQuery(DefaultSqlExecutor.java:183)=
=0A        at = com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.sqlExecuteQuery(= MappedStatement.java:221)
=0A =       at com.ibatis.sqlmap.engine.mapping.statement.MappedS= tatement.executeQueryWithCallback(MappedStatement.java:189)
=0A        at com.ibatis.sqlma= p.engine.mapping.statement.MappedStatement.executeQueryForList(MappedStatem= ent.java:139)
=0A    &nbs= p;   at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForL= ist(SqlMapExecutorDelegate.java:578)
=0A        at com.ibatis.sqlmap.engine.impl.SqlMapExe= cutorDelegate.queryForList(SqlMapExecutorDelegate.java:552)
=0A        at com.ibatis.sqlma= p.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118)=0A        at com= .foo.service.db.ibatis.lib.SqlMapExecutor.queryForList(SqlMapExecutor.java:= 139)
=0A       = at com.foo.service.db.ibatis.DepDaoIbatis.usersList(DepDaoIbatis.java:3352= )
=0A        at= com.foo.util.Util.fetchSettings(Util.java:109)
=0A        at com.foo.util.Util.fetchUpdat= es(Util.java:221)
=0A    =     at com.foo.util.Util.fetchInit(Util.java:168)
=0A        at com.foo.service.= process.InitProcessor.process(InitProcessor.java:57)
=0A        at com.foo.service.process= .InitProcessor.process(InitProcessor.java:29)
=0A        at com.foo.service.scaffolding.Ab= stractProcessor.process(AbstractProcessor.java:55)
=0A        at com.foo.service.scaffold= ing.AbstractProcessor.process(AbstractProcessor.java:28)
=0A        at com.restservice.pro= cess.AuthenticatedProcessor.process(AuthenticatedProcessor.java:38)
=0A        at com.rest= service.process.AuthenticatedProcessor.process(AuthenticatedProcessor.java:= 12)
=0A        = at com.restservice.process.SerializedProcessor.processRequest(SerializedPro= cessor.java:74)
=0A    &n= bsp;   at com.restservice.process.SerializedProcessor.process(Serializ= edProcessor.java:59)
=0A  &nbs= p;     at com.restservice.RestService.process(RestService.java:22= 4)
=0A        a= t com.restservice.RestService.processWrapper(RestService.java:122)
=0A        at com.rests= ervice.RestService.doPost(RestService.java:101)
=0A        at javax.servlet.http.HttpServl= et.service(HttpServlet.java:646)
= =0A        at javax.servlet.http.HttpServlet.service(Ht= tpServlet.java:727)
=0A   = ;     at org.apache.catalina.core.ApplicationFilterChain.internal= DoFilter(ApplicationFilterChain.java:303)
=0A        at org.apache.catalina.core.Applicati= onFilterChain.doFilter(ApplicationFilterChain.java:208)
=0A        at org.apache.catalina.= filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java= :108)
=0A       = ; at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appli= cationFilterChain.java:241)
=0A&nbs= p;       at org.apache.catalina.core.ApplicationFilterChain.= doFilter(ApplicationFilterChain.java:208)
=0A        at com.foo.util.GZIPFilter.doFilter(G= ZIPFilter.java:33)
=0A   =     at org.apache.catalina.core.ApplicationFilterChain.internalD= oFilter(ApplicationFilterChain.java:241)
=0A        at org.apache.catalina.core.Applicatio= nFilterChain.doFilter(ApplicationFilterChain.java:208)
=0A        at org.apache.catalina.c= ore.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
=0A        at org.apache.ca= talina.core.StandardContextValve.invoke(StandardContextValve.java:122)
=0A        at org.a= pache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.jav= a:501)
=0A      &nbs= p; at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j= ava:171)
=0A      &n= bsp; at com.googlecode.psiprobe.Tomcat70AgentValve.invoke(Tomcat70AgentValv= e.java:38)
=0A      =   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportVal= ve.java:102)
=0A     = ;   at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve= .java:950)
=0A      =   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngin= eValve.java:116)
=0A    &= nbsp;   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteA= dapter.java:408)
=0A    &= nbsp;   at org.apache.coyote.http11.AbstractHttp11Processor.process(Ab= stractHttp11Processor.java:1040)
= =0A        at org.apache.coyote.AbstractProtocol$Abstra= ctConnectionHandler.process(AbstractProtocol.java:607)
=0A        at org.apache.tomcat.uti= l.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
=0A        at java.util.concur= rent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
=0A        at java.uti= l.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
=0A        at org.= apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:= 61)
=0A        = at java.lang.Thread.run(Thread.java:662)
=0A
=0A
=0A--
=0ASent via= pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
=0ATo make changes to your subscription:<= br clear=3D"none" class=3D"" style=3D"">=0Ahttp://www.postgresql.org/mailpref/pgsql-jdbc=0A



=


---1372000244-172904144-1406301644=:98332--