Configuring pgvector

After installing the pgvector package, enable the extension in each database where you want to use it. After upgrading the package, run a one-time update command to apply any extension changes.

Enabling the extension

After installing the package, enable pgvector in each database where you want to use it:

CREATE EXTENSION vector;
Note for EPAS users

On EDB Postgres Advanced Server, you must connect as a superuser or a user with the CREATE privilege on the database to run CREATE EXTENSION. The enterprisedb superuser can run this command by default.

To verify the installation:

SELECT extversion FROM pg_extension WHERE extname = 'vector';

Upgrading the extension

  1. Upgrade the pgvector package using your system package manager:

    Replace <postgres> and <postgres_version> with your distribution and version. For example, to upgrade pgvector for EDB Postgres Advanced Server 17 on RHEL:

    sudo dnf upgrade edb-as17-pgvector0
  2. Run the following in each database where the extension is installed:

    ALTER EXTENSION vector UPDATE;

After enabling the extension, see Using pgvector to start storing and querying vector data.


Could this page be better? Report a problem or suggest an addition!