Fix encoding in postgresql database state