Home Posts Post Search Tag Search

Ash Framework 09 - Migration Issue
Published on: 2025-10-16 Tags: elixir, Blog, Side Project, Testing, LiveView, Ecto, Html/CSS, Phoenix, Ash, Framework

Fixing pg_trgm Error


** (Postgrex.Error) ERROR 0A000 (feature_not_supported) extension "pg_trgm" is not available
<br>
hint: The extension must first be installed on the system where PostgreSQL is running.

I wanted to figure out why this was not working and needed to test it for the tunez_test database.


I checked the PostgreSQL config here:


sudo nano /etc/postgresql/17/main/pg_hba.conf

For reference, I changed some settings in this file to use md5 so that PostgreSQL would ask for a password when using psql. That allowed me to test more things, but it was not the root issue.


The real issue was in my pg_trgm migration. I had used the wrong characters (" and - instead of _). Once I fixed that, the extension worked every time.


Here is the final migration code:


def up do
  execute("CREATE EXTENSION IF NOT EXISTS pg_trgm")
end