postgresql compatability
pg scope fix
pg char/character fix
pg char/chr fix