EnterpriseDB/docs

Regarding "Uninstalling PostgreSQL"

Closed this issue · 3 comments

Summary

The Mac uninstaller works just as the uninstall page says. But you could improve your text in a few ways.

A preface: in my simple case, the app ended by saying it had removed all of the things, then noted that it hadn't removed the data directory and the OS postgres user.

  • A user is left wondering if that's a problem, and what to do about it if it is. If we're installing the next version, what would happen?
  • A "Library" directory is also left behind, and we'd want to know who to clean up after that.
  • A user would also want to know what happens to pgadmin data. To this day I've never known where that lives.

Where would you like to see this added?

https://github.com/EnterpriseDB/docs/blob/main/advocacy_docs/supported-open-source/postgresql/uninstalling.mdx

Rationale

It's good to satisfy uncertainties and unknowns.

Hello, @josh-heyer. I know this isn't quite a support forum. However, two problems remain:

  • Directories and files remain beneath /Library/PostgreSQL/15 that I cannot access or manage, even as root. It looks to me like the installer has created something like a user environment.
  • This rump install has left me with an environment -- like $PATH -- with version 15 stuff, but not 16 stuff. It's not obvious (to me) what's doing that work, so I can't undo it.

Version 16 remains installed and running. If need be, I can remove that. But I'm guessing there would be remnants from that, too, so I'm reluctant to touch it without guidance.

For the record, here's what I see remaining in this rump version 15 install:

bagog:15 root# ls -lR Library/
total 0
drwx------  3 postgres  daemon   96 Aug 29 09:27 Caches
drwx------  3 postgres  daemon   96 Nov 20 18:10 ContainerManager
drwx------  6 postgres  daemon  192 Oct  1 14:56 Containers
drwx--x--x  3 postgres  daemon   96 Nov 22 21:00 Keychains
drwx------  2 postgres  daemon   64 Aug 29 09:28 Mail
drwxr-xr-x  2 postgres  daemon   64 Nov 22 09:35 Preferences

Library//Caches:
total 0
drwx------  3 postgres  daemon  96 Aug 29 09:27 com.apple.containermanagerd

Library//Caches/com.apple.containermanagerd:
total 0
ls: Library//Caches/com.apple.containermanagerd: Operation not permitted

Library//ContainerManager:
total 0
ls: Library//ContainerManager: Operation not permitted

Library//Containers:
total 0
drwx------@ 3 postgres  daemon  96 Nov 22 09:35 com.apple.CoreSpotlight.ImportExtension
drwx------@ 3 postgres  daemon  96 Nov 22 09:35 com.apple.ImageIO.imageimporter
drwx------@ 3 postgres  daemon  96 Nov 22 09:35 com.apple.PDFImporter
drwx------@ 3 postgres  daemon  96 Nov 22 09:35 com.apple.PDFKit.PDFImporter

Library//Containers/com.apple.CoreSpotlight.ImportExtension:
total 8
-rw-r--r--  1 postgres  daemon  487 Aug 29 09:28 .com.apple.containermanagerd.metadata.plist

Library//Containers/com.apple.ImageIO.imageimporter:
total 8
-rw-r--r--  1 postgres  daemon  479 Aug 29 09:28 .com.apple.containermanagerd.metadata.plist

Library//Containers/com.apple.PDFImporter:
total 8
-rw-r--r--  1 postgres  daemon  469 Aug 29 09:28 .com.apple.containermanagerd.metadata.plist

Library//Containers/com.apple.PDFKit.PDFImporter:
total 8
-rw-r--r--  1 postgres  daemon  476 Oct  1 14:56 .com.apple.containermanagerd.metadata.plist

Library//Keychains:
total 0
drwx------  5 postgres  daemon  160 Nov 22 21:00 EAC394CB-7EFD-572A-8C0A-5F27372C4E76

Library//Keychains/EAC394CB-7EFD-572A-8C0A-5F27372C4E76:
total 72
-rw-------  1 postgres  daemon   4096 Nov 22 21:00 keychain-2.db
-rw-------  1 postgres  daemon  32768 Nov 22 21:00 keychain-2.db-shm
-rw-------  1 postgres  daemon      0 Nov 22 21:00 keychain-2.db-wal

Library//Mail:
total 0
ls: Library//Mail: Operation not permitted

Library//Preferences:
total 0

Thank you for whatever suggestions you can offer.

You are getting "Operation not permitted" because the files have inherited some SIP protection and to manipulates them from your app (that is the terminal app or whatever terminal you use), you will need to give the app Full Disk Access.

Go to Settings -> Privacy and Security -> Full Disk Access - then find your terminal app in the list and turn on Full Disk Access. The app will be restarted and then you can rm -rf the "15" directory without an "Operation not permitted" error.

Thank you, @djw-m. That change allowed me to wipe the 15 directory from /Library/PostgreSQL.

Separately, I leaned that the path for 15 was added to my $PATH from /etc/paths.d/postgres, which I've now edited to point to 16 instead.

The help and the installer are appreciated.

(Edit: I apologize for my bad @ reference.)