Screwed-up postgresql13 install

Peter West lists at pbw.id.au
Wed Feb 3 15:04:29 UTC 2021


MacOS Big Sur 11.2 MacBook Air M1

I’m migrating to the M1 from an Intel MacBook Pro running Mojave.

I installed postgresql13 and -server, and copied my defaultdb across from the Pro.

I can’t vouch for the order of these things, because I wasn’t expecting to get into a quagmire.

I tried to give the postgres user a password using passwd as root. That’s not enough. I have to use a command ’security’ with a reference to a Keychain to complete the process. In the wake of all this, I assume that the user postgres is created without a password, and that’s Ok with the default pg_hba.conf.

Then I thought that maybe I should build up the databases by dumping databases from the Pro and restoring to the M1. So I uninstalled the postgresql ports and tried to delete /opt/local/var/db/postgresql13. The defaultdb disappeared but root was not allowed to remove a directory Library sitting beside the defaultdb. It had Preferences and Keychains subdirs, and they wouldn’t go.

I deleted the postgres user through the System Preferences, but that left the entry for _postgres in /etc/passwd.

Ok, install postgresql13 again. Installation proceeded, but this time did not create the postgres user visible through System Preferences, which I assume was created when I first installed.

When I try to access the macports wrapper (via su) to start the database, I get the complaint
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
could not identify current directory: Permission denied (3times)
The program “postgres” is needed by pg_ctl but was not found in the same directory as pg_ctl
(for obvious reasons, me)
Check your installation.
(you don’t say)

Any advice on how I can clean this up and start again.

Peter

--
Peter West
pbw at pbw.id.au
“…a light for revelation to the Gentiles, and for glory to your people Israel.”



More information about the macports-users mailing list