Open nbro opened 1 month ago
I solved the problem by just uninstalling and installing again postgresql@14
and then manually running
initdb --locale=C -E UTF-8 /usr/local/var/postgresql@14
which should have been run automatically, according to the message we see when we install postgresql@14
...
This formula has created a default database cluster with:
initdb --locale=C -E UTF-8 /usr/local/var/postgresql@14
For more details, read:
https://www.postgresql.org/docs/14/app-initdb.html
...
So, there's a bug either in the installation or documentation/message
The caveats
^1 should've shown you how to handle this but this doesn't interact well with API installs. So that is a bug. CC @Homebrew/brew
Agreed on 🐛. Fix should be:
caveats
unconditionally in this caseif
/unless
in caveats
Agreed on 🐛. Fix should be:
caveats
unconditionally in this caseadd a RuboCop to avoid
if
/unless
incaveats
I can see how this might be our most viable fix, but I'd strongly prefer a solution that retains the if
and unless
calls here.
Many users blindly run what caveats
show them, so I'd like to avoid showing them commands we know they don't need to run. Adding notes that most users can ignore to caveats
will also tend to make them ignore ones they shouldn't.
I can see how this might be our most viable fix, but I'd strongly prefer a solution that retains the
if
andunless
calls here.
I can't see how this can be made to work with the API unless we're embedding Ruby source.
I can't see how this can be made to work with the API unless we're embedding Ruby source.
I'm not opposed to that, but I don't think we need to. There is already a mechanism for fetching the Ruby source separately, which is why we have the ruby_source_checksum
in the API JSON. Alternatively, the Ruby source is in the bottle, so we can read that after pouring and update the caveats
from there.
Alternatively, the Ruby source is in the bottle, so we can read that after pouring and update the
caveats
from there.
This would work. Would mean it's not going to show with brew info
before installation, in case that matters.
Would mean it's not going to show with
brew info
before installation, in case that matters.
This is fine with me, I think.
brew gist-logs <formula>
link ORbrew config
ANDbrew doctor
outputbrew gist-logs postgresql@14
gives me the errorI am on Monterey. I don't think I can update XCode.
Anyway, I can execute the other commands.
brew config
producesbrew doctor
producesVerification
brew doctor
output saysYour system is ready to brew.
and am still able to reproduce my issue.brew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.What were you trying to do (and why)?
Start PostgreSQL as a background service using
brew services start postgresql@14
What happened (include all command output)?
If I do
brew services list
, I getSo,
postgresql@14
is a service. Now, I want to start this service. So, I didbrew services start postgresql@14
, which produces the following outputNow, if I do
brew services list
again, I getIf I open
~/Library/LaunchAgents/homebrew.mxcl.postgresql@14.plist
, I see the logs are at/usr/local/var/log/postgresql@14.log
.Now, if I open
/usr/local/var/log/postgresql@14.log
, I get many errors like thisNow, effectively, I don't have the folder
/usr/local/var/postgresql@14
, but I have the folder/usr/local/var/postgres
.Now, when I execute
brew services start postgresql
(so without the suffix@14
), I get the warningWarning: Formula postgresql was renamed to postgresql@14.
, so maybe the rename is causing this issue, i.e. the formula was renamed but the data directory wasn't? Anyway, shouldn'tbrew services start postgresql@14
automatically create the folder/usr/local/var/postgresql@14
if it doesn't exist? If yes, is this a bug then? According to https://formulae.brew.sh/formula/postgresql@14Apparently, in my case, that didn't happen.
My problem is vaguely similar to https://apple.stackexchange.com/questions/451097/brew-postgresql14-error-on-mac-m2, but my error in the logs is quite different.
I've not tried to manually create
/usr/local/var/postgresql@14
because, if this is a bug, it probably should be fixed and that folder should be automatically created.I thought of uninstalling postgresql and remove all configuration files, but this may be too dangerous, although I don't think I have anything important in this machine. Anyway, I don't really know what commands I should really use to make a clean installation again. I've looked at https://stackoverflow.com/a/57326013/3924118, but it would be nice to have an authoritative answer
What did you expect to happen?
PostgreSQL starts, no error occurs, and I can access it
Step-by-step reproduction instructions (by running
brew
commands)See above