fix pg select