Is it possible to catch PostgreSQL output error messages in OGR after a query has failed?
For example
conn.ExecuteSQL('SELECT * FROM non_existing_table;')
In Postgres this returns an error message:
"Error: relation 'non_existing_table' does not exist."
In ogr we get the standard:
"Error: current transaction is aborted, commands ignored until end of transaction block"
It would be a bonus if we could catch/parse the Postgres error message. I suspect this is a bit of a long-shot given what I've read about SWIG/CPL, but worth asking to see if anyone's got ideas. Ideally this would be in Python, but I'll take C/C++ comments as well!
Thanks.
No comments:
Post a Comment