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

2024-07-07 Thread Pavel Stehule
ne 7. 7. 2024 v 17:00 odesílatel Adrian Klaver napsal: > On 7/7/24 07:53, Pavel Stehule wrote: > > > > > > ne 7. 7. 2024 v 16:48 odesílatel Adrian Klaver > > mailto:adrian.kla...@aklaver.com>> napsal: > > > > On 7/7/24 07:42, Pavel Stehule wrote: > > > I'm not sure why there's a warn

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

2024-07-07 Thread Adrian Klaver
On 7/7/24 07:53, Pavel Stehule wrote: ne 7. 7. 2024 v 16:48 odesílatel Adrian Klaver mailto:adrian.kla...@aklaver.com>> napsal: On 7/7/24 07:42, Pavel Stehule wrote: >     I'm not sure why there's a warning about using an alias. 43.3.1 says >     to use them for improved re

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

2024-07-07 Thread Pavel Stehule
ne 7. 7. 2024 v 16:37 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > (2024-07-07 09:27:14) postgres=# select * from > > plpgsql_check_function('test_function'); > > ┌───┐ > > │plpgsql_check_function

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

2024-07-07 Thread Pavel Stehule
ne 7. 7. 2024 v 16:48 odesílatel Adrian Klaver napsal: > On 7/7/24 07:42, Pavel Stehule wrote: > > I'm not sure why there's a warning about using an alias. 43.3.1 says > > to use them for improved readability. > > > > > > it is obsolete - aliases were used when Postgres doesn't support na

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

2024-07-07 Thread Adrian Klaver
On 7/7/24 07:42, Pavel Stehule wrote: I'm not sure why there's a warning about using an alias. 43.3.1 says to use them for improved readability. it is obsolete - aliases were used when Postgres doesn't support named arguments. Is that was what it was complaining about or the fact the

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

2024-07-07 Thread David G. Johnston
On Sunday, July 7, 2024, Michael Nolan wrote: > On Sun, Jul 7, 2024 at 4:13 AM 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

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

2024-07-07 Thread Pavel Stehule
ne 7. 7. 2024 v 15:01 odesílatel Michael Nolan napsal: > On Sun, Jul 7, 2024 at 4:13 AM 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

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

2024-07-07 Thread Tom Lane
Pavel Stehule writes: > (2024-07-07 09:27:14) postgres=# select * from > plpgsql_check_function('test_function'); > ┌───┐ > │plpgsql_check_function │ > ╞═

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

2024-07-07 Thread Michael Nolan
On Sun, Jul 7, 2024 at 4:13 AM 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.

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

2024-07-07 Thread Pavel Stehule
ne 7. 7. 2024 v 9:31 odesílatel Pavel Stehule napsal: > > > ne 7. 7. 2024 v 0:14 odesílatel Tom Lane napsal: > >> Michael Nolan 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 para

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

2024-07-07 Thread Pavel Stehule
ne 7. 7. 2024 v 0:14 odesílatel Tom Lane napsal: > Michael Nolan 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

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

2024-07-06 Thread Tom Lane
Michael Nolan 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_che

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

2024-07-06 Thread Michael Nolan
In the following short code, the out parameter d3 is also declared, so its value will be null in the output. create or replace function public.test_function(in varchar, in char, in date, ou t d1 text, out d2 integer, out d3 char, out d4 date ) stable as $$ DECLARE wk_intxt alias for $1; wk