(RuntimeError) Could not parse postgres version from version string

Not sure if this is a Postgrex or Ash_Postgres issue, but I’m getting this error after upgrading to Ash 3.0 and Ash_Postgres 2.0.

Does anyone know how to resolve this? Thank you.

[error] Ranch protocol #PID<0.1097.0> of listener TaskcalendarsWeb.Endpoint.HTTP (connection #PID<0.1095.0>, stream id 1) terminated
an exception was raised:
    ** (RuntimeError) Could not parse postgres version from version string: "PostgreSQL 15.0, compiled by Visual C++ build 1914, 64-bit"

You may need to define the `min_version/0` callback yourself.


%Version.InvalidVersionError{version: "15.0,.0"}

        (elixir 1.16.2) lib/version.ex:409: Version.parse!/1
        (myapp0.2.3) lib/myapp/repo.ex:2: Myapp.Repo.lookup_version/0
        (elixir 1.16.2) lib/agent/server.ex:8: Agent.Server.init/1
        (stdlib 5.0.2) gen_server.erl:962: :gen_server.init_it/2
        (stdlib 5.0.2) gen_server.erl:917: :gen_server.init_it/6
        (stdlib 5.0.2) proc_lib.erl:241: :proc_lib.init_p_do_apply/3

In your repo, do the following:

def min_version do
1 Like

Defining min_pg_version callback worked. Thank you!!

1 Like