Embedded Postgres does not work on Mac OS Ventura M1 - postgresql

Embedded Postgres does not work on Mac OS Ventura M1, it gives an error
Process [/var/folders/vs/pfsp79pn1rgcc038_4yvsfk00000gn/T/embedded-pg/PG-578c3302bce806451b07e3a73d8438d1/bin/initdb, -A, trust, -U, postgres, -D, /var/folders/vs/pfsp79pn1rgcc038_4yvsfk00000gn/T/epg16251203664783330327, -E, UTF-8] failed
, when launched in the console it gives that
/var/folders/vs/pfsp79pn1rgcc038_4yvsfk00000gn/T/embedded-pg/PG-578c3302bce806451b07e3a73d8438d1/bin/postgres ; exit;
zsh: segmentation fault
Can anyone come across?
Tried to reinstall postgres, did commands with link and so on

Related

Error: Permission denied # rb_sysopen - /Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist

Getting the above error when I try to install Mongo with homebrew from terminal. I've seen a lot of people with this same issue but none of the past recs have worked for me. I'm on an M1 Macbook Pro. Any help?
I run into the similar problem on M1 Mac PRO. I guess that your MongoDB is up and running. so if you run
$brew services start MySQL/MongoDB
System fails to grab the service (since it starts already) and returns the the error.
My solution is to uninstall MySQL. install it again. And restart the machine.
Once restarting the machine, check whether MySQL is running by
$mysqld
The system shown that SQL is up and running. then do
$mysql -uroot

Trying to create a database in PSQL from the command line

I have been trying to create a simple test database from my terminal by running the command 'createdb test'. I installed PostgreSQL using brew on my Mac OS. I have attached an image of the error message I get. I also tried adjusting the pg_hba.conf file using nano from my terminal but that didn't work.

Set the number of buffer option in 'initdb' command in MacOS? 'PostgreSQL'

For a Homework reason I need to initialize a PostgreSQL database with limited number of buffer to do some debug & testing, etc.
I recalled that in Linux you can do:
~/bin/initdb -B 100 -D ~/dir/data
or
~/bin/postgres -B 100 -D ~/dir/data
to start up the server or init the db with 100 buffers, but in my MacOS it shows
initdb: invalid option -- B
I am using PostgreSQL 10.5, did they changed it in MacOS or just me having the wrong cmd for Mac?

upgrading postgresql 9.1.2 (9.1.3) -> 9.2.1 via homebrew

In a round of upgrades I ended up (literally, it was the last upgrade left) updating postgresql via homebrew. It installed PostgreSQL 9.2.1.
I couldn't make it run:
Dart:~ Arta$ pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
server starting
Dart:~ Arta$ psql -d postgres
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
Not understanding what exactly I was doing I tried the 'start', 'stop', 'load on login', etc. command lines from the Caveats, but postgresql wouldn't start, so I uninstalled the 9.2.1 version.
Now, I cannot run my original brew install (9.1.2, 9.1.3). Advise on how I can launch my original postgres would be great. I'm stranded.
Also:
$ which psql
/usr/bin/psql
This shouldn't be, and it certainly was not the case before the update - I installed postgres via homebrew on a clean Mac (it runs OS X 10.7.5 now). No clue how to get out of this.
Thanks.
Probably you're can't run postgres 9.2 on old db (/usr/local/var/postgres), that was created by version 9.1

How should I fix this PostgreSQL installation?

I realized that PostgreSQL was already running on my laptop (Mac OS X) before I installed from the Postgres site. So when I used the installer, I got the PostgreSQL and logged in to the postgres user account that was created.
In the terminal I wrote
psql -U postgres
And provided my password. I got logged in but it said,
WARNING: psql version 9.0, server version 9.1.
Some psql features might not work.
How should I go about fixing this so that I can access the database properly without any issues?
The warning comes from psql, the PostgreSQL interactive terminal. Nothing bad will happen.
As you have two versions of PostgreSQL installed in parallel, you would need two versions of psql. Maybe you even have them on disk. But when you type the command psql, your system will default to one of those, not knowing beforehand which database server version you are going to connect to.
You can type the explicit path to the psql version you want. Find the full path of all variants with this shell command (works with Linux, not tested with Mac OS X):
which -a psql
If you did not also install the psql version 9.1 along with your PostgreSQL, you have to install it first, of course.
If you are not going to use PostgreSQL 9.0 any more, you can uninstall it to remove ambiguities.
In Debian you can also set the default of multiple alternatives with:
update-alternatives
But in Debian you also have a wrapper that calls the matching psql dynamically if you specify the database cluster like this:
psql --cluster 9.1/main
Not sure about Mac OS X.
You have installed postgresql-server 9.1 (server side) and postgres (client side 9.0). Maybe you have installed client 9.1 too, but it is not on the path, so you have to find it or if you have not it, then install it.