$unique implemented. Note: one case only works with postgres