Thread: Installing PostgreSQL as non-root by Extracting the binaries from RPMs

Installing PostgreSQL as non-root by Extracting the binaries from RPMs

From
Thiagarajan Lakshminarayanan
Date:
Hello,

In our environment, our standard RHEL OS install comes with all the PostgreSQL required packages / libraries installed.  So, can I just extract the binaries from PostgreSQL RPMs via rpm2cpio and create a tar file and install it as non-root user in an alternate location?  I tested the above approach, created a new PostgreSQL instance and it is working fine.  Please let me know if there would be any issues with the above approach?

Thanks
Raj

Re: Installing PostgreSQL as non-root by Extracting the binaries from RPMs

From
Benjamin Scherrey
Date:
You know this is something super easy to do if you do it within Docker. Advise you to go ahead and map the data directories to the host file system rather than use a storage container until you get a lot more experience with Docker. Otherwise it's crazy easy and, in fact, there already exist Docker images with Postgres installed that you could just download and use. Postgres will be entirely under local user control and requires no system level access.

  -- Ben

On Mon, May 21, 2018 at 9:23 PM, Thiagarajan Lakshminarayanan <thiagu1997@gmail.com> wrote:
Hello,

In our environment, our standard RHEL OS install comes with all the PostgreSQL required packages / libraries installed.  So, can I just extract the binaries from PostgreSQL RPMs via rpm2cpio and create a tar file and install it as non-root user in an alternate location?  I tested the above approach, created a new PostgreSQL instance and it is working fine.  Please let me know if there would be any issues with the above approach?

Thanks
Raj

Re: Installing PostgreSQL as non-root by Extracting the binaries from RPMs

From
Thiagarajan Lakshminarayanan
Date:
Thanks Benjamin.  Actually, we don't use Docker in our environment. We just use a standard RHEL OS install. Will there be any issues if I install PostgreSQL by extracting the RPM binaries?

Please let me know.

Thanks
Raj

On Mon, May 21, 2018 at 10:15 AM, Benjamin Scherrey <scherrey@proteus-tech.com> wrote:
You know this is something super easy to do if you do it within Docker. Advise you to go ahead and map the data directories to the host file system rather than use a storage container until you get a lot more experience with Docker. Otherwise it's crazy easy and, in fact, there already exist Docker images with Postgres installed that you could just download and use. Postgres will be entirely under local user control and requires no system level access.

  -- Ben

On Mon, May 21, 2018 at 9:23 PM, Thiagarajan Lakshminarayanan <thiagu1997@gmail.com> wrote:
Hello,

In our environment, our standard RHEL OS install comes with all the PostgreSQL required packages / libraries installed.  So, can I just extract the binaries from PostgreSQL RPMs via rpm2cpio and create a tar file and install it as non-root user in an alternate location?  I tested the above approach, created a new PostgreSQL instance and it is working fine.  Please let me know if there would be any issues with the above approach?

Thanks
Raj


Thiagarajan Lakshminarayanan <thiagu1997@gmail.com> writes:
> Thanks Benjamin.  Actually, we don't use Docker in our environment. We just
> use a standard RHEL OS install. Will there be any issues if I install
> PostgreSQL by extracting the RPM binaries?

What exactly is your purpose here?  Is it just that you want to run a
separate data directory somewhere?  You don't need a separate set of
binaries for that, just point PGDATA to where you want it and run the
server as the owner of that data directory.

(Depending on the details, you might need to teach SELinux to allow
this usage.  I don't remember exactly what cues SELinux to treat a
particular process as being subject to its restrictions, but use of
the system binaries is at least part of it.)

If you want to be able to build and run a server without any root
privileges at all, you might be best off just building from source.
Maybe I'm too used to doing that, but I'm not very clear on what
you gain by extracting the result of somebody else's build -- which,
almost by definition, is not exactly what you want.

            regards, tom lane


Re: Installing PostgreSQL as non-root by Extracting the binariesfrom RPMs

From
Alvaro Aguayo Garcia-Rada
Date:
Should work with no problem, but I would not recommend it. You may not be able to setup a service(SysV or systemd) to
automaticallystart postgres, and updating version could be troublesome.
 

Regards,

Alvaro Aguayo
Operations Manager
Open Comb Systems E.I.R.L.

Office: (+51-1) 3377813 | Mobile: (+51) 995540103 | (+51) 954183248
Web: www.ocs.pe

----- Original Message -----
From: "Thiagarajan Lakshminarayanan" <thiagu1997@gmail.com>
To: pgsql-general@lists.postgresql.org
Sent: Monday, 21 May, 2018 09:23:28
Subject: Installing PostgreSQL as non-root by Extracting the binaries from RPMs

Hello,

In our environment, our standard RHEL OS install comes with all the
PostgreSQL required packages / libraries installed.  So, can I just extract
the binaries from PostgreSQL RPMs via rpm2cpio and create a tar file and
install it as non-root user in an alternate location?  I tested the above
approach, created a new PostgreSQL instance and it is working fine.  Please
let me know if there would be any issues with the above approach?

Thanks
Raj