The access at Postgres.terminate_backend.input[0] causes a crash:
CREATE OR REPLACEFUNCTIONpy_backend_control() RETURNS text LANGUAGE python AS
$python$
import Postgres
def main():
# validate what we can, and be done. :(
assert isinstance(Postgres.terminate_backend, Postgres.Function)
assert Postgres.terminate_backend.input[0]['atttypid'] ==Postgres.CONST["INT4OID"]
assert isinstance(Postgres.cancel_backend, Postgres.Function)
assert Postgres.cancel_backend.input[0]['atttypid'] ==Postgres.CONST["INT4OID"]
return 'success'
$python$;
-- pretty weak test :(SELECT py_backend_control();
The access at Postgres.terminate_backend.input[0] causes a crash: