Fixed up queries for postgres

I've just noticed that the bundle can't be installed on postgres, due to malformed sql queries. This is likely coming from a bug in dbal's postgres platform (still digging though).