Returning inserted/updated data on postgresql databases