From: Tom Lane <tgl@sss.pgh.pa.us>
To: rekgrpth@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19504: Segmentation fault in plpython3u function (pg19)
Date: Tue, 02 Jun 2026 15:26:12 -0400
Message-ID: <2950242.1780428372@sss.pgh.pa.us> (raw)
In-Reply-To: <19504-38cee6d64aa466e0@postgresql.org>
References: <19504-38cee6d64aa466e0@postgresql.org>
PG Bug reporting form <noreply@postgresql.org> writes:
> CREATE OR REPLACE FUNCTION f() RETURNS text AS $$
> import ctypes
> postgres = ctypes.CDLL(None)
> pchomp = postgres['pchomp']
> # pchomp.restype = ctypes.c_char_p
> return ctypes.cast(pchomp("error\n"), ctypes.c_char_p).value
> $$ LANGUAGE plpython3u;
This is not a Postgres bug, it's an incorrect plpython function.
Type text is not equivalent to "char *".
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, rekgrpth@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19504: Segmentation fault in plpython3u function (pg19)
In-Reply-To: <2950242.1780428372@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox