Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wUUkk-001CPp-2d for pgsql-bugs@arkaria.postgresql.org; Tue, 02 Jun 2026 19:26:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wUUkj-00FqVq-20 for pgsql-bugs@arkaria.postgresql.org; Tue, 02 Jun 2026 19:26:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wUUkj-00FqVi-1C for pgsql-bugs@lists.postgresql.org; Tue, 02 Jun 2026 19:26:17 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wUUkh-00000000umy-1KD8 for pgsql-bugs@lists.postgresql.org; Tue, 02 Jun 2026 19:26:17 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.18.1/8.18.1) with ESMTP id 652JQCS52950243; Tue, 2 Jun 2026 15:26:12 -0400 From: Tom Lane To: rekgrpth@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19504: Segmentation fault in plpython3u function (pg19) In-reply-to: <19504-38cee6d64aa466e0@postgresql.org> References: <19504-38cee6d64aa466e0@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Tue, 02 Jun 2026 08:58:26 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2950241.1780428372.1@sss.pgh.pa.us> Date: Tue, 02 Jun 2026 15:26:12 -0400 Message-ID: <2950242.1780428372@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form 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