On Fri, Oct 14, 2011 at 11:32 AM, thomas veymont
<thomas.veymont@gmail.com> wrote:
> mycursor.execute ( "fetch", [ "mycursor" ] ) # fetch row from this cursor
> mycursor.fetchone()
This is the only error you have made: there is no placeholder in the
query. And even if there was, it would be an error as it would result
in something like "fetch 'mycursor' ", and postgres doesn't want the
quotes.
mycursor.execute ( "fetch mycursor" ) would do what you were
expecting. If you have to compose the command, you have no protection
though, so you should be hypercareful about where "mycursor" comes
from.
Federico is right though that using the plain query with a psycopg
named cursor makes things easier.
-- Daniele