IntermediateVector Database10 min read

Connect pgvector to Gateco

Connect a self-hosted or cloud PostgreSQL database running pgvector to Gateco. Covers extension setup, dedicated user creation, and ingestion config.

Last updated: May 21, 2026

Prerequisites

  • PostgreSQL 14+ with the pgvector extension (version 0.5.0 or later)
  • Network access from Gateco to your PostgreSQL host

Overview — 4 steps

  1. 1Enable the pgvector extension
  2. 2Create a dedicated database user
  3. 3Add the connector in Gateco
  4. 4Configure search settings

pgvector is a PostgreSQL extension that adds vector similarity search to PostgreSQL. Gateco treats pgvector as a Tier 1 connector — supporting full ingestion, retroactive registration, and RAG access control. This guide covers identity-aware retrieval setup for self-hosted and cloud deployments, adding vector database RBAC via dedicated pgvector access control permissions.

Step 1 — Enable the pgvector extension

Connect to your target database as a superuser and run:

sql
CREATE EXTENSION IF NOT EXISTS vector;

-- Verify the version
SELECT extname, extversion FROM pg_extension WHERE extname = 'vector';

pgvector must be installed on the PostgreSQL server before running CREATE EXTENSION. On Ubuntu/Debian: apt install postgresql-16-pgvector. On RHEL/Amazon Linux: dnf install pgvector_16. For cloud providers (RDS, Cloud SQL), enable the extension from the console.

Step 2 — Create a dedicated database user

sql
-- Create the user
CREATE USER gateco WITH PASSWORD 'your-strong-password';

-- Allow connection to the database
GRANT CONNECT ON DATABASE your_database TO gateco;

-- Allow usage of the public schema
GRANT USAGE ON SCHEMA public TO gateco;

-- For ingestion (insert + read)
GRANT SELECT, INSERT, UPDATE, DELETE ON your_vector_table TO gateco;

-- For retrieval-only mode (read access only)
-- GRANT SELECT ON your_vector_table TO gateco;

-- Required for sequence access if using serial/bigserial IDs
GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO gateco;

Step 3 — Add the connector in Gateco

  1. Navigate to Connectors → Add connector → pgvector.
  2. Enter your PostgreSQL connection string.
  3. Click Test connection. Gateco introspects your schema and lists available vector tables.
  4. Click Save.
text
postgresql://gateco:password@your-host:5432/your_database?sslmode=require

Step 4 — Configure search settings

  1. In Connectors, click your pgvector connector → Search config.
  2. Set the Vector table name, Embedding column, and Content column.
  3. For hybrid search, also set text_search_config (default: english).
  4. Save.

Search configuration reference

FieldExampleDescription
table_nameembeddingsTable containing vector data
embedding_columnembeddingColumn of type vector(n)
content_columncontentText column for keyword/hybrid search
id_columnidPrimary key (default: id)
text_search_configenglishPostgreSQL text search config for keyword/hybrid mode
metadata_columns["doc_id","labels"]Columns to expose as policy metadata

Troubleshooting

ErrorCauseFix
could not load library "vector"pgvector not installed on the serverInstall the pgvector package for your PostgreSQL version and run CREATE EXTENSION
permission deniedInsufficient grantsRun the GRANT statements from Step 2 for the gateco user
connection refusedFirewall or pg_hba.conf restrictionAdd Gateco's IP to pg_hba.conf and allow port 5432 in your firewall rules

Frequently asked questions

What PostgreSQL and pgvector versions does Gateco require?

Gateco requires PostgreSQL 14 or later and pgvector 0.5.0 or later. pgvector 0.5.0 added HNSW indexing and improved IVFFlat performance. Run SELECT extversion FROM pg_extension WHERE extname = 'vector'; to check your installed version.

Should I create a dedicated database user for Gateco?

Yes, and it is strongly recommended. A dedicated user is standard practice for vector database access control — it makes it easy to audit Gateco's database activity, restrict access to only the tables it needs, and rotate credentials independently. Gateco enforces RAG access control above the database layer, but the database user itself should still follow least-privilege principles. Avoid using the postgres superuser — it grants far more access than Gateco requires.

Can I use the same PostgreSQL instance as my application?

Yes. Gateco connects to a specific database and table — it does not require a dedicated PostgreSQL instance. If your application already has pgvector tables, Gateco can connect to the same instance as long as the Gateco user has the necessary permissions on those tables.

Ready to add policy-aware retrieval?

Connect your pgvector setup to Gateco in under 5 minutes.