Re: Missing deconstruct_array_builtin usage

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Missing deconstruct_array_builtin usage
Date: 2024-10-12 00:43:04
Message-ID: CAD21AoCERkwmttY44dqUw=m_9QCctu7W+p6B7w_VqxRJA1Qq_Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Thu, Oct 10, 2024 at 10:37 PM Bertrand Drouvot
<bertranddrouvot(dot)pg(at)gmail(dot)com> wrote:
>
> Hi hackers,
>
> While working on [1], I noticed that we missed using deconstruct_array_builtin()
> in 062a8444242.
>
> Indeed, d746021de1 added construct_array_builtin and deconstruct_array_builtin
> but , later on, 062a8444242 made use of deconstruct_array for TEXTOID.
>
> Please find attached a tiny patch to add the $SUBJECT.
>
> That does not fix any issues, it just removes this unnecessary hardcoded
> parameters related to TEXTOID passed to deconstruct_array.

+1 for better consistency and simplicity.

>
> A quick check:
>
> $ git grep construct_array | grep OID | grep -v builtin
p> src/backend/catalog/pg_publication.c:
deconstruct_array(arr, TEXTOID, -1, false, TYPALIGN_INT,
> src/backend/utils/fmgr/funcapi.c: * For the OID and char arrays, we don't need to use deconstruct_array()
>
> shows that this is the "only" miss since d746021de1, so I still don't think it
> has to be more "complicated" than it is currently (as already mentioned by Peter
> in [2]).

It seems that src/backend/utils/adt/float.c file still has functions
that can use [de]construct_array_builtin(), for example
float8_combine(). I think it's an oversight of d746021de1.

Regards,

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2024-10-12 00:48:56 Re: New "raw" COPY format
Previous Message Masahiko Sawada 2024-10-12 00:11:47 Remove obsolete comment in reorderbuffer.h