Re: Misplacement of function declaration in contrib/postgres_fdw/postgres_fdw.h

From: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
To: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Misplacement of function declaration in contrib/postgres_fdw/postgres_fdw.h
Date: 2017-01-12 04:52:11
Message-ID: CAFjFpRcOVRr+5ke_-wQfSnc4pTY0pDDMwU2DukFPU-vHj8YW1A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jan 12, 2017 at 8:49 AM, Etsuro Fujita
<fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
> Hi,
>
> While working on pushing down more joins/updates to the remote, I noticed
> that in contrib/postgres_fdw/postgres_fdw.h the declaration of
> get_jointype_name is misplaced in the section of shippable.c. Since that
> function is defined in contrib/postgres_fdw/deparse.c, we should put that
> declaration in the section of deparse.c in the header file. Attached is a
> patch for that.
>

I think, initially (probably in a never committed patch) the function
was used to check whether a join type is shippable and if so return
the name to be used in the query. That may be the reason why it ended
up in shippability.c. But later the shippability test was separated
from the code which required the string representation. Thanks for
pointing out the descripancy. The patch looks good. As a side change,
should we include "JOIN" in the string returned by this fuction? The
two places where this function is called, append "JOIN" to the string
returned by this function. Although, even without that change, the
patch looks good.

--
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kuntal Ghosh 2017-01-12 05:25:16 Re: many copies of atooid() and oid_cmp()
Previous Message Tom Lane 2017-01-12 04:28:33 Re: Couple of issues with prepared FETCH commands