Subject: How to Build Postgres in a Portable / Relocatable fashion?

From: AJ ONeal <[email-masked]>
Date: Fri, 03 May 2024 22:57:19 +0000

Back in the good old days there was official 1st-party support for Linux:
https://www.enterprisedb.com/downloads/postgres-postgresql-downloads

Those binaries could be tar xvf​'d and used without any fuss or muss, from any location, on any distro.

I'm the core maintainer of https://webinstall.dev/ and I'm thinking to break our "official builds only" rule because, well, I haven't been able to find any way to get up-to-date builds from an official channel - and apt​ is always half-a-decade out-of-date (part of the reason for Webi, but Webi is far worse in this case, stuck at v10).

Could I get some help on how to do that?
Are the old build processes documented somewhere? Or are there some scripts in a far corner of the Internet that could still do that?

Or what options might I need to pass to ./configure to get it to build with relative locations?
I'm not a C developer, and I'm not familiar with C build tools beyond ./configure; make; sudo make install​.

I'd really appreciate some direction on this. Thanks.

AJ ONeal

---

From: Adrian Klaver <[email-masked]>
Date: Fri, 3 May 2024 16:09:21 -0700

> Back in the good old days there was official 1st-party support for Linux:

Still there.

The below is for the EDB installer, which at this point is only  for 
MacOS and Windows as Unixen platforms have there own packaging. This 
was/is a third party site.

> <https://www.enterprisedb.com/downloads/postgres-postgresql-downloads>
> 
> Those binaries could be |tar xvf|​'d and used without any fuss or muss, 
> from any location, on any distro.
> 
> I'm the core maintainer of https://webinstall.dev/ 
> <https://webinstall.dev/> and I'm thinking to break our "official builds 
> only" rule because, well, I haven't been able to find any way to get 
> up-to-date builds from an official channel - and |apt|​ is always 
> half-a-decade out-of-date (part of the reason for Webi, but Webi is far 
> worse in this case, stuck at v10).

I don't see that. Using PGDG repo on Ubuntu 22.04:

apt list --installed | grep postgres

postgresql-14/jammy-pgdg,now 14.11-1.pgdg22.04+1 amd64 [installed]
postgresql-15-pgtap/jammy-pgdg,now 1.3.3-1.pgdg22.04+1 all [installed]
postgresql-15/jammy-pgdg,now 15.6-1.pgdg22.04+1 amd64 [installed]
postgresql-16-pgtap/jammy-pgdg,now 1.3.3-1.pgdg22.04+1 all [installed]
postgresql-16-unit/jammy-pgdg,now 7.8-1.pgdg22.04+1 amd64 [installed]
postgresql-16/jammy-pgdg,now 16.2-1.pgdg22.04+1 amd64 [installed,automatic]
postgresql-client-14/jammy-pgdg,now 14.11-1.pgdg22.04+1 amd64 
[installed,automatic]
postgresql-client-15/jammy-pgdg,now 15.6-1.pgdg22.04+1 amd64 
[installed,automatic]
postgresql-client-16/jammy-pgdg,now 16.2-1.pgdg22.04+1 amd64 
[installed,automatic]
postgresql-client-common/jammy-pgdg,now 259.pgdg22.04+1 all 
[installed,automatic]
postgresql-common/jammy-pgdg,now 259.pgdg22.04+1 all [installed,automatic]
postgresql-plpython3-14/jammy-pgdg,now 14.11-1.pgdg22.04+1 amd64 [installed]
postgresql-plpython3-15/jammy-pgdg,now 15.6-1.pgdg22.04+1 amd64 [installed]
postgresql-plpython3-16/jammy-pgdg,now 16.2-1.pgdg22.04+1 amd64 [installed]
postgresql-server-dev-16/jammy-pgdg,now 16.2-1.pgdg22.04+1 amd64 [installed]
postgresql/jammy-pgdg,now 16+259.pgdg22.04+1 all [installed]

> Are the old build processes documented somewhere? Or are there some 
> scripts in a far corner of the Internet that could still do that?

As to Apt build scripts:

https://wiki.postgresql.org/wiki/Apt/RepoDocs

> I'm not a C developer, and I'm not familiar with C build tools beyond 
> |./configure; make; sudo make install|​.
> 

-- 
Adrian Klaver
[email-masked]