1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-13 07:41:39 +03:00

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 <bertranddrouvot.pg@gmail.com>
Author: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Discussion: https://postgr.es/m/aAxQ6fcY5QQV1lo3@ip-10-97-1-34.eu-west-3.compute.internal
This commit is contained in:
Tom Lane
2025-04-27 11:43:02 -04:00
parent e8ca9ed1d2
commit 2311f193ea
16 changed files with 18 additions and 20 deletions

View File

@ -3,7 +3,7 @@
#include "fmgr.h"
#include "hstore/hstore.h"
#include "plpy_typeio.h"
#include "plpython.h"
#include "plpy_util.h"
PG_MODULE_MAGIC_EXT(
.name = "hstore_plpython",