Re: merging duplicate definitions of adjust_relid_set

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: merging duplicate definitions of adjust_relid_set
Date: 2017-03-17 17:50:51
Message-ID: 16341.1489773051@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> While reviewing Ashutosh Bapat's partitionwise join code, I noticed
> he'd run up against the problem that adjust_relid_set() is defined as
> static in two different source files, and he wanted to call it from a
> third file. I didn't much like his solution to that problem, which
> was to rename one of them and make that definition non-static; I think
> it would be better to keep the existing name and stop defining it in
> multiple places. However, I discovered that there wasn't really an
> obviously-good place to put the function; neither prepunion.c nor
> rewriteManip.c, the two files that contain static versions as of now,
> seem like an appropriate place from which to expose it, and I didn't
> find anything else that I was wildly in love with, either. The
> attached patch puts it in var.c, because it didn't look horrible and I
> thought it wasn't worth creating a new file just for this.

> Objections, better ideas?

I think it might be better to define it as a fundamental Bitmapset
operation in nodes/bitmapset.c, along the lines of

Bitmapset *bms_replace_member(const Bitmapset *bms, int member, int repl);

This API would probably require giving up the property of not copying the
set unless it changes, but I doubt that that's performance critical.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Elvis Pranskevichus 2017-03-17 17:56:00 [PATCH v1] Add and report the new "in_hot_standby" GUC pseudo-variable.
Previous Message Alvaro Herrera 2017-03-17 17:39:26 Re: [COMMITTERS] pgsql: Remove objname/objargs split for referring to objects