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 1qlR6S-002mVA-Uw for pgsql-jdbc@arkaria.postgresql.org; Wed, 27 Sep 2023 09:45:08 +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 1qlR6R-002ZDR-N1 for pgsql-jdbc@arkaria.postgresql.org; Wed, 27 Sep 2023 09:45:07 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qlR6R-002ZDD-FG for pgsql-jdbc@lists.postgresql.org; Wed, 27 Sep 2023 09:45:07 +0000 Received: from pgintl.fastcrypt.com ([149.56.129.164]) by makus.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qlR6O-006u8e-Ui for pgsql-jdbc@postgresql.org; Wed, 27 Sep 2023 09:45:06 +0000 Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) by pgintl.fastcrypt.com (Postfix) with ESMTPSA id BE6C92018B for ; Wed, 27 Sep 2023 05:45:03 -0400 (EDT) Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-50335f6b48dso18171099e87.3 for ; Wed, 27 Sep 2023 02:45:03 -0700 (PDT) X-Gm-Message-State: AOJu0Yy4x9NYFuDJEUvi5DgWfWbQfbh08yXgsxGHAmia0XywfdNN4ouz iKVM+2fdBmUshDKJ6ESMurtC2n4t0DnVuoW5c4M= X-Google-Smtp-Source: AGHT+IGye5a5elIRKcajGMnRmn8BVLy3J+70KHZF32TFHG+ti6ix9aArxHVSPXp/vd2QsEIqWnVNdl4OtQtZFh/bhIE= X-Received: by 2002:a05:6512:1051:b0:503:1bd4:5e43 with SMTP id c17-20020a056512105100b005031bd45e43mr1577810lfb.40.1695807902355; Wed, 27 Sep 2023 02:45:02 -0700 (PDT) MIME-Version: 1.0 References: <8d8ea6c9-85a6-d1b8-309d-b1f5bc590840@cloud.gatewaynet.com> In-Reply-To: <8d8ea6c9-85a6-d1b8-309d-b1f5bc590840@cloud.gatewaynet.com> From: Dave Cramer Date: Wed, 27 Sep 2023 05:44:45 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Regarding useObjects To: Achilleas Mantzios - cloud Cc: Vladimir Sitnikov , pgsql-jdbc@postgresql.org Content-Type: multipart/alternative; boundary="000000000000a096a60606540b21" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000a096a60606540b21 Content-Type: text/plain; charset="UTF-8" On Wed, 27 Sept 2023 at 05:00, Achilleas Mantzios - cloud < a.mantzios@cloud.gatewaynet.com> wrote: > Good Day Vladimir > > On 9/27/23 09:03, Vladimir Sitnikov wrote: > >> so there was the option to change this to false and recompile > > We try doing our best to keep backward compatibility both > > compilation-wise and behaviour-wise. > > However, we treat "private fields and methods" as private, and we do > > not expect people would depend on them. > > If you have to modify sources or depend on private APIs I would > > suggest raising an issue or PR so it could be incorporated > > into the driver itself. > > > > Would you please provide a test case of what you are doing with PgArray? > > What is exactly the sequence of JDBC calls, the actual and the > > expected outcomes in your case? > > E.g. for the case of floats, we have to change all: > > java.sql.Array arr = rs.getArray(1); > > Object objarr = arr.getArray(); > > float flarr[] = (float[]) objarr; > > to > > java.sql.Array arr = rs.getArray(1); > > Object objarr = arr.getArray(); > > Float flarr[] = (Float[]) objarr; > So the problem with using float instead of Float is that it is impossible to have a null float and arrays can have nulls. Dave > > > > > The mentioned "useObjects" has been removed in > > https://github.com/pgjdbc/pgjdbc/pull/1194 (Refactor decoding arrays) > > > > Vladimir > > > --000000000000a096a60606540b21 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Wed, 27 Sept 2023 at 05:00, Achill= eas Mantzios - cloud <a.mantzios@cloud.gatewaynet.com> wrote:
Good Day Vladimir

On 9/27/23 09:03, Vladimir Sitnikov wrote:
>> so there was the option to change this to false and recompile
> We try doing our best to keep backward compatibility both
> compilation-wise and behaviour-wise.
> However, we treat "private fields and methods" as private, a= nd we do
> not expect people would depend on them.
> If you have to modify sources or depend on private APIs I would
> suggest raising an issue or PR so it could be incorporated
> into the driver itself.
>
> Would you please provide a test case of what you are doing with PgArra= y?
> What is exactly the sequence of JDBC calls, the actual and the
> expected outcomes in your case?

E.g. for the case of floats, we have to change all:

java.sql.Array arr =3D rs.getArray(1);

Object objarr =3D arr.getArray();

float flarr[] =3D (float[]) objarr;

to

java.sql.Array arr =3D rs.getArray(1);

Object objarr =3D arr.getArray();

Float flarr[] =3D (Float[]) objarr;

So the problem with using float instead of Float is that it is = impossible to have a null float and arrays can have nulls.

Dave=C2=A0

>
> The mentioned "useObjects" has been removed in
> https://github.com/pgjdbc/pgjdbc/pull/1194 (Refac= tor decoding arrays)
>
> Vladimir


--000000000000a096a60606540b21--