<feed xmlns='http://www.w3.org/2005/Atom'>
<title>postgresql.git/contrib/hstore_plpython, branch master</title>
<subtitle>This is the main PostgreSQL git repository.</subtitle>
<id>http://git.postgresql.org/cgit/postgresql.git/atom?h=master</id>
<link rel='self' href='http://git.postgresql.org/cgit/postgresql.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='http://git.postgresql.org/cgit/postgresql.git/'/>
<updated>2026-08-18T04:44:04Z</updated>
<entry>
<title>hstore: Rework module to use Size and {add,mul}_size for allocation sizes</title>
<updated>2026-08-18T04:44:04Z</updated>
<author>
<name>Michael Paquier</name>
</author>
<published>2026-08-18T04:44:04Z</published>
<link rel='alternate' type='text/html' href='http://git.postgresql.org/cgit/postgresql.git/commit/?id=92e20d4a4382810a30bdb394473d6ee891edab73'/>
<id>urn:sha1:92e20d4a4382810a30bdb394473d6ee891edab73</id>
<content type='text'>
hstore has been relying on a set of int/int32 to count the total length
of all the keys and values constructed, relying on the maximum values of
the arguments rather than proper bound checks.  As proved in the
reported thread, these counters could overflow and wrap, leading to
incorrect allocations.

This commit replaces the int/int32 values with a set of Size values,
with add_size() and mul_size() in charge of checking for overflows when
constructing hstore values before doing any allocation.

The changes that matter in terms of the report are mostly in
hstore_io.c.  hstore_compat.c is adjusted for consistency, to keep the
allocation maths uniform across the module.

This is an old bug.  A backpatch should perhaps be done but I cannot get
excited about a change like that in stable branches.

Reported-by: Man Zeng &lt;zengman@halodbtech.com&gt;
Author: Tender Wang &lt;tndrwang@gmail.com&gt;
Author: Michael Paquier &lt;michael@paquier.xyz&gt;
Discussion: https://postgr.es/m/CAHewXNmfD6-9MDxgpRfTzjVj0mhBw3JMoNOHeTiPOjZGhNzd=g@mail.gmail.com
</content>
</entry>
<entry>
<title>plpython: Fix NULL pointer dereferences for broken sequence and mapping objects</title>
<updated>2026-06-29T02:38:39Z</updated>
<author>
<name>Richard Guo</name>
</author>
<published>2026-06-29T02:38:39Z</published>
<link rel='alternate' type='text/html' href='http://git.postgresql.org/cgit/postgresql.git/commit/?id=8612f0b7ce09212b0b80af925b0966bdbd46a60f'/>
<id>urn:sha1:8612f0b7ce09212b0b80af925b0966bdbd46a60f</id>
<content type='text'>
PL/Python and its hstore and jsonb transforms build SQL values from
Python containers by calling Python C API functions that can return
NULL, and in several places the result was used without first checking
it.

On the sequence side, PySequence_GetItem() is used when converting a
returned sequence into a SQL array or composite value, when reading
the argument list passed to plpy.execute() or plpy.cursor(), and when
reading the list of type names given to plpy.prepare().  On the
mapping side, the hstore and jsonb transforms call PyMapping_Size()
and PyMapping_Items() and then index the result with PyList_GetItem()
and PyTuple_GetItem().

All of these return NULL (or -1), with a Python exception set, for a
broken object: for example one whose __getitem__() or items() raises,
or which reports a length that disagrees with what it actually yields.
The unchecked result was then dereferenced, crashing the backend.

Fix this by checking the result of each call and reporting a regular
error if it failed, so that the underlying Python exception is
surfaced instead of taking down the session.

Author: Richard Guo &lt;guofenglinux@gmail.com&gt;
Reviewed-by: Ayush Tiwari &lt;ayushtiwari.slg01@gmail.com&gt;
Discussion: https://postgr.es/m/CAMbWs49BKM9wP6m8bCXEpHwQKp7usvOGV6Jf=J7FYr_BCpxLqg@mail.gmail.com
Backpatch-through: 14
</content>
</entry>
<entry>
<title>Use palloc_array() in a few more places to avoid overflow</title>
<updated>2026-05-11T18:27:55Z</updated>
<author>
<name>Heikki Linnakangas</name>
</author>
<published>2026-05-11T18:18:06Z</published>
<link rel='alternate' type='text/html' href='http://git.postgresql.org/cgit/postgresql.git/commit/?id=c3f7dde39e940c86cccc179e8cbe188966e4e3ec'/>
<id>urn:sha1:c3f7dde39e940c86cccc179e8cbe188966e4e3ec</id>
<content type='text'>
These could overflow on 32-bit systems.

Backpatch-through: 14
Security: CVE-2026-6473
</content>
</entry>
<entry>
<title>Change StaticAssertVariableIsOfType to be a declaration</title>
<updated>2026-02-03T07:46:02Z</updated>
<author>
<name>Peter Eisentraut</name>
</author>
<published>2026-02-03T07:36:47Z</published>
<link rel='alternate' type='text/html' href='http://git.postgresql.org/cgit/postgresql.git/commit/?id=955e50766869a5ccf862d7f8439f5d35b723c0f9'/>
<id>urn:sha1:955e50766869a5ccf862d7f8439f5d35b723c0f9</id>
<content type='text'>
This allows moving the uses to more natural and useful positions.
Also, a declaration is the more native use of static assertions in C.

Reviewed-by: Bertrand Drouvot &lt;bertranddrouvot.pg@gmail.com&gt;
Discussion: https://www.postgresql.org/message-id/flat/2273bc2a-045d-4a75-8584-7cd9396e5534%40eisentraut.org
</content>
</entry>
<entry>
<title>Rename AssertVariableIsOfType to StaticAssertVariableIsOfType</title>
<updated>2026-02-03T07:45:24Z</updated>
<author>
<name>Peter Eisentraut</name>
</author>
<published>2026-02-03T07:36:47Z</published>
<link rel='alternate' type='text/html' href='http://git.postgresql.org/cgit/postgresql.git/commit/?id=137d05df2f2014c584b229310b8635fa6a8572ba'/>
<id>urn:sha1:137d05df2f2014c584b229310b8635fa6a8572ba</id>
<content type='text'>
This keeps run-time assertions and static assertions clearly separate.

Reviewed-by: Bertrand Drouvot &lt;bertranddrouvot.pg@gmail.com&gt;
Discussion: https://www.postgresql.org/message-id/flat/2273bc2a-045d-4a75-8584-7cd9396e5534%40eisentraut.org
</content>
</entry>
<entry>
<title>Update copyright for 2026</title>
<updated>2026-01-01T18:24:10Z</updated>
<author>
<name>Bruce Momjian</name>
</author>
<published>2026-01-01T18:24:10Z</published>
<link rel='alternate' type='text/html' href='http://git.postgresql.org/cgit/postgresql.git/commit/?id=451c43974f8e199097d97624a4952ad0973cea61'/>
<id>urn:sha1:451c43974f8e199097d97624a4952ad0973cea61</id>
<content type='text'>
Backpatch-through: 14
</content>
</entry>
<entry>
<title>Remove circular #include's between plpython.h and plpy_util.h.</title>
<updated>2025-04-27T15:43:02Z</updated>
<author>
<name>Tom Lane</name>
</author>
<published>2025-04-27T15:43:02Z</published>
<link rel='alternate' type='text/html' href='http://git.postgresql.org/cgit/postgresql.git/commit/?id=2311f193ea7db23f68f5471ae2c35940fc0d4794'/>
<id>urn:sha1:2311f193ea7db23f68f5471ae2c35940fc0d4794</id>
<content type='text'>
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 &lt;bertranddrouvot.pg@gmail.com&gt;
Author: Tom Lane &lt;tgl@sss.pgh.pa.us&gt;
Reviewed-by: Bertrand Drouvot &lt;bertranddrouvot.pg@gmail.com&gt;
Discussion: https://postgr.es/m/aAxQ6fcY5QQV1lo3@ip-10-97-1-34.eu-west-3.compute.internal
</content>
</entry>
<entry>
<title>Use PG_MODULE_MAGIC_EXT in our installable shared libraries.</title>
<updated>2025-03-26T15:11:02Z</updated>
<author>
<name>Tom Lane</name>
</author>
<published>2025-03-26T15:11:02Z</published>
<link rel='alternate' type='text/html' href='http://git.postgresql.org/cgit/postgresql.git/commit/?id=55527368bd07248e91e3d37a782bf66b76f06865'/>
<id>urn:sha1:55527368bd07248e91e3d37a782bf66b76f06865</id>
<content type='text'>
It seems potentially useful to label our shared libraries with version
information, now that a facility exists for retrieving that.  This
patch labels them with the PG_VERSION string.  There was some
discussion about using semantic versioning conventions, but that
doesn't seem terribly helpful for modules with no SQL-level presence;
and for those that do have SQL objects, we typically expect them
to support multiple revisions of the SQL definitions, so it'd still
not be very helpful.

I did not label any of src/test/modules/.  It seems unnecessary since
we don't install those, and besides there ought to be someplace that
still provides test coverage for the original PG_MODULE_MAGIC macro.

Author: Tom Lane &lt;tgl@sss.pgh.pa.us&gt;
Discussion: https://postgr.es/m/dd4d1b59-d0fe-49d5-b28f-1e463b68fa32@gmail.com
</content>
</entry>
<entry>
<title>Use @extschema:name@ notation in contrib transform modules.</title>
<updated>2025-01-09T20:16:56Z</updated>
<author>
<name>Tom Lane</name>
</author>
<published>2025-01-09T20:16:56Z</published>
<link rel='alternate' type='text/html' href='http://git.postgresql.org/cgit/postgresql.git/commit/?id=bebe9040388bb2292585eab712fe4d29a71843fb'/>
<id>urn:sha1:bebe9040388bb2292585eab712fe4d29a71843fb</id>
<content type='text'>
Harden hstore_plperl, hstore_plpython, and ltree_plpython
against search-path-based attacks by using @extschema:name@
notation to refer to the underlying hstore or ltree data type.

This allows removal of the previous documentation warning
suggesting that they must be installed in the same schema as
the underlying data type.  In passing, also improve a para in
extend.sgml to suggest using @extschema:name@ for such purposes.

Discussion: https://postgr.es/m/692480.1736021695@sss.pgh.pa.us
</content>
</entry>
<entry>
<title>Update copyright for 2025</title>
<updated>2025-01-01T16:21:55Z</updated>
<author>
<name>Bruce Momjian</name>
</author>
<published>2025-01-01T16:21:55Z</published>
<link rel='alternate' type='text/html' href='http://git.postgresql.org/cgit/postgresql.git/commit/?id=50e6eb731d98ab6d0e625a0b87fb327b172bbebd'/>
<id>urn:sha1:50e6eb731d98ab6d0e625a0b87fb327b172bbebd</id>
<content type='text'>
Backpatch-through: 13
</content>
</entry>
</feed>
