I manually built postgresql-13.11 on an m1 mac.
When attempting to run either /path/to/postgres/bin/postgres
(same for postmaster), i get the following error:
postgres does not know where to find the server configuration file.
You must specify the --config-file or -D invocation option or set the PGDATA environment variable.
which i was able to bypass by running /path/to/postgres/bin/postgres -D /path/to/databaseDir
, postgres starts normally.
Clusters are stored as a directory referred to as base directory.
Once you initiated a database cluster by executing /path/to/postgres/bin/initdb /path/to/databaseDir
, you can create as many databases you want in the cluster using the query postgres=# CREATE DATABASE your_database
in your default database, and you can connect to that using postgres=# \c your_database
.
You can also create multiple database clusters with their own set of databases by initiating the second database cluster /path/to/postgres/bin/initdb /path/to/databaseDir2
but you have to ensure that they are all isolated and running on different ports.