Solved

Why do I have 2 versions of psql, pg_dump and other tools?

Posted on 2014-04-08
10
1,154 Views
Last Modified: 2014-05-13
Hello experts,

In Scientific Linux 6.3 (haven't tested this in CentOS), why do I have 2 versions of tools such as psql and pg_dump?:
[root@sl ~]# find / -name psql
/usr/bin/psql
/usr/pgsql-9.3/bin/psql

Open in new window

My installation process boils down to these steps:
rpm -i http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-sl93-9.3-1.noarch.rpm
yum install postgresql93-server postgresql93-contrib postgresql-contrib 
service postgresql-9.3 initdb

Open in new window

So when I invoke the tools without an absolute path:

WARNING: psql version 8.4, server version 9.3.

And the most important question would be, how can I fix this in a cleanly manner? I see the following recommendation but its more like a workaround to me:

http://serverfault.com/questions/426480/pg-dump-not-working-do-i-need-to-change-order-of-path
0
Comment
Question by:José Méndez
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 20

Author Comment

by:José Méndez
ID: 39987633
Ok I just added this line to the end of my .bashrc :

export PATH=/usr/pgsql-9.3/bin:$PATH

Open in new window


Would still want some input about this method of fixing it, and if someone could please help me understand why are there 2 versions of the tools, that would be awesome.

Thanks,
0
 
LVL 22

Expert Comment

by:earth man2
ID: 39989503
IThought you use
rpm -U
to update an installation else you risk a double install.
You can use rpm to uninZstall a package.  Sorry I don't have experience of this flavour of Linux.  I use Fedora.
0
 
LVL 20

Author Comment

by:José Méndez
ID: 39989595
the rpm line is meant to install the repo =S, but I get your point, if the software is already there, instead of installing, I'll need to figure out how to update the tools from this new repo I added. Not sure why since the yum command is not specific for the tools
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 22

Expert Comment

by:earth man2
ID: 39989980
to relocate default ie default package dir is in conflict with your current install you could try

rpm -i --relocate /usr/pgsql-9.3/bin=/usr/bin packagename.rpm

yum --installroot=<path> install <package>

These tools have a verbose / dry run mode so you can see what files will be acted upon.
0
 
LVL 62

Expert Comment

by:gheist
ID: 39997883
You must run correct client to get rid of the warning
Since you installed from postgresql.org rpm, the system included psql is obsolete.
0
 
LVL 2

Expert Comment

by:Jack Frost
ID: 40021099
You may not have two versions.  You might want to check using ls -l and see if the entry in /usr/bin is a symlink to the actual program.  Many entries in /usr/bin are like that.  It gives you version independent access that survives through updates.
0
 
LVL 62

Expert Comment

by:gheist
ID: 40021349
You can have at least 4 versions.... All supported and running at once... (SCL, postgresql.org and one in system)
0
 
LVL 20

Accepted Solution

by:
José Méndez earned 0 total points
ID: 40024103
Its the postgresql-contrib package the one that introduces the duplicate tools!!! I am trying to figure out now why that one is needed.
0
 
LVL 62

Expert Comment

by:gheist
ID: 40024156
If you post output of "rpm -qa | grep postg" and somebody might be able to help... Otherwise close the question.
0
 
LVL 20

Author Closing Comment

by:José Méndez
ID: 40061302
Here are the correct steps to install, taken from www.postgresql.org/download/linux/redhat/, from which I got errors back in like 2012 or something (for Scientific Linux):

yum install http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-sl93-9.3-1.noarch.rpm
yum install postgresql93.x86_64 postgresql93-contrib.x86_64

Now I have
# psql -V
psql (PostgreSQL) 9.3.4

x)

Thanks all!!

P:S.: Gheist you posted 3 times in this thread, none of which had ANY sense. Whats with the power trip telling people to close out their questions if your demands are not met?? LOL
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Over the years I've spent many an hour playing on hardened, DMZ'd servers, with only a sub-set of the usual GNU toy's to keep me company; frequently I've needed to save and send log or data extracts from these server back to my PC, or to others, and…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question