Removing postgresql

If it doesn't fit in another category, ask it here.
Post Reply
fgoncalo
Posts: 16
Joined: 2011/05/15 22:31:20

Removing postgresql

Post by fgoncalo » 2011/06/13 08:58:14

Hi there,


Is there any possible way of removing ALL data related to postgresql?


I've tried

su -
yum remove *postgres*

But i dont thing it removes everything...
I want to do it, because i want to re-install everything again (postgresql,postgres-server, etc..)

Thanks in advance,
Filipe

User avatar
TrevorH
Forum Moderator
Posts: 23879
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Removing postgresql

Post by TrevorH » 2011/06/13 18:59:37

[code]
yum remove postgres\*
mv /var/lib/pgsql /var/lib/old.pgsql
yum install postgres-whatever
[/code]

Please be aware that postgres-libs is a dependency for a large number of packages so running yum remove postgres\* may nuke considerably more than you expect so make sure you inspect the list of packages carefully before you blindly say 'y'!

fgoncalo
Posts: 16
Joined: 2011/05/15 22:31:20

Re: Removing postgresql

Post by fgoncalo » 2011/06/14 00:14:43

Thank you very much for your answer. I'm going to give it a try, first thing tomorrow.
I'll let you know if it worked for me.

I'm trying this, because I am trying to (re)install Postgresql. And when i try to command service postgresql-9.0 start it outputs FAILED.

Once again, thank you for your time,
Filipe

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Removing postgresql

Post by pschaff » 2011/06/14 12:28:49

[quote]
fgoncalo wrote:
...
I'm trying this, because I am trying to (re)install Postgresql. And when i try to command service postgresql-9.0 start it outputs FAILED.
...[/quote]
You are not running CentOS postgresql-server as there is no such service. The CentOS packages are:
postgresql-server-8.1.23-1.el5_6.1
postgresql84-server-8.4.7-1.el5_6.1

Both provide /etc/rc.d/init.d/postgresql and not "postgresql-9.0". None of the well-known repos provides postgresql 9.0. The previous advice may not be applicable.

fgoncalo
Posts: 16
Joined: 2011/05/15 22:31:20

Re: Removing postgresql

Post by fgoncalo » 2011/06/14 13:39:04

So shall i remove evrything about postgresql that i have on my pc, and re install those packages that you've mentioned? Via yum?

Thank you for your time,
Filipe

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: Removing postgresql

Post by pschaff » 2011/06/14 20:46:50

If you want to reinstall then remove all you have installed, but given the "foreign" version it may not have been installed by the package manager, which would make things more difficult.

You don't want to install both package I mentioned. They are alternative versions, and you will need others.[code]
# yum list postgresql\*
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
Excluding Packages from CentOS-5 - Extras
Finished
95 packages excluded due to repository priority protections
Installed Packages
postgresql.i386 8.1.23-1.el5_6.1 installed
postgresql-libs.i386 8.1.23-1.el5_6.1 installed
postgresql-python.i386 8.1.23-1.el5_6.1 installed
postgresql-server.i386 8.1.23-1.el5_6.1 installed
Available Packages
postgresql-contrib.i386 8.1.23-1.el5_6.1 updates
postgresql-devel.i386 8.1.23-1.el5_6.1 updates
postgresql-docs.i386 8.1.23-1.el5_6.1 updates
postgresql-jdbc.i386 8.1.407-1jpp.4 base
postgresql-odbc.i386 08.01.0200-3.1 base
postgresql-pl.i386 8.1.23-1.el5_6.1 updates
postgresql-tcl.i386 8.1.23-1.el5_6.1 updates
postgresql-test.i386 8.1.23-1.el5_6.1 updates
postgresql84.i386 8.4.7-1.el5_6.1 updates
postgresql84-contrib.i386 8.4.7-1.el5_6.1 updates
postgresql84-devel.i386 8.4.7-1.el5_6.1 updates
postgresql84-docs.i386 8.4.7-1.el5_6.1 updates
postgresql84-libs.i386 8.4.7-1.el5_6.1 updates
postgresql84-plperl.i386 8.4.7-1.el5_6.1 updates
postgresql84-plpython.i386 8.4.7-1.el5_6.1 updates
postgresql84-pltcl.i386 8.4.7-1.el5_6.1 updates
postgresql84-python.i386 8.4.7-1.el5_6.1 updates
postgresql84-server.i386 8.4.7-1.el5_6.1 updates
postgresql84-tcl.i386 8.4.7-1.el5_6.1 updates
postgresql84-test.i386 8.4.7-1.el5_6.1 updates
[/code]

Post Reply