I was running postgresql as a service on my NixOS machine.
$ grep postgres /etc/nixos/configuration.nix services.postgresql.enable = true;
The data lived in
$ systemctl cat postgresql.service | grep PGDATA Environment="PGDATA=/var/lib/postgresql/9.6"
I no longer need to run postgresql, so I’ve disabled (removed) the service in my nixos config.
I don’t care about the data, so I’d like to delete the
/var/lib/postgresql/9.6 directory as well.
Is this the correct way to remove the remnants of postgresql from my system?
In other words, is it safe to delete and are there other locations I should check for “leftover” postgresql files/directories?