Laravel Postgres SQL无法打开扩展名“vector.control”

rqmkfv5c  于 2023-06-30  发布在  其他
关注(0)|答案(1)|浏览(504)

使用php artisan migrate我会证明给我看
“SQLSTATE[58P01]:未定义的文件:7错误:无法打开扩展控制文件“/usr/share/postgresql/12/extension/vector.control”:无此类文件或目录(连接:pgsql,SQL:CREATE EXTENSION IF NOT EXISTS vector)”
我该怎么做来解决这个问题。
希望有人能帮助我。谢谢大家

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()
zdwk9cvp

zdwk9cvp1#

在Postgres(CREATE EXTENSION IF NOT EXISTS vector)中启用vector扩展之前,必须安装pgvector扩展。
在他们的GitHub页面https://github.com/pgvector/pgvector上,有多种方法可以安装或查找已经准备好的Postgres版本。对于本地开发,我使用Postgres.app或docker,它们都预装了pgvector扩展,所以我只需运行create extension,它就可以开箱即用。

相关问题