Score:0

Command `postgres --version` shows incorrect version installed

mt flag

I recently wanted to upgrade my Postgres version from 14.2 to 15.

The first thing I did, was delete all postgres related directories:

michael@local var % postgres --version
postgres (PostgreSQL) 14.2

michael@local var % pwd
/usr/local/var

michael@local var % ls
cache   homebrew    mongodb     postgres.old    postgresql@13
db      log         postgres    postgresql@12   run

michael@local var % rm -rf postgres postgres.old postgresql@12 postgresql@13
michael@local var %

Then, I downloaded Postgres.app from their official website. The app is up and running, everything is working as expected. The installed version seems to be version 15:

SELECT version();
-- PostgreSQL 15.1 on aarch64-apple-darwin21.6.0, compiled by Apple clang version 14.0.0 (clang-1400.0.29.102), 64-bit

But when I run postgres --version in the terminal, it still returns postgres (PostgreSQL) 14.2.

michael@local var % postgres --version
postgres (PostgreSQL) 14.2

I'm worried I may have missed something.

Is something potentially broken and, if so, how can I fix it?

cn flag
I'm not familiar with this version packaged for MacOS, but it sounds like a problem that is fundamentally about setting the PATH environment variable appropriately. It would appear that you have older postgres tooling installed still, which you may or may not want to remove, but regardless you will want to make sure the current `postgres` is found in PATH. https://postgresapp.com/documentation/install.html appears to have some guidance.
Score:0
in flag

I would try

% which postgres

most likely you have multiple copies installed, and the one that comes first in your PATH is not the one you are looking for. You can check your path with the command

echo $PATH
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.