jsoncdc
jsoncdc copied to clipboard
Use Postgres error handling and logging
This would be ideal as otherwise it will crash postgres, right?
The particular line highlighted above -- panicing on a non-existent change type -- might be better handled with logging. I suspect it is impossible in practice -- what there is to log in WAL is INSERT, UPDATE and DELETE -- but it could happen.
Probably also want to look into the possibility of failure in the call to row_to_json. (Which would be indicated by a null result.)
Ok - to safeguard against new types (e.g. pg 9.6 or 9.7+), which would not be a breaking change, monitoring the postgres error log by use of elog would be ideal.