[MacPorts] #68119: postgresql15: Initialize database cluster fails
MacPorts
noreply at macports.org
Sun Sep 3 00:34:57 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
Resolution: | Keywords:
Port: postgresql15, postgresql15-server, |
postgresql_select |
-------------------------------------------------+-------------------------
Changes (by ryandesign):
* cc: jwa@… (removed)
* cc: jyrkiwahlstedt, dgilman (added)
* keywords: PostgreSQL 15 =>
Old description:
> 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?
New description:
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#comment:1>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list