Re: BUG #19504: Segmentation fault in plpython3u function (pg19) - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #19504: Segmentation fault in plpython3u function (pg19)
Date
Msg-id 2950242.1780428372@sss.pgh.pa.us
Whole thread
In response to BUG #19504: Segmentation fault in plpython3u function (pg19)  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
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



pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: GREATEST/LEAST ignores comparison operator volatility in contain_volatile_functions_walker
Next
From: Zsolt Parragi
Date:
Subject: Re: Possible G2-item at SERIALIZABLE