How to install PostgreSQL binaries on a different directory than the default one

From: Allie Crawford <CrawfordMA(at)ChurchofJesusChrist(dot)org>
To: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: How to install PostgreSQL binaries on a different directory than the default one
Date: 2021-04-02 22:01:34
Message-ID: CY4PR04MB04708D1056C0F1E29FA8AB94D97A9@CY4PR04MB0470.namprd04.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,
I am new in postgresql and I am trying to install PostgreSQL on Linux server but instead of using the default location for the binaries I want to install them in a different directory.
I have research for a while and I cannot find any information on how to do that using the dnf utility which is what the PostgreSQL website gives me as instruction when I go the download page.

I have a directory called /pg01 that I want to use to install the binaries. The postgreSQL download site (https://www.postgresql.org/download/linux/redhat/ ) gives me the following steps to install the binaries:

Steps to install postgresql 13

sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
sudo dnf -qy module disable postgresql
sudo dnf install -y postgresql13-server
sudo /usr/pgsql-13/bin/postgresql-13-setup initdb
sudo systemctl enable postgresql-13
sudo systemctl start postgresql-13

That set of instructions shown right above, installs the binaries under the /usr/pgsql-13, and what I want is to install the binaries under /pg01 instead of /usr.

My question is, what are the changes I need to do in the instructions detailed right above, so that I can get the binary installation under the /pg01 directory instead of the default /usr directory.

Thanks in advance for any help you can five me on this.

Regards,
Allie

Responses

Browse pgsql-general by date

  From Date Subject
Next Message A. Reichstadt 2021-04-02 23:06:41 How to deny access to Postgres when connected from host/non-local
Previous Message John W Higgins 2021-04-02 21:00:03 Re: Have I found an interval arithmetic bug?