Обсуждение: Help with my MacOS PostgreSQL 12 installation

Поиск
Список
Период
Сортировка

Help with my MacOS PostgreSQL 12 installation

От
Michael White
Дата:
This is my first post so if I’m in the wrong place please help me get to the correct list.

Issue:

I installed PostgreSQL on my Mac over a year ago and since upgraded my disk drive and OS to Big Sur.  I am a retired Software Engineer and still like to program and am learning PostgreSQL and have it working on Linux and FreeBSD.  In any case I had put it on my Mac laptop and want to use it again but it seems that the upgrades I did might have rearranged file locations or they may have been lost.  I have been trying to understand what is where and come to a point where I need help getting PostgreSQL running again.  I have a file with notes on the installation and here it is:

Installation Directory: /Library/PostgreSQL/12
Server Installation Directory: /Library/PostgreSQL/12
Data Directory: /Library/PostgreSQL/12/data
Database Port: 5432
Database Superuser: postgres
Operating System Account: postgres
Database Service: postgresql-12
Command Line Tools Installation Directory: /Library/PostgreSQL/12
pgAdmin4 Installation Directory: /Library/PostgreSQL/12/pgAdmin 4
Stack Builder Installation Directory: /Library/PostgreSQL/12

1. PostgreSQL server is not started and I am having trouble figuring out how to start it because /Library/PostgreSQL/12 does not exist. (don’t know why)
2. The password for user postgres does not work.  (I can fix that but have not yet)
3. Don’t remember how I installed PostgreSQL but looks like with EnterpriseDB because of the installation directory.  (I got this from postgresapp.com)
4. I looked around the postgres user account directory and it appears that PostgreSQL is installed there which confuses me because I can’t find any information about that or how to start or access it in that manner.
5. Looking for advice on how to unravel this situation and get my install up and running.  I do have 1 database associated with some Java Web Development in this implementation.

My macOS is at Big Sur 11.5.2

Would appreciate your kind help.





Re: Help with my MacOS PostgreSQL 12 installation

От
Luca Ferrari
Дата:
On Tue, Aug 17, 2021 at 6:21 PM Michael White <mike@white-home.com> wrote:
> 1. PostgreSQL server is not started and I am having trouble figuring out how to start it because
/Library/PostgreSQL/12does not exist. (don’t know why) 

that *could be* the reason why it does not start!


> 3. Don’t remember how I installed PostgreSQL but looks like with EnterpriseDB because of the installation directory.
(Igot this from postgresapp.com) 

is there any postgres or psql executable around?
I suspect the upgrade did nuke everything was not installed by apple.

> 4. I looked around the postgres user account directory and it appears that PostgreSQL is installed there which
confusesme because I can’t find any information about that or how to start or access it in that manner. 

Do you mean is there a data directory under postgres user home
directory? Can you run pg_ctl to start the cluster from within such
directory?

> 5. Looking for advice on how to unravel this situation and get my install up and running.  I do have 1 database
associatedwith some Java Web Development in this implementation. 

Any chance you can understand if data under the postgres user has the
size you expect the database to have?
I'm not a mac user, but I suspect the upgrade destroyed your installation.

Luca



Re: Help with my MacOS PostgreSQL 12 installation

От
Philip Semanchuk
Дата:

> On Aug 17, 2021, at 12:21 PM, Michael White <mike@white-home.com> wrote:
>
> This is my first post so if I’m in the wrong place please help me get to the correct list.
>
> Issue:
>
> I installed PostgreSQL on my Mac over a year ago and since upgraded my disk drive and OS to Big Sur.  I am a retired
SoftwareEngineer and still like to program and am learning PostgreSQL and have it working on Linux and FreeBSD.  In any
caseI had put it on my Mac laptop and want to use it again but it seems that the upgrades I did might have rearranged
filelocations or they may have been lost.  I have been trying to understand what is where and come to a point where I
needhelp getting PostgreSQL running again.  I have a file with notes on the installation and here it is: 

…

> 3. Don’t remember how I installed PostgreSQL but looks like with EnterpriseDB because of the installation directory.
(Igot this from postgresapp.com) 


Hi Michael,
I use PostgresApp on my Mac, and it has worked very nicely for me. It’s a very no-fuss installation. You should have an
appin our Applications folder called Postgres. Start that, and the Postgres server will be running. There’s a little
elephantin my menu bar that I can click on that shows me what databases are available. I can set it to start the server
automaticallywhen I log in. If you don’t have an app called Postgres or it doesn’t run when you click it, I’d say your
installationis damaged. If you can nuke it and start over, that’d be what I’d try. Start by dragging the app to the
trashand reinstalling. That might fix things. 

FYI I modified my .zshrc to include this line to add Postgres’ client apps to my path:
export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/11/bin

That way I have easy access to psql, pg_config, etc.


Hope this helps,
Philip