Safe to delete old data after pg_upgrade? I am not a DBA but I am responsible for a modest pg installation. Recently as part of a larger program of system upgrades I upgraded from 9.5 to 10. Everything went great, except that our monitoring system is now regularly sending warnings about disk space. I see that there is still a big chunk of space taken up by /var/lib/postgresql/9.5/ -- is there any good reason not to delete all that? What if any additional steps should I take to verify that it's safe to delete the contents of that directory?
They generally compress well.  I'd just tar and compress it and remove the original, and your monitoring system will probably be happy. (And anything trying to use it should start throwing errors once it is no longer there, and then you can fix them). But you should have a bigger-picture data retention policy, and that should govern how long you keep the compressed copy.

At some point enough activity has happened in v10, that if a major problem surfaced you would just have to fix it rather than rolling back to v9.5 and losing the changes made in v10.  At that point, the old copy is pretty useless except for PITR purposes.