Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qY9GK-000uTS-Ll for pgsql-general@arkaria.postgresql.org; Mon, 21 Aug 2023 18:04:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qY9GJ-009Qjm-Iy for pgsql-general@arkaria.postgresql.org; Mon, 21 Aug 2023 18:04:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qY9GJ-009QjY-6y for pgsql-general@lists.postgresql.org; Mon, 21 Aug 2023 18:04:22 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qY9GG-000DQf-Dc for pgsql-general@lists.postgresql.org; Mon, 21 Aug 2023 18:04:22 +0000 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1bdcb800594so21226645ad.1 for ; Mon, 21 Aug 2023 11:04:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692641058; x=1693245858; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=+l7X+BQb36R8oXVjM5bIcmVhneB5zT+ytxMaNZjaiZk=; b=EODQMOhRtbTNO7da3cPbbMnepx6NIW7x3+gNn31QNRy3BOQWdAlm0GGU4vMoB8Icjs 5CTqFuXlSdGFgAJt5Hu9pIlU+QGzZRPPnAnRz6lQWYrtHPgZVaD0b0UC8zi3ifvTKXva S9B8657odoBwdaLBJMlynFnKfmGVVr7XPWRbcD6tTVVsTwFbIjBOMnFcmWflDM0/ZyfS eh4lwgyP0HGlXDwC7DxTz9AOBZ/Q1Fya6ejfrHL7KAOKG7JkySxkBbTeGJTaZQQ+rY/b S0WZQjLqdkQAK/s2HQPHzlxEFqTzqRDHXPzl7JoxAloyMlwm/uUDgYwjDovTlPpUhZdZ NEfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692641058; x=1693245858; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=+l7X+BQb36R8oXVjM5bIcmVhneB5zT+ytxMaNZjaiZk=; b=eM6ksbJ3dIb10PPGRiMWHMjj5s/Cljs9LTqA4EPrLwNBBb3S61p0+c7QHIhTE8Bu2h TSYowS6t5n/RVQu2zctZpxLw7jbyPwHOzh2cf3dgf98a9HiUuRyMkvrFysne1H2+bqwf EaeGTCwk8CQpVEOPnljADw0rJroVRMOBgQM/foWFUlmG+hcy+vKJOKmRSLfKRO3fbZpJ AWGFb44awLNHFD9qqJ+wrKvHhY2q0m1mA/rzenoTqnawJi/DPRbC6E7L4dUG7MiILhXG iFHME4SVRfQKrQ6Zh7TjLE0UQYgh7p/hr6l9nX9r6k9Qn5fI8Q3HkvvN8XGQepaMqhEv JXsg== X-Gm-Message-State: AOJu0YyGxwe26A1B+W+V8zB5Vd6p++GWBENOYaWb+T4KGStK6JDf5xuB WBqUUpyXOrz8LMtMAjb/OqRCsjD2R9M= X-Google-Smtp-Source: AGHT+IEyFKMx90mDWeWZ+yV4mw2+CSqqDzifgtO6Kig1yQErkk/bUE1bYg6VON+CWT9+w7EaW21qsQ== X-Received: by 2002:a17:902:c20c:b0:1b8:6cae:4400 with SMTP id 12-20020a170902c20c00b001b86cae4400mr5307111pll.37.1692641057819; Mon, 21 Aug 2023 11:04:17 -0700 (PDT) Received: from ?IPV6:2601:681:5a00:f790:e7ed:ccbc:4dc0:41c4? ([2601:681:5a00:f790:e7ed:ccbc:4dc0:41c4]) by smtp.gmail.com with ESMTPSA id je17-20020a170903265100b001b8a85489a3sm7349366plb.262.2023.08.21.11.04.16 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 21 Aug 2023 11:04:17 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------RTvdgc9Sct8iPPxYywEM0l07" Message-ID: Date: Mon, 21 Aug 2023 12:04:15 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: The same prepared query yield "-1" the first six times and then "-1.0" Content-Language: en-CA To: pgsql-general@lists.postgresql.org References: <5C40B9CC-40E4-4AC5-95A1-E5A521C282EF@gmail.com> From: Rob Sargent In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------RTvdgc9Sct8iPPxYywEM0l07 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 8/21/23 11:17, Edoardo Panfili wrote: >> Use the type appropriate getter, not getString, to retrieve the value >> of the underlying real typed column. > I know, but in this occasion I need to use text value. > >> >> Otherwise, I agree this seems like a bug, probably in the JDBC >> driver, though one pertains to style as opposed to semantics since >> both answers are technically correct. > I will try, thank you > > Edoardo > You appear to have two code paths in your application.  The one that needs the string version of the answer should do the conversion of the numeric value. rjs --------------RTvdgc9Sct8iPPxYywEM0l07 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 8/21/23 11:17, Edoardo Panfili wrote:
Use the type appropriate getter, not getString, to retrieve the value of the underlying real typed column.
I know, but in this occasion I need to use text value.


Otherwise, I agree this seems like a bug, probably in the JDBC driver, though one pertains to style as opposed to semantics since both answers are technically correct.
I will try, thank you

Edoardo

You appear to have two code paths in your application.  The one that needs the string version of the answer should do the conversion of the numeric value.
rjs

--------------RTvdgc9Sct8iPPxYywEM0l07--