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

From: AJ ONeal <[email-masked]>
Date: Fri, 03 May 2024 23:27:12 +0000

> > Back in the good old days there was official 1st-party support for Linux:
> This
> was/is a third party site.

Oh. I thought that EDB was *the* Postgres company like MySQL AB was *the* MySQL company. My mistake.

> and `apt`​ is always half-a-decade out-of-date

I misspoke. I meant the OS repos more than apt itself.

> As to Apt build scripts:

I was just using apt as an example. I don't actually want to deal with apt or .debs.

What I want to create (and provide) is a portable tarball that has most of all what it needs in the tarball and will look for relevant libraries relative to itself. Something that Just Works™ *almost* anywhere (Ubuntu, Debian, RedHat, Suse... maybe even Alpine).

Any idea how to do that?

---

From: Tom Lane <[email-masked]>
Date: Fri, 03 May 2024 19:44:54 -0400

AJ ONeal <[email-masked]> writes:
> What I want to create (and provide) is a portable tarball that has
> most of all what it needs in the tarball and will look for relevant
> libraries relative to itself.

See

https://www.postgresql.org/docs/current/installation.html

particularly the discussion of installation relocatability under

https://www.postgresql.org/docs/current/install-make.html#CONFIGURE-OPTIONS-LOCATIONS

In short, you have to specify an installation path, but as long
as you don't muck with the relative locations of the subdirectories
it should be possible to move the whole tree to a different
installation location.

> Something that Just Works™ *almost* anywhere (Ubuntu, Debian, RedHat, Suse... maybe even Alpine).

That's a little harder, mainly because the shared libraries for
dependencies like openssl etc may not be 100% compatible across
all those platforms.  Different versions, different build options,
yadda yadda.

Maybe you should be thinking in terms of a docker container
or the like?

			regards, tom lane

---

From: [email-masked]
Date: Sat, 4 May 2024 10:56:04 -0700

On Fri, May 03, 2024 at 11:27:12PM GMT, AJ ONeal wrote:

> libraries relative to itself. Something that Just Works™ *almost*
> anywhere (Ubuntu, Debian, RedHat, Suse... maybe even Alpine).

Alpine is based on musl (not glibc), so you're pretty much OOL at
least on that point.

Have you thought about using a container?

-- 
Ian