[MacPorts] #68119: postgresql15: Initialize database cluster fails

MacPorts noreply at macports.org
Sat Sep 2 15:03:18 UTC 2023


#68119: postgresql15: Initialize database cluster fails
-------------------------+-------------------------------------------------
 Reporter:  Klogic1      |      Owner:  (none)
     Type:  defect       |     Status:  new
 Priority:  Normal       |  Milestone:
Component:  ports        |    Version:  2.8.1
 Keywords:  PostgreSQL   |       Port:  postgresql15, postgresql15-server,
  15                     |  postgresql_select
-------------------------+-------------------------------------------------
 MacBook Pro (Retina, 15-inch, Mid 2015) Intel
 macOS Monterey 12.6.8
 Clean install prior to installing Macports
 MacPorts; 2.8.1
 Xcode: 14.2 (14C18)
 Xcode command line tools: 14.2.0.0.1.1668646533

 The PostgreSQL ports download and install without a problem. When
 following the directions provided I can not Initialize database cluster.

 Error message:
 {{{ Error: shell-init: error retrieving current directory: getcwd: cannot
 access parent directories: Permission denied
 chdir: error retrieving current directory: getcwd: cannot access parent
 directories: Permission denied
 initdb: option requires an argument -- D
 initdb: hint: Try "initdb --help" for more information.
 sh: line 1: /opt/local/var/db/postgresql15/defaultdb: is a directory}}}

 I used these commands.\\

 sudo port select postgresql postgresql15\\
 sudo port load postgresql15-server\\
 sudo mkdir -p /opt/local/var/db/postgresql15/defaultdb\\
 sudo chown postgres:postgres /opt/local/var/db/postgresql15/defaultdb\\
 sudo su postgres -c 'cd /opt/local/var/db/postgresql15 &&
 /opt/local/lib/postgresql15/bin/initdb -D
 /opt/local/var/db/postgresql15/defaultdb'

 How should PostgreSQL be installed using MacPorts?

-- 
Ticket URL: <https://trac.macports.org/ticket/68119>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list