PostgreSQL Provider Guide
Embedd.to supports PostgreSQL as both a source database and a platform mode target for vector storage using pgvector.
Connection Credentials
{
"host": "db.example.com",
"port": 5432,
"database": "mydb",
"user": "embedd_user",
"password": "secure_password",
"ssl_mode": "require"
}
Required Permissions
-- Read access to source tables
GRANT SELECT ON TABLE products TO embedd_user;
-- For platform mode: create tables and install pgvector
GRANT CREATE ON SCHEMA public TO embedd_user;
CREATE EXTENSION IF NOT EXISTS vector;
Managed Mode
In managed mode, Embedd.to reads data from PostgreSQL and stores vectors in its built-in Qdrant instance. An embedding provider (OpenAI, Gemini) is required.
Platform Mode
In platform mode, vectors are stored in your PostgreSQL database using pgvector's vector(N) type.
Prerequisites
- PostgreSQL 14+ with the pgvector extension installed
- The
vectorextension must be created in the target schema
Embedding Provider Required
Unlike Snowflake (which has Cortex), PostgreSQL does not have native embedding capabilities. An embedding_provider_id is always required for PostgreSQL platform mode.
Vector Table Structure
Platform mode creates a table in your PostgreSQL database:
CREATE TABLE embedd_vt_xxxxxxxx_name (
pk_value TEXT PRIMARY KEY,
embedding vector(1536),
embedded_text TEXT,
metadata JSONB DEFAULT '{}',
row_hash TEXT
);
CREATE INDEX ON embedd_vt_xxxxxxxx_name
USING hnsw (embedding vector_cosine_ops);
HNSW Iterative Scan
Embedd.to automatically sets hnsw.iterative_scan = on for queries to ensure consistent results when combining vector similarity search with metadata filters.
Filter Support
PostgreSQL platform mode translates filters to JSONB operators:
| Filter | PostgreSQL SQL |
|---|---|
$eq | metadata->>'field' = 'value' |
$ne | metadata->>'field' != 'value' |
$gt | (metadata->>'field')::numeric > value |
$gte | (metadata->>'field')::numeric >= value |
$lt | (metadata->>'field')::numeric < value |
$lte | (metadata->>'field')::numeric <= value |
$in | metadata->>'field' IN (...) |
$nin | metadata->>'field' NOT IN (...) |
$exists | metadata ? 'field' |
Numeric and boolean comparisons automatically cast the JSONB text value to the appropriate type.