In the previous recipe, we saw how pg_upgrade can be used to perform a major version in simple steps. However, it does take a long time to perform the upgrade this way when the database cluster is of several GBs or TBs in size. For this reason, we have an option in pg_upgrade to use hard links to make the upgrades finish in a few seconds.
When the hard links option is used, the data files are not copied from one cluster to another cluster. Instead, the files and directories created in the new cluster are linked to the files and directories in the old cluster. So, only the files and directories are created but the data copy is avoided when hard links are used. This only works when the upgrade is happening within the same filesystem. The only difference between the previous recipe and this recipe is that the upgrade using hard links is done by adding a -k argument to the pg_upgrade command used...