public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: Re: BUG #19504: Segmentation fault in plpython3u function (pg19)
Date: Tue, 02 Jun 2026 15:26:12 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

PG Bug reporting form <[email protected]> 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






view thread (2+ messages)

reply

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: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: BUG #19504: Segmentation fault in plpython3u function (pg19)
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox