jsoncdc icon indicating copy to clipboard operation
jsoncdc copied to clipboard

Use Postgres error handling and logging

Open solidsnack opened this issue 9 years ago • 3 comments

The panic! in append_change could be logged many not treated as a panic at all, for example.

solidsnack avatar Feb 24 '16 10:02 solidsnack

This would be ideal as otherwise it will crash postgres, right?

ruimarinho avatar Jun 02 '16 01:06 ruimarinho

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.)

solidsnack avatar Jun 02 '16 03:06 solidsnack

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.

ruimarinho avatar Jun 02 '16 15:06 ruimarinho