How to completely disable PostgreSQL

Kent Brockman

Well-Known Member
PartnerNOC
Jan 20, 2008
1,337
75
178
Buenos Aires, Argentina
cPanel Access Level
Root Administrator
Hello guys. I want to completely disable/uninstall PostgreSQL in my servers. What's the recommended procedure? I googled around a bit and found cPanel Docs don't provide this information and there are some tuts with dates around 5-10 years ago, like this one:
how to remove postgresql out of WHM/cpanel completely ?

I found that deactivating the service in Service Manager, doesn't completely delete the RPMs nor deleted the Postgres icons from cPanel screens. In fact, I'm receiving every night a report from some cron task:

Code:
Subject:
Cron <[email protected]> /usr/bin/test -x /usr/local/cpanel/scripts/update_db_cache && /usr/local/cpanel/scripts/update_db_cache

Content:
warn [update_db_cache] postgres is stopped
So, I wanted to ask for updated information. Please. Thanks in advance!
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463
Hello,

To disable PostgreSQL, you'd need to take the following steps:

1. Remove the PostgreSQL RPMs (not the cpanel-postgresql RPMS). EX:

Code:
yum remove postgresql
rpm -e --nodeps postgresql-libs-9.2.23-3.el7_4.x86_64
2. Select "PostgreSQL" in the "Disabled" feature list via "WHM >> Feature Manager".

I completed these steps on a test system and the PostgreSQL options were no longer visible. Additionally, the service was automatically removed.

Thank you.
 
  • Like
Reactions: Kent Brockman

Kent Brockman

Well-Known Member
PartnerNOC
Jan 20, 2008
1,337
75
178
Buenos Aires, Argentina
cPanel Access Level
Root Administrator
As a footnote, I also disabled the icon of phpPgAdmin in the "Disabled" feature.
Is there any possibility to uninstall it as well? or won't it do any hurt?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463
Hello,

The feature name itself isn't automatically removed, but there's no harm in leaving it enabled. As far as documentation, I recommend voting and adding feedback to the following feature request instead, as removing system RPMs (the install script simply installs PostgreSQL from the OS repos) isn't something we'd typically document:

Improved PostgreSQL support

If support for PostgreSQL were to be improved, the ability to install or uninstall it would be offered directly from WHM.

Thank you.
 
  • Like
Reactions: Kent Brockman