Re: Remove redundant variable from transformCreateStmt

2021-05-06 Thread Alvaro Herrera
On 2021-Apr-29, Justin Pryzby wrote: > Getting rid of a redundant, boolean variable is good not because it's more > efficient but because it's one fewer LOC to read and maintain (and an > opportunity for inconsistency, I suppose). Makes sense. Pushed. Thanks everyone. > Also, this is a roundabo

Re: Remove redundant variable from transformCreateStmt

2021-05-02 Thread Amul Sul
On Fri, Apr 30, 2021 at 10:49 AM Bharath Rupireddy wrote: > > On Fri, Apr 30, 2021 at 7:07 AM Justin Pryzby wrote: > > > > On Thu, Apr 29, 2021 at 02:39:42PM -0400, Alvaro Herrera wrote: > > > On 2021-Apr-29, Tom Lane wrote: > > > > Alvaro Herrera writes: > > > > > I'd do it like this. Note I r

Re: Remove redundant variable from transformCreateStmt

2021-04-29 Thread Bharath Rupireddy
On Fri, Apr 30, 2021 at 7:07 AM Justin Pryzby wrote: > > On Thu, Apr 29, 2021 at 02:39:42PM -0400, Alvaro Herrera wrote: > > On 2021-Apr-29, Tom Lane wrote: > > > Alvaro Herrera writes: > > > > I'd do it like this. Note I removed an if/else block in addition to > > > > your changes. > > > > > >

Re: Remove redundant variable from transformCreateStmt

2021-04-29 Thread Justin Pryzby
On Thu, Apr 29, 2021 at 02:39:42PM -0400, Alvaro Herrera wrote: > On 2021-Apr-29, Tom Lane wrote: > > Alvaro Herrera writes: > > > I'd do it like this. Note I removed an if/else block in addition to > > > your changes. > > > > > I couldn't convince myself that this is worth pushing though; eithe

Re: Remove redundant variable from transformCreateStmt

2021-04-29 Thread Alvaro Herrera
On 2021-Apr-29, Tom Lane wrote: > Alvaro Herrera writes: > > I'd do it like this. Note I removed an if/else block in addition to > > your changes. > > > I couldn't convince myself that this is worth pushing though; either we > > push it to all branches (which seems unwarranted) or we create > >

Re: Remove redundant variable from transformCreateStmt

2021-04-29 Thread Tom Lane
Alvaro Herrera writes: > I'd do it like this. Note I removed an if/else block in addition to > your changes. > I couldn't convince myself that this is worth pushing though; either we > push it to all branches (which seems unwarranted) or we create > back-patching hazards. Yeah ... an advantage

Re: Remove redundant variable from transformCreateStmt

2021-04-29 Thread Alvaro Herrera
I'd do it like this. Note I removed an if/else block in addition to your changes. I couldn't convince myself that this is worth pushing though; either we push it to all branches (which seems unwarranted) or we create back-patching hazards. -- Álvaro Herrera39°49'30"S

Re: Remove redundant variable from transformCreateStmt

2021-04-18 Thread Amul Sul
On Mon, Apr 19, 2021 at 11:05 AM Bharath Rupireddy wrote: > > On Mon, Apr 19, 2021 at 9:32 AM Amul Sul wrote: > > Kindly ignore the previous version -- has unnecessary change. > > See the attached. > > Thanks for the patch! > > How about a slight rewording of the added comment to "Constraints > v

Re: Remove redundant variable from transformCreateStmt

2021-04-18 Thread Bharath Rupireddy
On Mon, Apr 19, 2021 at 9:32 AM Amul Sul wrote: > Kindly ignore the previous version -- has unnecessary change. > See the attached. Thanks for the patch! How about a slight rewording of the added comment to "Constraints validation can be skipped for a newly created table as it contains no data.

Re: Remove redundant variable from transformCreateStmt

2021-04-18 Thread Amul Sul
On Mon, Apr 19, 2021 at 9:28 AM Amul Sul wrote: > > On Fri, Apr 16, 2021 at 6:26 AM Bharath Rupireddy > wrote: > > > > On Thu, Apr 15, 2021 at 8:40 PM Jeevan Ladhe > > wrote: > > > IMHO, I think the idea here was to just get rid of an unnecessary variable > > > rather than refactoring. > > > > >

Re: Remove redundant variable from transformCreateStmt

2021-04-18 Thread Amul Sul
On Fri, Apr 16, 2021 at 6:26 AM Bharath Rupireddy wrote: > > On Thu, Apr 15, 2021 at 8:40 PM Jeevan Ladhe > 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 > > wrote: > >

Re: Remove redundant variable from transformCreateStmt

2021-04-15 Thread Bharath Rupireddy
On Thu, Apr 15, 2021 at 8:40 PM Jeevan Ladhe 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 > wrote: >> >> On Thu, Apr 15, 2021 at 5:04 PM Amul Sul wrote: >> > >> > Hi, >> > >>

Re: Remove redundant variable from transformCreateStmt

2021-04-15 Thread Jeevan Ladhe
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.rupireddyforpostg...@gmail.com> wrote: > On Thu, Apr 15, 2021 at 5:04 PM Amul Sul wrote: > > > > Hi, > > > > Attached patch removes "is_

Re: Remove redundant variable from transformCreateStmt

2021-04-15 Thread Amul Sul
On Thu, Apr 15, 2021 at 5:47 PM Bharath Rupireddy wrote: > > On Thu, Apr 15, 2021 at 5:04 PM Amul Sul 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 variab

Re: Remove redundant variable from transformCreateStmt

2021-04-15 Thread Bharath Rupireddy
On Thu, Apr 15, 2021 at 5:04 PM Amul Sul 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

Re: Remove redundant variable from transformCreateStmt

2021-04-15 Thread Jeevan Ladhe
Thanks Amul, this looks pretty straight forward. LGTM. I have also run the regression on master and seems good. Regards, Jeevan Ladhe