Skip to content

Latest commit

 

History

History
48 lines (34 loc) · 2.34 KB

how-to-use-pgvector.md

File metadata and controls

48 lines (34 loc) · 2.34 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic ms.custom
Vector search on Azure Database for PostgreSQL
Enable semantic similarity search for Retrieval Augmented Generation (RAG) on Azure Database for PostgreSQL with pgvector database extension.
AvijitkGupta
avijitgupta
kabharati, maghan
04/27/2024
postgresql
flexible-server
how-to
build-2023
ignite-2023

How to enable and use pgvector on Azure Database for PostgreSQL - Flexible Server

[!INCLUDE applies-to-postgresql-flexible-server]

[!INCLUDE Introduction to pgvector]

Enable extension

Before you can enable pgvector on your Azure Database for PostgreSQL flexible server instance, you need to add it to your allowlist as described in how to use PostgreSQL extensions and check if correctly added by running SHOW azure.extensions;.

Important

Notice that although all PostgreSQL community tends to refer to this extension as pgvector, the name of the binary and the extension itself is simply vector. Take that into consideration, because that is the name you must use to allowlist it or to create it on any database via the CREATE EXTENSION command.

Then you can install the extension, by connecting to your target database and running the CREATE EXTENSION command. You need to repeat the command separately for every database you want the extension to be available in.

CREATE EXTENSION vector;

Note

To remove the extension from the currently connected database use DROP EXTENSION vector;.

[!INCLUDE pgvector]

Next Steps

Learn more around performance, indexing and limitations using pgvector.

[!div class="nextstepaction"] Optimize performance using pgvector

[!div class="nextstepaction"] Generate vector embeddings with Azure OpenAI - Azure Database for PostgreSQL - Flexible Server