switch to raw sql to make postgres happy