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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Nolan <htfoot(at)gmail(dot)com>
Cc: "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-06 22:13:49
Message-ID: 577338.1720304029@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Michael Nolan <htfoot(at)gmail(dot)com> writes:
> Shouldn't declaring a field that is also an OUT parameter throw an error?

No. The DECLARE is a block nested within the function,
and the parameter is declared at function scope.
So this is a standard case of an inner declaration masking
an outer one.

Possibly plpgsql_check can be set to complain about such cases,
but they're legal according to the language specification.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2024-07-07 07:31:33 Re: Declaring a field that is also an out parameter in a function
Previous Message Michael Nolan 2024-07-06 21:29:12 Declaring a field that is also an out parameter in a function