Re: Define variables in the approprieate scope - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Define variables in the approprieate scope
Date
Msg-id 20200324010424.GA1836@paquier.xyz
Whole thread Raw
In response to Re: Define variables in the approprieate scope  (Bruce Momjian <bruce@momjian.us>)
Responses Re: Define variables in the approprieate scope  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, Mar 23, 2020 at 08:50:55PM -0400, Bruce Momjian wrote:
> On Mon, Mar 23, 2020 at 01:00:24PM -0300, Alvaro Herrera wrote:
>> If we're talking about personal preference, my own is what Antonin
>> shows.  However, since disagreement has been expressed, I think we
>> should only change it if the generated code turns out better.
>
> I am fine with either usage, frankly.  I was just pointing out what
> might be the benefit of the current coding.

Personal opinion here.  I tend to prefer putting variable declarations
into the inner portions because it makes it easier to reason about the
code, though I agree that this concept does not need to be applied all
the time.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Define variables in the approprieate scope
Next
From: Tomas Vondra
Date:
Subject: Re: Additional improvements to extended statistics