bug fix to be able to write unicode chars to debug file
added first test cases for PostgreSQL