PostgreSQL 12 package on FreeBSD

In the case you need to install PostgreSQL 12 on FreeBSD please consider it has not reached the quarterly pkg(1) update, therefore if you install it via pkg(1) you will get PostgreSQL 12 rc1. However, in the ports tree, PostgreSQL is clearly at version 12 (release).
This behavior is due to the fact that since FreeBSD 12, the default repository for packages is quarterly, that in short means packages are older than the ports tree.

In order to install the official release, a new URL for the FreeBSD repository must be set up. The repository URL is placed into the file /etc/pkg/FreeBSD.conf:
FreeBSD: {
  url: "pkg+${ABI}/quarterly",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
The pkg(1) configuration allows the overriding of the default URL placing a file /usr/local/etc/pkg/FreeBSD.conf that overrides the properties of the above, so with the content:
FreeBSD: {
  url: "pkg+${ABI}/latest"
After that, the repository can be updated and new packages will be available. Therefore, run:
% sudo pkg update
% sudo pkg install postgresql12-client-12 \
                   postgresql12-contrib-12 \
                   postgresql12-docs-12 \
                   postgresql12-plperl-12 \ 

The article PostgreSQL 12 package on FreeBSD has been posted by Luca Ferrari on November 4, 2019