Re: Unused function parameter in get_qual_from_partbound() - Mailing list pgsql-hackers

From David Rowley
Subject Re: Unused function parameter in get_qual_from_partbound()
Date
Msg-id CAApHDvrPAcxhPtFpGGbXAJHizPrPtg4rxpix8eNQ92YDs2s9UQ@mail.gmail.com
Whole thread Raw
In response to Unused function parameter in get_qual_from_partbound()  ("houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>)
Responses RE: Unused function parameter in get_qual_from_partbound()
List pgsql-hackers
On Tue, 8 Jun 2021 at 21:50, houzj.fnst@fujitsu.com
<houzj.fnst@fujitsu.com> wrote:
> I noticed that the first function parameter in get_qual_from_partbound(**Relation rel**, Relation parent,
> is not used in the function.
>
> Is it better to remove it like the attached patch ?

Going by [1] it was used when it went in. It looks like it was for
mapping attribute numbers between parent and partition rels.

Going by [2], it looks like it became unused due to the attribute
mapping code being moved down into map_partition_varattnos().

As for whether we should remove it or not, because it's an external
function that an extension might want to use, it would need to wait
until at least we branch for PG15.

Likely it's best to add the patch to the July commitfest so that we
can make a decision then.

David

[1]
https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/catalog/partition.c;h=6dab45f0edf8b1617d7239652fe36f113d30fd7a;hb=f0e44751d71
[2]
https://git.postgresql.org/gitweb/?p=postgresql.git;a=blobdiff;f=src/backend/catalog/partition.c;h=874e69d8d62e8e93164093e7352756ebfd0f69bc;hp=f54e1bdf3fb52cefed9b0d2fe7ab2a169231579d;hb=0563a3a8b5;hpb=0c2070cefa0e5d097b715c9a3b9b5499470019aa



pgsql-hackers by date:

Previous
From: Andrey Borodin
Date:
Subject: Re: GiST operator class for bool
Next
From: Justin Pryzby
Date:
Subject: Re: pg14b1 stuck in lazy_scan_prune/heap_page_prune of pg_statistic