Re: Declaring a field that is also an out parameter in a function

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Michael Nolan <htfoot(at)gmail(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Declaring a field that is also an out parameter in a function
Date: 2024-07-07 14:47:15
Message-ID: CAKFQuwYnbcoHHeH6mqgsMJoMAR01YGLutpw3O3XaJ-ZSjNWdDg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sunday, July 7, 2024, Michael Nolan <htfoot(at)gmail(dot)com> wrote:

> On Sun, Jul 7, 2024 at 4:13 AM Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> wrote:
> >
> > but looks so there are false alarms related to using an alias. It is
> interesting so I have not any report about this issue, so probably using
> aliases is not too common today.
>
> I'm not sure why there's a warning about using an alias. 43.3.1 says
> to use them for improved readability.
>
>
Mostly because you should just name variables correctly the first time. It
improves readability if you use $n parameter names, which you should not.
As noted in 43.3.2, sometimes you don’t have a choice, though new and old
aren’t usually problematic enough to warrant aliasing.

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2024-07-07 14:48:36 Re: Declaring a field that is also an out parameter in a function
Previous Message Pavel Stehule 2024-07-07 14:42:07 Re: Declaring a field that is also an out parameter in a function