plpython and nrows()

From: Joseph Barillari <jbarilla(at)princeton(dot)edu>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: plpython and nrows()
Date: 2002-04-25 05:25:12
Message-ID: m3sn5k9wp3.fsf@washer.barillari.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

The archives indicate that someone asked this question back in
November, but there's no record of a reply. Here goes:

I'm writing a function in plpython, and have been unable to get the
nrows() call to work. For instance, running the function:

CREATE OR REPLACE FUNCTION py_test()
RETURNS INTEGER
AS '
result = plpy.execute("""SELECT * FROM events;""")
rows = result.nrows()
return 0
'
LANGUAGE 'plpython';

results in the following:

cal=> select py_test();
ERROR: plpython: Call of function `__plpython_procedure_py_test_67236' failed.
exceptions.SystemError: error return without exception set

I know that the nrows() call is responsible for the error (removing
the call eliminates the error), but am at a loss to determine how to
fix it. The testsuite doesn't seem to test nrows() (or so I grepped),
which led me to believe (perhaps mistakenly) that the implementation
might be broken. Any suggestions as to what to try would be
appreciated.

Regards,

--Joe

Browse pgsql-general by date

  From Date Subject
Next Message Oleg Bartunov 2002-04-25 05:36:44 Re: Equivalent of FULLTEXT in mySQL
Previous Message Gregory Seidman 2002-04-25 03:48:17 Re: odd psql behaviour on OSX