Re: proposal: plpgsql, new check for extra_errors - strict_expr_check - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: proposal: plpgsql, new check for extra_errors - strict_expr_check
Date
Msg-id CAFj8pRBAbKe8A50MEeMg2bTJcwhBfS01bCKFaiC_z__YWsVM+Q@mail.gmail.com
Whole thread Raw
In response to Re: proposal: plpgsql, new check for extra_errors - strict_expr_check  (Gilles Darold <gilles@darold.net>)
List pgsql-hackers
Hi

čt 27. 2. 2025 v 16:33 odesílatel Gilles Darold <gilles@darold.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

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Log connection establishment timings
Next
From: Robert Haas
Date:
Subject: Re: explain analyze rows=%.0f