FreeBSD has an official alternative to getting additional software through the Ports Collection.
Ports are source code that come with all the patches and Makefiles required to compile and install a specific program on FreeBSD.
There are thousands of ports in the directories that may become time-consuming to browse through. You can use tools like 'whereis' or build the index file using the make command to search for a port.
The PostgreSQL 17 can be installed by using the Ports Collection. Enter the ports directory, make install and let it build and install. PostgreSQL sources will then begin to download, and you will be asked various questions.
Once it is done, you'll find the PostgreSQL binaries in /usr/local/bin/. All the questions answered can also be given on the command line to automate the process.
A lot of additional stuff is available in the ports collection. If something is not available as a package, have a look there.
If you want to see what’s going in the ports collection, have a look at FreshPorts.