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

From: Gilles Darold <gilles(at)darold(dot)net>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: plpgsql, new check for extra_errors - strict_expr_check
Date: 2025-02-27 15:33:31
Message-ID: 68f7af56-8f64-445a-a507-ba0eb2b0a2f9@darold.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bertrand Drouvot 2025-02-27 15:34:25 Re: Draft for basic NUMA observability
Previous Message jian he 2025-02-27 15:00:51 bug: ALTER TABLE ADD VIRTUAL GENERATED COLUMN with table rewrite