Re: Remove redundant variable from transformCreateStmt

From: Amul Sul <sulamul(at)gmail(dot)com>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: Jeevan Ladhe <jeevan(dot)ladhe(at)enterprisedb(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Remove redundant variable from transformCreateStmt
Date: 2021-04-19 03:58:06
Message-ID: CAAJ_b94q5ujegmzcNWys5NhUsio31eGRZgyuW6v4RsfMTLbXVg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Apr 16, 2021 at 6:26 AM Bharath Rupireddy
<bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
>
> On Thu, Apr 15, 2021 at 8:40 PM Jeevan Ladhe
> <jeevan(dot)ladhe(at)enterprisedb(dot)com> wrote:
> > IMHO, I think the idea here was to just get rid of an unnecessary variable
> > rather than refactoring.
> >
> > On Thu, Apr 15, 2021 at 5:48 PM Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
> >>
> >> On Thu, Apr 15, 2021 at 5:04 PM Amul Sul <sulamul(at)gmail(dot)com> wrote:
> >> >
> >> > Hi,
> >> >
> >> > Attached patch removes "is_foreign_table" from transformCreateStmt()
> >> > since it already has cxt.isforeign that can serve the same purpose.
> >>
> >> Yeah having that variable as "is_foreign_table" doesn't make sense
> >> when we have the info in ctx. I'm wondering whether we can do the
> >> following (like transformFKConstraints). It will be more readable and
> >> we could also add more comments on why we don't skip validation for
> >> check constraints i.e. constraint->skip_validation = false in case for
> >> foreign tables.
> >
> > To address your concern here, I think it can be addressed by adding a comment
> > just before we make a call to transformCheckConstraints().
>
> +1.

Ok, added the comment in the attached version.

Thanks Jeevan & Bharat for the review.

Regards,
Amul

Attachment Content-Type Size
remove_redundant_var_v2.patch application/x-patch 1.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amul Sul 2021-04-19 04:02:22 Re: Remove redundant variable from transformCreateStmt
Previous Message Masahiko Sawada 2021-04-19 03:29:23 Re: Replication slot stats misgivings