Re: Missing can't-assign-to-constant checks in plpgsql

2022-05-01 Thread Pavel Stehule
Hi >> Regardless of which way we handle that point, I'm inclined to >> change this only in HEAD. Probably people wouldn't thank us >> for making the back branches more strict. >> > > +1 > > I can implement these checks in plpgsql_check. So possible issues can be > detected and fixed on older ver

Re: Missing can't-assign-to-constant checks in plpgsql

2022-04-30 Thread Tom Lane
Pavel Stehule writes: > čt 28. 4. 2022 v 23:52 odesílatel Tom Lane napsal: >> Perhaps the OPEN change is a little too aggressive, since if >> you give the refcursor variable some non-null initial value, >> OPEN won't change it; in that usage a CONSTANT marking could >> be allowed. But I really s

Re: Missing can't-assign-to-constant checks in plpgsql

2022-04-28 Thread Pavel Stehule
čt 28. 4. 2022 v 23:52 odesílatel Tom Lane napsal: > I happened to notice that there are a couple of places in plpgsql > that will let you assign a new value to a variable that's marked > CONSTANT: > > * We don't complain if an output parameter in a CALL statement > is constant. > > * We don't co

Missing can't-assign-to-constant checks in plpgsql

2022-04-28 Thread Tom Lane
I happened to notice that there are a couple of places in plpgsql that will let you assign a new value to a variable that's marked CONSTANT: * We don't complain if an output parameter in a CALL statement is constant. * We don't complain if a refcursor variable is constant, even though OPEN may as