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 1qY97A-000u65-TR for pgsql-general@arkaria.postgresql.org; Mon, 21 Aug 2023 17:54:56 +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 1qY979-009IA8-JX for pgsql-general@arkaria.postgresql.org; Mon, 21 Aug 2023 17:54:55 +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 1qY8Xf-008jAH-LK for pgsql-general@lists.postgresql.org; Mon, 21 Aug 2023 17:18:15 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qY8Xc-000D3S-Hu for pgsql-general@lists.postgresql.org; Mon, 21 Aug 2023 17:18:14 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-3fef785e229so118215e9.1 for ; Mon, 21 Aug 2023 10:18:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iisgubbio.edu.it; s=google; t=1692638291; x=1693243091; h=message-id:in-reply-to:to:references:date:subject:mime-version:from :from:to:cc:subject:date:message-id:reply-to; bh=wU3038t5OZiU+9grDLhb1JLI2wcWMBBTJ86dqHrJ3SQ=; b=njA8HXPdZKBl3pdRnPLlIOoIj5nb4beNOCwVJSzJf+kyzu2ObXO1lSBxctIl8UELab wzVpIpt/U83xlBqha9H/KGDj865vduy6xC/Eqt7b1g9Djdcf+yTbpW5C23dl/Eib0LZp cAWAaS2rnohJ8MV/BwXx59F9IaKfBkfmMvoSsMANC1rh3KtfkFqh8rAtw1ko2KToKscr X7IHhJ2iFlzBhNgR40jtQVCqwiTMQrxfBSGuKPagOFIPDIy+OdDBkLSJqJmJIzI/ENEP n5/O9uehINCuNlEmU3I51uZGsjLMFsvE2wDrnBKdfSKXF3Q0akltt42DX2SpQpn4nGuQ VXSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692638291; x=1693243091; h=message-id:in-reply-to:to:references:date:subject:mime-version:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wU3038t5OZiU+9grDLhb1JLI2wcWMBBTJ86dqHrJ3SQ=; b=LPwcfUkLFZk8qh5e3ON42S3gve9IqW7yPoqxxTNHFh33UfdDJjwGIINbB5qeU+y+na FrityVL2YRMwMynn4tBa1OVy604Fv5kU4uQB7Wa8C+RhtTzQfFvTjHYHTAgMMk0JUE72 0aROHf4EblrjxEY2rjOlbuUFX4+dEU1ky5cLBs9Fe6fdAABfDFMFuP9BST9Aq4voetpS BwtOegaAUO68Bz85qUaeA559IIZP0yx91CAiupYoQzzYEOpAylf7G26Dx4Fian699KnP j4RYYTxyjUX3j/VKAXL5X3knacs0U5Xth0BsXMQ9NUqIzxVJzf8f+xEUag7ehgnKcRvg XLkw== X-Gm-Message-State: AOJu0YxrXVN7cdxatHtGrQd0JsmB5nTmV2LL4E1929qIb3PeDyltsMeh jMOwDGo+GcQg008RcSI+HjizK4TiNKm6/d6tdEo= X-Google-Smtp-Source: AGHT+IG+vheaN/8cQmHZwQuejl/P3QiYJffL0Pixh601uh4Bud9LFOYGv518ciHB+wXAl3lQlAMpww== X-Received: by 2002:adf:f892:0:b0:317:7238:336a with SMTP id u18-20020adff892000000b003177238336amr5153363wrp.5.1692638290731; Mon, 21 Aug 2023 10:18:10 -0700 (PDT) Received: from smtpclient.apple (host-79-47-189-141.retail.telecomitalia.it. [79.47.189.141]) by smtp.gmail.com with ESMTPSA id s1-20020a1709067b8100b00993150e5325sm6872214ejo.60.2023.08.21.10.18.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Aug 2023 10:18:10 -0700 (PDT) From: Edoardo Panfili X-Google-Original-From: Edoardo Panfili Content-Type: multipart/alternative; boundary="Apple-Mail=_EA09D33C-A62D-48CA-A43B-7F79993E60B0" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Subject: Re: The same prepared query yield "-1" the first six times and then "-1.0" Date: Mon, 21 Aug 2023 19:17:59 +0200 References: <5C40B9CC-40E4-4AC5-95A1-E5A521C282EF@gmail.com> To: pgsql-general@lists.postgresql.org In-Reply-To: Message-Id: X-Mailer: Apple Mail (2.3731.600.7) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_EA09D33C-A62D-48CA-A43B-7F79993E60B0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > Il giorno 21 ago 2023, alle ore 17:50, David G. Johnston = ha scritto: >=20 >=20 > On Mon, Aug 21, 2023 at 8:28=E2=80=AFAM Edoardo Panfili = > wrote: >>=20 >> dim1 real DEFAULT '-1' NOT NULL >>=20 >> System.out.print("p: "+rs.getString("dim1")+"\n=E2=80=9D); >>=20 >> Can I do something to avoid this problem? >=20 > 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. >=20 > 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 --Apple-Mail=_EA09D33C-A62D-48CA-A43B-7F79993E60B0 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

Il = giorno 21 ago 2023, alle ore 17:50, David G. Johnston = <david.g.johnston@gmail.com> ha scritto:


On Mon, Aug = 21, 2023 at 8:28=E2=80=AFAM Edoardo Panfili <edoardo.panfili@iisgubbio= .edu.it> wrote:

   dim1 real DEFAULT = '-1' NOT NULL

     System.out.print("p: = "+rs.getString("dim1")+"\n=E2=80=9D);

Can I do something to avoid this = problem?

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

= --Apple-Mail=_EA09D33C-A62D-48CA-A43B-7F79993E60B0--