upsating for newer postgresql