Hi David,
I have written an example app using VFP 7 as a front-end client to connect to a postgres back-end server. The app is based entirely on SPTs, and include techniques to place the cursor into a table. If a new SQL is executed, the new cursor is fetched, the table is zapped, and the cursor is again copied into the table. The grid's record source is the table which is zapped instead of close; therefore, the grid never need be rebuilt because its recordsource is never lost.
The app includes source and is freeware to be used as an example of how VFP can work with remote database back-ends like MSSQL, MySQL, DB2, Oracle, Sybase, Informix, Postgres, etc. There is a generic version of the app here at UT. Also, the latest version of the app, that is not so generic because it uses transaction and referential integrity specific to postgres, can be downloaded at:
https://www.smvfp.com/I have a live postgres database to which you can connect to test the code.
If you have time you might take a look. Maybe some of the techniques used can be incorporated into your solution.