samoloth

samoloth

Hi,

since my project will require some analytics, I’ve decided to use Postgres + DuckDB via pg_duckdb extension. I’ve spinned up an official pgduckdb container, set up credentials, run mix ash.reset, added pg_duckdb to installed_extensions/0 and finally run mix ash.codegen install_pg_duckdb + mix ash.migrate, but I end up with:

Getting extensions in current project...
Running migration for AshPostgres.DataLayer...

09:31:07.612 [info] == Running 20251218083057 MyApp.Repo.Migrations.InstallPgDuckdbExtensions1.up/0 forward

09:31:07.619 [info] execute "CREATE EXTENSION IF NOT EXISTS \"pg_duckdb\""

09:31:07.670 [info] == Migrated 20251218083057 in 0.0s
** (Postgrex.Error) ERROR 42P01 (undefined_table) relation "schema_migrations" does not exist

    query: INSERT INTO "schema_migrations" ("version","inserted_at") VALUES ($1,$2)
    (ecto_sql 3.13.3) lib/ecto/adapters/sql.ex:1108: Ecto.Adapters.SQL.raise_sql_call_error/1
    (ecto 3.13.5) lib/ecto/repo/schema.ex:1000: Ecto.Repo.Schema.apply/4
    (ecto 3.13.5) lib/ecto/repo/schema.ex:500: anonymous fn/15 in Ecto.Repo.Schema.do_insert/4
    (my_app 0.1.0) lib/my_app/repo.ex:2: MyApp.Repo.insert/2
    (ecto_sql 3.13.3) lib/ecto/migrator.ex:338: anonymous fn/6 in Ecto.Migrator.async_migrate_maybe_in_transaction/7
    (my_app 0.1.0) lib/my_app/repo.ex:2: anonymous fn/1 in MyApp.Repo."transaction (overridable 1)"/2
    (ecto 3.13.5) lib/ecto/repo/transaction.ex:11: anonymous fn/3 in Ecto.Repo.Transaction.transact/4
    (ecto_sql 3.13.3) lib/ecto/adapters/sql.ex:1468: anonymous fn/3 in Ecto.Adapters.SQL.checkout_or_transaction/4

Here are some additional logs:

$ psql -U duck
psql (18.1 (Debian 18.1-1.pgdg12+2))
Type "help" for help.

duck=# \dx
                           List of installed extensions
   Name    | Version | Default version |   Schema   |         Description          
-----------+---------+-----------------+------------+------------------------------
 pg_duckdb | 1.1.0   | 1.1.0           | public     | DuckDB Embedded in Postgres
 plpgsql   | 1.0     | 1.0             | pg_catalog | PL/pgSQL procedural language
(2 rows)

duck=# \c my_app_dev 
You are now connected to database "my_app_dev" as user "duck".
my_app_dev=# \dx
                          List of installed extensions
  Name   | Version | Default version |   Schema   |         Description          
---------+---------+-----------------+------------+------------------------------
 plpgsql | 1.0     | 1.0             | pg_catalog | PL/pgSQL procedural language
(1 row)

my_app_dev=# SELECT * FROM schema_migrations;
    version     |     inserted_at     
----------------+---------------------
 20251210094714 | 2025-12-18 08:28:00
(1 row)

As you can see, schema_migrations table exists.

Showing Posts 1 to 2

samoloth

samoloth OP

Ok, I works with ddl transaction disabled. Question is whether it should be disabled by default when it comes to extensions?

zachdaniel

zachdaniel

Creator of Ash

Hmm…it could yes? It must be a restriction of duck db though because we don’t have that issue with Postgres. Makes me wonder if Postgres can actually transactionally install an extension. Feels like probably not.

With that said we define functions etc. which we’d want to be transactional.

— All posts loaded —

Where Next? Top

Trending in Questions Top

Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
Onor.io
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
Trolleger
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
matt-savvy
Anyone here using Honeybadger? My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of Bandit.HTTPError...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews