Opened 14 months ago

Last modified 14 months ago

#68119 closed defect

postgresql15: Initialize database cluster fails — at Version 1

Reported by: Klogic1 Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: Cc: jyrkiwahlstedt, dgilman (David Gilman)
Port: postgresql15, postgresql15-server, postgresql_select

Description (last modified by ryandesign (Ryan Carsten Schmidt))

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?

Change History (1)

comment:1 Changed 14 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: jyrkiwahlstedt dgilman added; jwa@… removed
Description: modified (diff)
Keywords: PostgreSQL 15 removed
Note: See TracTickets for help on using tickets.