Re: initdb can't init the database - Mailing list pgsql-general

From Wen Yi
Subject Re: initdb can't init the database
Date
Msg-id tencent_D086A4035C98EA4057074C952003E2BADD09@qq.com
Whole thread Raw
In response to Re: initdb can't init the database  (Ian Lawrence Barwick <barwick@gmail.com>)
List pgsql-general
OK. I find where the problem is, thanks very much!

Yours,
Wen Yi

------------------ Original ------------------
From: "Ian Lawrence Barwick" <barwick@gmail.com>;
Date: Sat, Jun 10, 2023 01:54 PM
To: "Wen Yi"<896634148@qq.com>;
Cc: "pgsql-general"<pgsql-general@lists.postgresql.org>;
Subject: Re: initdb can't init the database

2023年6月10日(土) 14:30 Wen Yi <896634148@qq.com>:
>
> Hi team,
> I use the source to install the postgresql 15.3 (Fedora Linux 37), I create a install.sh as this:
>
> install.sh:
>
> sudo rm -r /home/postgres/pgsql
> sudo mkdir /home/postgres/pgsql
> sudo rm -r /home/postgres/pgsql/lib
> sudo mkdir /home/postgres/pgsql/lib
> ./configure --prefix=/home/postgres/pgsql/bin --exec-prefix=/home/postgres/pgsql/lib --enable-debug --enable-coverage --enable-dtrace --enable-cassert --enable-profiling
> sudo make install
> sudo useradd -m postgres
> sudo passwd -d postgres
> make clean
>
> Then, I start to execute this shell script:
>
>
> [beginnerc@bogon postgresql-15.3]$ ./install.sh
> [sudo] beginnerc's passwod:
> ...
> [beginnerc@bogon postgresql-15.3]$ su postgres
> bash-5.1$ ./initdb
> initdb: error: no data directory specified
> initdb: hint: You must identify the directory where the data for this database system will reside.  Do this with either the invocation option -D or the environment variable PGDATA.
(...)
> Can someone give me some advice?
> Thanks in advance!

The clue is right there after you execute initdb.

You also might want to check the ownership of those directories being created
by the script.

Regards

Ian Barwick

pgsql-general by date:

Previous
From: Ian Lawrence Barwick
Date:
Subject: Re: initdb can't init the database
Next
From: Bruce Momjian
Date:
Subject: Re: Active Active PostgreSQL Solution