Re: proposal: plpgsql, new check for extra_errors - strict_expr_check

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Gilles Darold <gilles(at)darold(dot)net>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: plpgsql, new check for extra_errors - strict_expr_check
Date: 2025-02-27 16:31:52
Message-ID: CAFj8pRBAbKe8A50MEeMg2bTJcwhBfS01bCKFaiC_z__YWsVM+Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

čt 27. 2. 2025 v 16:33 odesílatel Gilles Darold <gilles(at)darold(dot)net> napsal:

> Le 07/02/2025 à 23:00, Pavel Stehule a écrit :
> > Hi
> >
> > I rewrote this patch. Instead of enhancing the main SQL parser, it
> > does post parser checks of the parse tree.
> >
> > Now the patch is significantly less invasive (changes are just in
> > plpgsql - mostly in grammar), and it is smaller (without regress tests
> > it has half size).
> >
> > This patch allows the detection of usage of undocumented syntax for
> > plpgsql expressions. Using this undocumented
> > syntax can be the reason why badly written code (missing semicolon)
> > can be quietly executed without any raising of error.
> >
> > Only patch 01 is important - patches 02, 03 are prepared for review.
> > Patch 02 activates a new check by default, and fixes the regress test
> > to be executed. This is important for checking for possible false alarms.
> > Patch 03 disables this check and returns regress tests to their
> > original state.
> >
> > Regards
> >
> > Pavel
>
> Hi Pavel,
>
> I'm reviewing this patch too and I'm facing some documentation issues
> in patch
> v20250207-0001-use-strict-rules-for-parsing-PL-pgSQL-expressions.patch
>
> + it doesn't to allow to detect broken code.
>
> I'm not very good at english but I think it should be: it doesn't allow
> to detect broken code.
>

fixed

>
> Here I think the sentence is not complete:
> + This check is allowed only
> <varname>plpgsql.extra_errors</varname>.
>
> Do you mean: This check is allowed only when
> <varname>plpgsql.extra_errors</varname> is set to 'strict_expr_check'.
>
> Please fix these to be sure of what the code is supposed to do.
>

fixed

Regards

Pavel

>
>
> Thanks
>
> --
> Gilles Darold
> http://www.darold.net/
>
>

Attachment Content-Type Size
v20250227-0003-set-plpgsql.extra_errors-to-none.patch text/x-patch 17.1 KB
v20250227-0001-use-strict-rules-for-parsing-PL-pgSQL-expressions.patch text/x-patch 17.2 KB
v20250227-0002-simply-check-of-strict-expr-check-on-regress-test.patch text/x-patch 17.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2025-02-27 16:51:22 Re: explain analyze rows=%.0f
Previous Message Andres Freund 2025-02-27 16:30:09 Re: Log connection establishment timings