英文:
Laravel Postgres SQL could not open extension "vector.control"
问题
When I use php artisan migrate
, it shows the following error:
"SQLSTATE[58P01]: Undefined file: 7 ERROR: could not open extension control file "/usr/share/postgresql/12/extension/vector.control": No such file or directory (Connection: pgsql, SQL: CREATE EXTENSION IF NOT EXISTS vector)"
To fix this problem, you should ensure that the "vector" extension control file exists at the specified path ("/usr/share/postgresql/12/extension/vector.control"). If it doesn't exist, you may need to reinstall or reconfigure the "vector" extension.
Hope this helps.
英文:
when I use php artisan migrate.
I will show me
"SQLSTATE[58P01]: Undefined file: 7 ERROR: could not open extension control file "/usr/share/postgresql/12/extension/vector.control": No such file or directory (Connection: pgsql, SQL: CREATE EXTENSION IF NOT EXISTS vector)"
what should I do to fix this problem.
hope someone can help me.
Thank you everyone
Creating migration table ................................................................................................................ 3ms DONE
INFO Running migrations.
2014_10_12_000000_create_users_table .................................................................................................... 5ms DONE
2014_10_12_100000_create_password_reset_tokens_table .................................................................................... 3ms DONE
2014_10_12_200000_add_two_factor_columns_to_users_table ................................................................................. 1ms DONE
2019_08_19_000000_create_failed_jobs_table .............................................................................................. 4ms DONE
2019_12_14_000001_create_personal_access_tokens_table ................................................................................... 4ms DONE
2020_05_21_100000_create_teams_table .................................................................................................... 3ms DONE
2020_05_21_200000_create_team_user_table ................................................................................................ 3ms DONE
2020_05_21_300000_create_team_invitations_table ......................................................................................... 7ms DONE
2022_08_03_000000_create_vector_extension ............................................................................................... 1ms FAIL
Illuminate\Database\QueryException
SQLSTATE[58P01]: Undefined file: 7 ERROR: could not open extension control file "/usr/share/postgresql/12/extension/vector.control": No such file or directory (Connection: pgsql, SQL: CREATE EXTENSION IF NOT EXISTS vector)
at vendor/laravel/framework/src/Illuminate/Database/Connection.php:793
789▕ // If an exception occurs when attempting to run a query, we'll format the error
790▕ // message to include the bindings with SQL, which will make this exception a
791▕ // lot more helpful to the developer instead of just the database's errors.
792▕ catch (Exception $e) {
➜ 793▕ throw new QueryException(
794▕ $this->getName(), $query, $this->prepareBindings($bindings), $e
795▕ );
796▕ }
797▕ }
+44 vendor frames
45 artisan:37
Illuminate\Foundation\Console\Kernel::handle()
答案1
得分: 0
在启用Postgres中的向量扩展(CREATE EXTENSION IF NOT EXISTS vector
)之前,必须安装pgvector扩展。
在他们的GitHub页面https://github.com/pgvector/pgvector上,有多种安装或查找已准备好的Postgres版本的方法。对于本地开发,我使用Postgres.app或docker,它们都预装了pgvector扩展,所以我只需运行create extension命令,它就可以直接运行。
英文:
Before enabling vector extension in Postgres (CREATE EXTENSION IF NOT EXISTS vector
), pgvector extension must be installed.
On their GitHub page https://github.com/pgvector/pgvector, there are multiple ways how you can install or find already prepared Postgres versions. For local development I use Postgres.app or docker and they both come with preinstalled pgvector extension so I just run create extension and it works out of the box.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论