Correct event_id fetching for postgres