![]() The default text search configuration will be set to "english". The default database encoding has accordingly been set to "UTF8". The database cluster will be initialized with locale "en_GB.UTF-8". **This user must also own the server process.** The files belonging to this database system will be owned by user "Freemium". Maybe lets try as my user account, forgetting the postgres user $ pg_ctl initdb -pgdata=/Library/PostgreSQL/12/data/ So postgres has pg_ctl, and yet cannot run it. What is this madness?! It works, I have access but I cannot run any of those commands I need to start my DB! sudo has access to all postgres has access to that dir. So let me try doing what I've experimented with so far and attempt ls as postgres $ sudo -u postgres ls -la /Library/PostgreSQL/12/data/ I recall trying to access that /data dir before and it was limited to the postgres user. Reoccurring theme, what is all this "cannot access directories"? I am running sudo and the postgres user as is everyone else in everything I've read! Why does it not work in my case?.Īttempt #3 $ ls -la /Library/PostgreSQL/12/data/ Library/PostgreSQL/12/bin/pg_ctl: /Library/PostgreSQL/12/bin/pg_ctl: cannot execute binary file Shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied $ sudo su postgres pg_ctl initdb -D /Library/PostgreSQL/12/data/ Maybe rearrange the command a little bit. The program "initdb" is needed by pg_ctl but was not found in the Nothing else seems to be working so lets try it $ sudo -u postgres /Library/PostgreSQL/12/bin/pg_ctl -D /Library/PostgreSQL/12/data/ initdb Reading further I see some using initdb (credit to the final update in this Q) rather than start so I thought I'd give that a go. Let try that then $ sudo -u postgres export PGDATA="/Library/PostgreSQL/12/data/" I have it set on my user, so I guess it isn't set for the postgres user. Pg_ctl: no database directory specified and environment variable PGDATA unset Trying something else, omitting the -D as I might be overcomplicating things. perhaps I need to specify it's path in the command $ sudo -u postgres /Library/PostgreSQL/12/bin/pg_ctl -D /Library/PostgreSQL/12/data/ start The program "postgres" is needed by pg_ctl but was not found in the could not identify current directory: Permission denied $ sudo -u postgres pg_ctl -D /Library/PostgreSQL/12/data/ start ![]() Now, naturally trying to start it back up again with The website wasn't working, as was excepted. Stopping DB $ sudo -u postgres pg_ctl -D /Library/PostgreSQL/12/data/ stopĬould not identify current directory: Permission denied Tl dr: What is the correct way/command to start a DB, on OSX, not using homebrew, and with it's default settings/directory structure?Īfter much reading on many websites I found the way to stop the server, a way which worked for me personally – not using Homebrew and on OSX So I wanted to learn how to start/stop/restart the server at the start of the project so I was better equipped to manage it later down the line. I use PgAdmin 4 to visualise the database, and my literal understanding of "shut down server" on that application was it shut down the database, however it does not. ![]() I am not from a PostgreSQL background and wanted to use it for a project I am currently working on as it was the recommended DB for what I am using. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |