Database / pgvector basics Interview Questions
How do you install and enable pgvector in PostgreSQL?
pgvector installation has two steps: installing the extension binary on the server, and enabling it in each database where you want to use it. The extension name used in SQL is vector (not pgvector).
| Method | Command |
|---|---|
| Ubuntu/Debian (PostgreSQL APT repo) | sudo apt install postgresql-17-pgvector |
| RHEL/CentOS (Yum repo) | sudo yum install pgvector_17 |
| macOS (Homebrew) | brew install pgvector |
| Docker | Use pgvector/pgvector Docker image |
| Conda | conda install -c conda-forge pgvector |
| From source | git clone + make + make install |
| Managed (AWS RDS, Supabase, Neon, Azure) | Enable via console or allowlist |
-- Step 1: Enable in the database (run once per database) CREATE EXTENSION vector; -- Verify it is installed: SELECT * FROM pg_extension WHERE extname = 'vector'; -- Upgrade an existing installation: ALTER EXTENSION vector UPDATE; -- On managed services (e.g. Azure), allowlist it first: -- Then CREATE EXTENSION vector; in the database -- Build from source (Linux): -- git clone --branch v0.8.4 https://github.com/pgvector/pgvector.git -- cd pgvector && make && sudo make install -- Then in psql: CREATE EXTENSION vector;
Important naming note: although the project is universally called pgvector, the PostgreSQL extension name is vector. Always use CREATE EXTENSION vector (not pgvector). This distinction matters on managed services like Azure where you must allowlist the name vector.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
