Fetch only the PGDG repository
Move long commands and multiline text into heredocs

Uses `sort` to perform version comparisons.