ghetto cross DB syntax, should move to postgresql soon