This error 'the cursor is open' took me some hours to resolve, so I submit here the explanation in order to propose a solution for people experiencing the same problem.
Problem description : trying to get data from postgreSQL through standard function SQLEXEC raised "Syntax Error", while the same query runs correctly on PGAdmin. Morecover, subsequent queries systematically raised "The cursor is open" (each time being necessary to kill Postgres process AND to reinit the VFP connexion).
Conditions: Postgres 9.3.3, Windows XP SP2, PostgreSQL ODBC Driver(UNICODE) version 9.02.01.00, Visual FoxPro 9 SP1
Solution: SQLExec 3rd parameter should not contain a dot ("."). For example, the command SQLExec(1, 'Select 1', '.F.') raises the problem, when SQLExec(1, 'Select 1', 'F') does not.
In my case '.F.' value was generated programmatically, which made the diagnosis difficult.