Having difficulty catching postgresql exception in sequel/ruby
- by mhd
I have postgresql table that has somekind of unique constraint.
I have ruby script that will update this table.
The ruby script should be able to switch to UPDATE instead of INSERT
when this kind of error occured:
PGError: ERROR: duplicate key value violates unique constraint
CMIIW, sequel seems cannot catch this exception??
Anyway,sample code…