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

From Gilles Darold
Subject Re: proposal: plpgsql, new check for extra_errors - strict_expr_check
Date
Msg-id 68f7af56-8f64-445a-a507-ba0eb2b0a2f9@darold.net
Whole thread Raw
In response to proposal: plpgsql, new check for extra_errors - strict_expr_check  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: proposal: plpgsql, new check for extra_errors - strict_expr_check
List pgsql-hackers
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.

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.


Thanks

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




pgsql-hackers by date:

Previous
From: jian he
Date:
Subject: bug: ALTER TABLE ADD VIRTUAL GENERATED COLUMN with table rewrite
Next
From: Bertrand Drouvot
Date:
Subject: Re: Draft for basic NUMA observability