I'm a noob to linux and pi so may just be missing the obvious but it appears the latest version available for the pi is 11.x which does not support generated columns. I am in the process of porting an app from windows which relies on generated columns so I need version 12.
This will probably be easier than (cross-)compiling it from source yourself, and running services like Postgres in a Docker container is a pretty standard practice these days.
The postgresql project has binaries available for Debian using a repository with adding an entry in
/etc/apt/sources.list as you can see at Postgresql - Linux downloads (Debian). But you will also find there that it is only
available on the following architectures:
armhf for the Raspberry Pi isn't part of the list so you are lost to compile it from source but I'm afraid that will take hours on a RasPi even on a RPi 4B with 4GB ram.
You can also compile on a more powerful computer with an intel processor (amd64) for the Raspberry Pi (armhf). This is called cross compiling but need some knowledge about compiling and isn't an easy task for a beginner. You could ask google how to do it and if running into problems just ask here.