It appears that the Postgresql installation is split into three folder locations on Debian:Configuration: /etc/postgresqlBinaries: /usr/lib/postgresqlData: /var/lib/postgresqlI understand the benefits of splitting up the configuration files and the data, however, the binaries location is confusing to me -- why wouldn't it simply be in /usr/bin?More to the point, why would some binaries go into /usr/bin and others into /usr/lib?
Logic behind Postgres binary installation path on Debian
debian;postgresql;fhs
This splitting is pretty typical for most services. I'm on Fedora but most distributions do the same in terms of organizing files based on their type, into designated areas.Taking a look at the Postgres SQL server:The configuration files go into /etc/Executables go into /usr/binLibraries go into /usr/lib64/pgsql/Locale information goes into /usr/share/locale/Man pages and docs goes into /usr/share/Data goes into /var/lib/The rational for having a libraries directory usr/lib/postgresql in your case, which is equivalent to /usr/lib64/pgsql/ for my install, is that applications can make use of libraries of functions that are provided by Postgres. These functions are contained in these libraries. So as an application developer, you could link against the libraries here to incorporate function calls into Postgres, into your application. These libraries will often times include API documentation, and the developers of Postgres make sure to keep their API specified and working correctly through these libraries, so that applications that make use of them, can be guaranteed that they'll work correctly with this particular version of Postgres.