Move to queries+postgres