Open wintermeyer opened 5 hours ago
Note psql --version
returns the client version. I'd expect for vast majority of users the client and server versions would match but it's not a guarantee in more complicated setups, e.g. having a single psql client but multiple pg servers locally. You can use Ecto/Postgrex without psql (say you have your db in docker container) too. Just fyi!
psql -U postgres -c "SHOW server_version;" -t
Should do the trick. And YES, this might not run on all systems. Yes, you could have a different password. Yes, you could create a fresh Ash project on a system which doesn't even have PostgreSQL installed. All true. The script has to catch those problems. But for more than 80% this is a time saver because they have a standard installation.
I think the main thing here is that we're only proposing a default value for a configuration that can be changed later on. So using the command you provided as the default value as opposed to just 16.0.0
should be totally fine. It is at least slightly more likely to be accurate as our proposed default.
Every time I use
mix igniter.install ash_postgres
I run into this situation:Of course I can run
psql --version
in an other terminal to find the answer to that question (at least for my development system) but I don't want to. I am using igniter to make my life easier.Why doesn't igniter try to run
psql --version
or something similar in the background and give me something like this as an option:This will make the live of 99% of all developers easier. And the other 1% doesn't have any disadvantages.