0

i been trying to install postgres 10.5 on this machine and despite i set the installation path it always ends up selecting that particular directory everytime.. experts pls help me out.

i have clearly set the prefix and data dir yet it chooses only the data dir

[root@DBSRV01 postgres10upd]# ./postgresql-10.4-1-linux-x64.run --datadir /opt/postgres/10.5/data --prefix /opt/postgres/10.5/ --debuglevel 4 --serverport 5433 --superpassword postgrespwd --servicename postgres-10
----------------------------------------------------------------------------
Welcome to the PostgreSQL Setup Wizard.
----------------------------------------------------------------------------
Select the components you want to install; clear the components you do not want to install. Click Next when you are ready to continue.

PostgreSQL Server [Y/n] :y
pgAdmin 4 [Y/n] :n
Stack Builder [Y/n] :n
Command Line Tools [Y/n] :y

Is the selection above correct? [Y/n]: y
----------------------------------------------------------------------------
Please select a directory under which to store your data.
Data Directory [/opt/postgres/10.5/data]: 
----------------------------------------------------------------------------
Please provide a password for the database superuser (postgres). A locked Unix user account (postgres) will be created if not present.
Password [********] :
Retype password [********] :
----------------------------------------------------------------------------
Please select the port number the server should listen on.
Port [5433]: 
.
.
[222] en_US
.
.
[716] zu_ZA
[717] zu_ZA.iso88591
[718] zu_ZA.utf8
Please choose an option [1] : 222   
----------------------------------------------------------------------------
Pre Installation Summary

The following settings will be used for the installation::

Installation Directory: /root/postgres10upd/y
Server Installation Directory: /root/postgres10upd/y
Data Directory: /opt/postgres/10.5/data
Database Port: 5433
Database Superuser: postgres
Operating System Account: postgres
Database Service: postgresql-10
Command Line Tools Installation Directory: /root/postgres10upd/y

Press [Enter] to continue:^Z
[3]+  Stopped                 ./postgresql-10.4-1-linux-x64.run --datadir /opt/postgres/10.5/data --prefix /opt/postgres/10.5/ --debuglevel 4 --serverport 5433 --superpassword Mam5pg@1 --servicename postgres-10
[root@DBSRV01 postgres10upd]#

where did i go wrong? why is it selecting that directory again and again? is is stored somewhere and being read from there thats why the same directory is always selected?

PS: a SAN is mounted to the opt directory using LVM. And i already have installed successfully on 2 other machines with same h/w & s/w configurations except that there is no SAN mounted to them.

Just now installed on another computer with the same configuration + SAN.. worked just fine [root@DBSRV02 postgres]# service postgresql-10 status pg_ctl: server is running (PID: 53224) /opt/postgres/10.5/bin/postgres "-D" "/opt/postgres/10.5/data".

Is it because the installation has once failed and that location is fixed ever since. can someone pls tell me how to remove the residues of the first failed installation.

  • try running ./postgres-10.5.2.run --help and see if it outputs anything useful (hint: the parameters you are supplying are I believe for the "configure" script, used to build postgres from source, my hunch is what you are running there is a binary distributable, already built, FWIW)... – rogerdpack Sep 17 '18 at 19:49
  • Yes. From where did you get that installation package? Also, you should copy and paste the messages as text rather than adding a screen shot. It makes it so much easier for others to copy. – Laurenz Albe Sep 17 '18 at 20:03
  • From the official postgres page https://www.enterprisedb.com/downloads/postgres-postgresql-downloads and as you have asked i had pasted the messages in text format. also i did try the --help and thats how i came up with the parameters datadir and prefix.i couldnt install using YUM / RPM as we have restrictions. no direct internet connection is allowed thats why i had to go with the binary file – Arul Prabhin Sep 18 '18 at 04:48

1 Answers1

0

Ok guys thank you all for the help! i found the culprit by searching for the directory using the command

grep -rlw "postgres10upd"

then i realized there is this file

/etc/postgres-reg.ini

with an entry

InstallationDirectory=/root/postgres10upd/y

I had edited it to "/opt/postgres/10.5"

then when installed there was no issues and got installed to exactly where i wanted.