How to enable vector extension in azure cosmos db

Javier Outón 55 Reputation points
2023-07-07T11:14:25.55+00:00

Hi we've been notified general availability of vector extension for Postgre DB in azure cosmos db since May. We have been following this link https://learn.microsoft.com/en-us/azure/cosmos-db/postgresql/howto-use-pgvector to enable it but we get:

citus=> SELECT CREATE_EXTENSION('vector');

ERROR: not allowed to create this extension

our version is: PostgreSQL 15.3 (Ubuntu 15.3-1.pgdg20.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.

0, 64-bit

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
Azure Database for PostgreSQL
{count} votes

2 answers

Sort by: Most helpful
  1. SSingh-MSFT 16,461 Reputation points Moderator
    2023-07-13T09:08:44.45+00:00

    Hi
    Javier Outón
    •,

    Thanks for your patience.

    I have tried to replicate the scenario by creating Azure Cosmos DB PostgreSQL by enabling Vector extension.

    User's image

    Kindly use command: SELECT CREATE_EXTENSION('vector');

    OR

    CREATE EXTENSION vector;

    Result if shows like above that vector already exists, means it is enabled.

    Refer: https://learn.microsoft.com/en-us/azure/cosmos-db/postgresql/reference-extensions#pgvector-extension

    https://github.com/pgvector/pgvector#installation-notes

    Please try and let us know the result. If you face any issue, do reply so that we can further investigate.

    If this answers your query, do click Accept Answer and Mark Helpful for the same. And, if you have any further query do let us know.

    Thank you.


  2. SSingh-MSFT 16,461 Reputation points Moderator
    2023-07-14T05:35:36.37+00:00

    Hi
    Javier Outón
    •,

    Thanks for the reply with screenshot.

    This looks like permission issue which is not allowing to create extension.

    If the extension is not already enabled, you may try using superuser.

    Use link https://learn.microsoft.com/en-us/azure/cosmos-db/postgresql/howto-create-users to create user and try again.

    Let us know how it went and if you could perform or get stuck. We will look into this further.

    Thank you.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.