Re: proposal - plpgsql - all plpgsql auto variables should be constant

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
Cc: Greg Stark <stark(at)mit(dot)edu>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal - plpgsql - all plpgsql auto variables should be constant
Date: 2020-04-28 11:41:34
Message-ID: CAFj8pRB7CYNdtSEKCTnXOu_KREc1wh5c=7W35+nKcLsUu3L1rw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

út 28. 4. 2020 v 13:35 odesílatel Ashutosh Bapat <
ashutosh(dot)bapat(dot)oss(at)gmail(dot)com> napsal:

> On Mon, Apr 27, 2020 at 7:56 PM Greg Stark <stark(at)mit(dot)edu> wrote:
> >
> > On Fri, 24 Apr 2020 at 10:08, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > >
> > > I'm skeptical. If we'd marked them that way from day one, it would
> have
> > > been fine, but to change it now is a whole different discussion. I
> think
> > > the odds that anybody will thank us are much smaller than the odds that
> > > there will be complaints. In particular, I'd be just about certain
> that
> > > there are people out there who are changing FOUND and loop control
> > > variables manually, and they will not appreciate us breaking their
> code.
> >
> > I kind of doubt it would break anybody's code. But I also doubt it's
> > actually going to help anybody. It's not exactly an easy bug to write,
> > so meh, I can't really get worked up either way about this.
>
> We could retain the old behaviour by using a GUC which defaults to old
> behaviour. More GUCs means more confusion, this once guc under plpgsql
> extension might actually help.
>

I am not sure if other GUC can help (in this case). Probably it cannot be
default, and beginners has zero knowledge to enable this or similar GUC.

This week I enhanced plpgsql_check about new check
https://github.com/okbob/plpgsql_check related to this feature.

I afraid so people who needs these checks and some help probably doesn't
know about this extension.

>
> --
> Best Wishes,
> Ashutosh Bapat
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2020-04-28 11:46:03 Re: PostgreSQL CHARACTER VARYING vs CHARACTER VARYING (Length)
Previous Message tushar 2020-04-28 11:39:13 [pg_dump] 'create index' statement is failing due to search_path is empty