Dev migration error: PGVector

AI-generated summary

A user encountered a migration error related to the pgvector extension in Discourse AI, which is now bundled with Discourse. The error occurs due to an unsupported syntax in their PostgreSQL version. merefield suspects their PostgreSQL version (12) is the cause. jahan_gagan confirms upgrading PostgreSQL will resolve the issue. merefield mentions moving to version 16, while RGJ states the migration runs fine on PG13. The discussion also touches on whether upgrading PostgreSQL is necessary when going to Discourse 3.5 and what the minimum required PostgreSQL version is.

Caused by Discourse AI:

== 20240611170904 UpgradePgvector070: migrating =============================== rake aborted! StandardError: An error has occurred, this and all later migrations canceled: (StandardError)
ERROR:  syntax error at or near "("
/home/robert/discourse/lib/mini_sql_multisite_connection.rb:109:in `run'
/home/robert/discourse/plugins/discourse-ai/db/migrate/20240611170904_upgrade_pgvector_070.rb:10:in `up'
/home/robert/discourse/lib/freedom_patches/schema_migration_details.rb:8:in `block in exec_migration'
/home/robert/discourse/lib/freedom_patches/schema_migration_details.rb:8:in `exec_migration'
/home/robert/discourse/lib/migration/safe_migrate.rb:28:in `migrate'

I don’t use the plugin but it’s now bundled.

Anyone solved this before?

It’s my version of Postgres I believe, I’ll try to upgrade

Upgrading PostgreSQL will resolve the issue, as the current version doesn’t support the syntax used by the pgvector extension in this migration.

We also need to upgrade PostgreSQL when going to 3.5, besides installing the pgvector extension?
What is the minimum required PostgreSQL version?

I moved to 16, but 13 might suffice.

I don’t understand this topic. That migration runs fine on PG13.

I was running 12 :).

But thanks for confirmation.