make the product query compatible with postgres