initial attempt for abstraction; druid works with Derby as default

postgres has a different sql statement