Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hnJHD-0002lQ-KS for pgsql-sql@arkaria.postgresql.org; Tue, 16 Jul 2019 08:57:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hnJHC-0007fK-Bw for pgsql-sql@arkaria.postgresql.org; Tue, 16 Jul 2019 08:57:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hnJHC-0007fD-0a for pgsql-sql@lists.postgresql.org; Tue, 16 Jul 2019 08:57:34 +0000 Received: from mout.kundenserver.de ([212.227.126.133]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1hnJH9-0004vw-8C for pgsql-sql@lists.postgresql.org; Tue, 16 Jul 2019 08:57:32 +0000 Received: from [10.8.0.6] ([185.40.248.10]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.129]) with ESMTPSA (Nemesis) id 1MY60L-1hx21C0mJZ-00YTdY for ; Tue, 16 Jul 2019 10:57:27 +0200 Subject: Re: how to resolve org.postgresql.util.PSQLException: ERROR: operator does not exist: text = integer? To: pgsql-sql@lists.postgresql.org References: <110414461.528890.1563075361778@mail.yahoo.com> <1846547624.530883.1563075598322@mail.yahoo.com> <40544440.741577.1563178850210@mail.yahoo.com> <768811852.1032981.1563242356010@mail.yahoo.com> <774271584.1091322.1563257675315@mail.yahoo.com> <1984680550.1098414.1563257845450@mail.yahoo.com> <59735533.1068095.1563265280844@mail.yahoo.com> From: Thomas Kellerer Message-ID: Date: Tue, 16 Jul 2019 10:57:25 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 MIME-Version: 1.0 In-Reply-To: <59735533.1068095.1563265280844@mail.yahoo.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:N62besly1yFID103sThsVOC9YRXlhVcjQhOoflaHT5t+aOl81Vm ViuiF2yMxXOpdaZf7bzZ88wjw4oBEpSY2aPHjFh43XhALOrtYb8jGHTDwQR7EfEAUQpjh7j JsSMnl27oDfjg3jj6Kg6sBPMK++M0bY+E2TK0nSWm7fz+FXWfa4Glrh3DAJsg8DyoopBiNP E9Ts0tt0KsTBj9x31ZWiA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:nxeuZVzjS+o=:R/eWRYP6+iOFvO1wYsv4e4 bAMyI1WWmHizxeSwsWTV1lS0f4ufJOf1g+21Yq55+OuMdvdeR/WFFUKLXNVPuNkR1XJx08D8V Etxsm5T7UB1ZQ7FRmY7d0JgyPfPjp5DQR601pJ7Kwio9lMZQJIEsdVL+3cByznu7XfOmwNq1q mgsFEDXpOsMhCE8bc4lsLeBhjaHWVcwKMyWOEE4CnV5/P50f6y35paoItS//luv3ILZQloA6Q bnbi4ZDnnXKYtz9X1lALSAE2t7TibbApDIhML3KXGePpNACZcf1zWq3kWQtO9kRBX0s2iNjjC cbyoq2sPm/n3XKzAQFDlgq9os5yrISmVvnGml8bxC/8giAj/RFf/TXBQg8Arub6Ab4vcJFq8b 6abC6SMq4awP3lzxQlazmPJdXrOg+Z+HlVj6Ot9idINIkGGW6l0klyVPcTkEwTdhraICdDBlp BQmrMGFYNxWfzCJ9Tzt0jy6TtGYlcnL7H62Yykz/hQiNwk1bgg9xIkvUF+6Mq3YqmXIX8nZgG zX710RYB68UfoT01MEnckXZ/d+uuP02SBb0y+AWrYVrYvhDGh6qE//uae7TEeLaXhyn5qeIMw /I9NsrgTlGoeGEjZ3D6MLzb5iqmYh7ghHVNNkpi/a8y4+iXd/jfZTDGYyTgHx/ptVeKQTco9X wbSdgvCUou6hBzEaxKlhLZzRaxhgNtBNviHZCMikW/gAWMSxkovFQKaxHsJ5Lma4cSx6Xempx gHNb4bCNjly9IOSU7Qk6SFLnV1zH+9CYOJdnTZDAKv4r3/s3sU7Dua/TL7A= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Karen Goh schrieb am 16.07.2019 um 10:21: > Can I know which forum to post to cos I think this may be the wrong > forum. Cos it is sql so this forum maybe for sql execute inside the > database. However, I read there is no more jdbc forum, correct me if > I am wrong. While this mailing lists indeed deals with plain SQL topics, your problem is not completely off-topic. But the reason why you don't get help is, that you are not supplying enough information so that we can help you. The code you have shown us, doesn't show the *actual* SQL String that is generated (and send to the database). So it's impossible to know to which parameter the error message refers to Is it the use of "ps2.setInt(1, tutor_id);" or maybe the use of "ps2.setString(2, item)"? It's vital to know how that parameter is used in the actual (generated) SQL query. Given the error message, I assume(!) that the tutor_id is used together with a varchar/text column. However Postgres will refuse to compare integer and string values. That would be similar to writing "someStringVariable.equals(42)" in Java - you wouldn't do that either. So what we need from you in order to be able to help you is: * The actual generated and complete SQL string of the query you are building. Add System.out.println(sql1) to your code and then show us that result * The definition of the table columns that are used together with the parameters (the "?" in the printed SQL string) Thomas Sent with Mozilla Thunderbird