Oban 2.17.4 update MATERIALIZED syntax error
Closed this issue · 3 comments
ViseLuca commented
Environment
- Oban Version: 2.17.4 upgrading from 2.17.3
- PostgreSQL Version:
- Elixir & Erlang/OTP Versions (
elixir --version
): 1.16.1 otp 26
Current Behavior
I'm receiving this error running tests:
** (Postgrex.Error) ERROR 42601 (syntax_error) syntax error at or near "MATERIALIZED"
query: WITH "subset" AS MATERIALIZED(SELECT so0."id" AS "id" FROM "public"."oban_jobs" AS so0 WHERE
(so0."state" = 'available') AND (so0."queue" = $1) ORDER BY so0."priority", so0."scheduled_at", so0."id" LIMIT $2 FOR
UPDATE SKIP LOCKED) UPDATE "public"."oban_jobs" AS o0 SET "state" = $3, "attempted_at" = $4, "attempted_by" =
$5, "attempt" = o0."attempt" + $6 FROM "subset" AS f1 WHERE (o0."id" = f1."id") AND (o0."attempt" <
o0."max_attempts") RETURNING o0."id", o0."state", o0."queue", o0."worker", o0."args", o0."meta", o0."tags", o0."errors",
o0."attempt", o0."attempted_by", o0."max_attempts", o0."priority", o0."attempted_at", o0."cancelled_at",
o0."completed_at", o0."discarded_at", o0."inserted_at", o0."scheduled_at"
sorentwo commented
You didn’t include your Postgres version, but the error indicates it’s not v12 or newer.
Materialized and non materialized CTE’s weren’t added until v12. That’s also the oldest Postgres version Oban officially supports (https://github.com/sorentwo/oban?tab=readme-ov-file#requirements)
ViseLuca commented
Oh yeah you're right! I totally missed that part! thank you
nathany-copia commented
Thanks. We were way behind for GitHub Actions (11.6).