jwp/pg-python — Issue #32: Crash on Postgres.Function.input[0] access
Author: jwp
Created: 2011-10-15 21:47:58+00:00
State: open
Labels: critical

The access at Postgres.terminate_backend.input[0] causes a crash:

```sql
CREATE OR REPLACE FUNCTION py_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();
```