Re: BUG #19504: Segmentation fault in plpython3u function (pg19)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: rekgrpth(at)gmail(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19504: Segmentation fault in plpython3u function (pg19)
Date: 2026-06-02 19:26:12
Message-ID: 2950242.1780428372@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Zsolt Parragi 2026-06-02 23:03:46 Re: Possible G2-item at SERIALIZABLE
Previous Message Tom Lane 2026-06-02 19:21:45 Re: GREATEST/LEAST ignores comparison operator volatility in contain_volatile_functions_walker