Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sQTBS-009z9V-Jo for pgsql-general@arkaria.postgresql.org; Sun, 07 Jul 2024 14:48:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sQTAe-00CrrU-3n for pgsql-general@arkaria.postgresql.org; Sun, 07 Jul 2024 14:47:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sQTAd-00CrrK-Oj for pgsql-general@lists.postgresql.org; Sun, 07 Jul 2024 14:47:19 +0000 Received: from mail-oo1-xc2a.google.com ([2607:f8b0:4864:20::c2a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sQTAb-000rrC-69 for pgsql-general@postgresql.org; Sun, 07 Jul 2024 14:47:18 +0000 Received: by mail-oo1-xc2a.google.com with SMTP id 006d021491bc7-5c6775ea6a3so191483eaf.3 for ; Sun, 07 Jul 2024 07:47:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720363636; x=1720968436; darn=postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ZyHd9tr7CrUIu5ZWqQHefr2tUISj7srOW80LmuUQ1oY=; b=YTE3KxJx+hahigZe+Z8ZmFALDMQcSfxJ8V6pb68CKEExH0SjTjjqz7wo/TvIXE2bAE aGtc+SbhEsLDxaK8ADKP4zSwa3ODNdEC6NarS2HllGyN0YOE/6S1ptGGZdcC046D6bn6 D/f5BwS2XBrTyStWzC+zTLZPCZm8P9F8xw5jubkf4azTHTkdgqfLMfDEKhmPDOvQxGtz o+p2YLVeyV1rKoqcN32eeHyRezAateW80P24R7OjYZOUqgD3MiMsPj6FLPjpDsCO9YN8 FKQXkNXmOgiTqMmNBoiiClygPX9sKdvAXcY2f9qKLSyzBipzlPtK4fZAg2OXdqgGWmnp QHjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720363636; x=1720968436; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZyHd9tr7CrUIu5ZWqQHefr2tUISj7srOW80LmuUQ1oY=; b=u5SINTE6FlL9BEmswoiu7gToFWjASbrl3nq+DQBSJBM9jWNdCpBXKXWn6bSXV+BD5L D5jNCUgkAt+aFSAIp1uX6AbKwcGSgQwuzWdP2rDrwhzIwUN+1iKa1DbzAMNVaoYv/kkw B+CaMSc/ycoa9USo9++HIVyz6NhhvXzmL/LdXif3QDsJXbn/TMtvEkEJ6zQUI7/UBChG ma804qC40vtFzGfKAaji2ORDBny0B6pDrN9Vi13lclvK+xzANcDPxdhQ4+17HlviZJQy 4neZYVsdRGnWGn2HtOKYAKqcgDm29gHk0QFNBGwKTI8BLDUyjLjxSfMrw8aaGtxZKVN/ 78cQ== X-Forwarded-Encrypted: i=1; AJvYcCU2e6/t0qGJ7FCiDP2VAr++5xKmFfS8z5WtkRoIQMWVR2fe/vne/+4w4VgmDi9kTpEG127JRc4UB9DEGpGRr4NgYx9eAY9MDGNXm1+j X-Gm-Message-State: AOJu0YxJxQsr4SHNx1AVWuiiKyMtdSWtS8/4tj6RqeXUbpIRw4sJIHNT F/m+Ic/mzRxgLjmR2AlKcvDM7Rq7GaKyZ2tM+WEKJFX42h0XHnUE9LwAetzcU8PKa+PHqjzWMwB Ql3xIk7tSzC5Yzn4i5Mj0adgJB9k= X-Google-Smtp-Source: AGHT+IF47jPFKLJRrmtCFGdSILH3DONGEWkQb3GiFACPf7yR1rJaMz8HDM2eS59+4A6rgyGKb/ZxFYhuP2weTvc+LMI= X-Received: by 2002:a4a:5e42:0:b0:5c4:e036:e383 with SMTP id 006d021491bc7-5c646f7c514mr8635639eaf.8.1720363636305; Sun, 07 Jul 2024 07:47:16 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a8a:d53:0:b0:539:aa10:6c7 with HTTP; Sun, 7 Jul 2024 07:47:15 -0700 (PDT) In-Reply-To: References: <577338.1720304029@sss.pgh.pa.us> From: "David G. Johnston" Date: Sun, 7 Jul 2024 07:47:15 -0700 Message-ID: Subject: Re: Declaring a field that is also an out parameter in a function To: Michael Nolan Cc: Pavel Stehule , Tom Lane , "pgsql-general@postgresql.org" Content-Type: multipart/alternative; boundary="0000000000006d3776061ca95fb1" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000006d3776061ca95fb1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sunday, July 7, 2024, Michael Nolan wrote: > On Sun, Jul 7, 2024 at 4:13=E2=80=AFAM Pavel Stehule > 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=E2=80=99t have a choice, though new a= nd old aren=E2=80=99t usually problematic enough to warrant aliasing. David J. --0000000000006d3776061ca95fb1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sunday, July 7, 2024, Michael Nolan <htfoot@gmail.com> wrote:
On Su= n, Jul 7, 2024 at 4:13=E2=80=AFAM Pavel Stehule <pavel.stehule@gmail.com> wrote:
>
> but looks so there are false alarms related to using an alias. It is i= nteresting so I have not any report about this issue, so probably using ali= ases is not too common today.

I'm not sure why there's a warning about using an alias. 43.3.1 say= s
to use them for improved readability.


Mostly because you should just name variables correctly the first time.= =C2=A0 It improves readability if you use $n parameter names, which you sho= uld not.=C2=A0 As noted in 43.3.2, sometimes you don=E2=80=99t have a choic= e, though new and old aren=E2=80=99t usually problematic enough to warrant = aliasing.

David J.

--0000000000006d3776061ca95fb1--