From 2311f193ea7db23f68f5471ae2c35940fc0d4794 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 27 Apr 2025 11:43:02 -0400 Subject: Remove circular #include's between plpython.h and plpy_util.h. plpython.h included plpy_util.h, simply on the grounds that "it's easier to just include it everywhere". However, plpy_util.h must include plpython.h, or it won't pass headerscheck. While the resulting circularity doesn't have any immediate bad effect, it's poor design. We have seen serious messes arise in the past from overly-broad inclusion footprints created by such circularities, so let's establish a project policy against it. To fix, just replace *.c files' inclusions of plpython.h with plpy_util.h. They'll pull in plpython.h indirectly; indeed, almost all have already done so via inclusions of other plpy_xxx.h headers. (Any extensions using plpython.h can do likewise without breaking the compatibility of their code with prior Postgres versions.) Reported-by: Bertrand Drouvot Author: Tom Lane Reviewed-by: Bertrand Drouvot Discussion: https://postgr.es/m/aAxQ6fcY5QQV1lo3@ip-10-97-1-34.eu-west-3.compute.internal --- contrib/jsonb_plpython/jsonb_plpython.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib/jsonb_plpython/jsonb_plpython.c') diff --git a/contrib/jsonb_plpython/jsonb_plpython.c b/contrib/jsonb_plpython/jsonb_plpython.c index 680445a006f..9383615abbf 100644 --- a/contrib/jsonb_plpython/jsonb_plpython.c +++ b/contrib/jsonb_plpython/jsonb_plpython.c @@ -2,7 +2,7 @@ #include "plpy_elog.h" #include "plpy_typeio.h" -#include "plpython.h" +#include "plpy_util.h" #include "utils/fmgrprotos.h" #include "utils/jsonb.h" #include "utils/numeric.h" -- cgit v1.2.3