I am trying to understand how PostreSQL works on the Macintosh and have been unable to get the PostgreSQL startup script to work when I execute it manually. Everytime I execute it I am asked for a password (presumably because of the su command being used), however, I do not know what the password is. It appears that it is blank when I use other PostgreSQL command-line utils and specify postgres as the user, however, I cannot get the startup script to execute.
Is there a password for the postgres user? and if so what is it? If not, how do I respond to the password prompt. I have tried just hitting enter, or using my admin password, though they do not work.
Thanks in advance for any help!
Mark
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That should start the database using the traditional pg_ctl in wrapped in the startup item.
However, if it's not starting at startup, that would indicate another problem. The most common cause of this is a failure in the installation to perform the initdb.
The quick way is to check the /Library/PostgreSQL8/data folder, if it exists, for the database files. If they aren't there, the install failed.
To do this by hand,
sudo bash
su -m postgres -c '/Library/PostgreSQL8/bin/initdb -D /Library/PostgreSQL8/data'
exit
If that fails, it's probably a failure in creating the user account, you can verify that:
/usr/bin/dscl . -read /users/postgres | grep "^UniqueID:.[0-9]" | sed 's/.*: //' | sed 's/ //'
if that fails, you don't have a user account for postgres, which means the installer really tanked out and we need to do some more digging.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am trying to understand how PostreSQL works on the Macintosh and have been unable to get the PostgreSQL startup script to work when I execute it manually. Everytime I execute it I am asked for a password (presumably because of the su command being used), however, I do not know what the password is. It appears that it is blank when I use other PostgreSQL command-line utils and specify postgres as the user, however, I cannot get the startup script to execute.
Is there a password for the postgres user? and if so what is it? If not, how do I respond to the password prompt. I have tried just hitting enter, or using my admin password, though they do not work.
Thanks in advance for any help!
Mark
Sounds like your initdb failed during the installation, but that doesn't answer you question.
The if you run the script from the command line, run it using sudo it has to run as root, so the password is irrelevant.
so in Terminal:
sudo /Library/StartupItems/PostgreSQL/PostgreSQL start
That should start the database using the traditional pg_ctl in wrapped in the startup item.
However, if it's not starting at startup, that would indicate another problem. The most common cause of this is a failure in the installation to perform the initdb.
The quick way is to check the /Library/PostgreSQL8/data folder, if it exists, for the database files. If they aren't there, the install failed.
To do this by hand,
sudo bash
su -m postgres -c '/Library/PostgreSQL8/bin/initdb -D /Library/PostgreSQL8/data'
exit
If that fails, it's probably a failure in creating the user account, you can verify that:
/usr/bin/dscl . -read /users/postgres | grep "^UniqueID:.[0-9]" | sed 's/.*: //' | sed 's/ //'
if that fails, you don't have a user account for postgres, which means the installer really tanked out and we need to do some more digging.