BeginnerVector Database10 min read

Connect Neon to Gateco

Connect Neon Postgres to Gateco for policy-aware vector search. Covers pgvector setup, connection strings, and ingestion configuration.

Last updated: May 21, 2026

Prerequisites

  • A Neon account with at least one project
  • pgvector extension available (included with all Neon projects)

Overview — 5 steps

  1. 1Get your Neon connection string
  2. 2Enable the pgvector extension
  3. 3Create a dedicated database user (recommended)
  4. 4Add the connector in Gateco
  5. 5Configure search settings

Neon is a serverless Postgres platform with built-in pgvector support. Gateco treats Neon as a Tier 1 connector — supporting full document ingestion, retroactive registration, and RAG access control. This guide covers the complete setup from a fresh Neon project to your first identity-aware retrieval, adding vector database RBAC on top of your existing pgvector tables.

Step 1 — Get your Neon connection string

  1. Log in to console.neon.tech and open your project.
  2. In the Connection Details panel, select your database and role.
  3. Copy the connection string. It looks like:
text
postgresql://user:password@ep-cool-term-123456.us-east-2.aws.neon.tech/dbname?sslmode=require

Use the direct connection string, not the pooled one. Look for the string under "Direct connection" in the Connection Details panel.

Step 2 — Enable the pgvector extension

Connect to your Neon database with any SQL client and run:

sql
CREATE EXTENSION IF NOT EXISTS vector;

Verify it is installed:

sql
SELECT * FROM pg_extension WHERE extname = 'vector';

Step 3 — Create a dedicated database user (recommended)

Using a dedicated user makes it easy to audit Gateco access and rotate credentials independently.

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

-- For ingestion (write access to your vector table)
GRANT INSERT, SELECT, UPDATE, DELETE ON your_vector_table TO gateco;
GRANT USAGE, SELECT ON SEQUENCE your_vector_table_id_seq TO gateco;

-- pgvector catalog access (required for metadata introspection)
GRANT SELECT ON pg_extension TO gateco;

Step 4 — Add the connector in Gateco

  1. In the Gateco dashboard, navigate to Connectors → Add connector → Neon.
  2. Paste your connection string from Step 1.
  3. Click Test connection. Gateco will introspect your schema and show available tables.
  4. Click Save.

Step 5 — Configure search settings

After saving the connector, configure the search settings to point Gateco at your vector table:

  1. In Connectors, click your Neon connector → Search config.
  2. Set the Vector table name (e.g. embeddings).
  3. Set the Embedding column (e.g. embedding).
  4. Set the Content column if your table stores the original text (e.g. content).
  5. Save the search config.

Search configuration reference

FieldExampleDescription
table_nameembeddingsName of the table containing vector embeddings
embedding_columnembeddingColumn with type vector(n)
content_columncontentColumn with the original document text (optional)
id_columnidPrimary key column (default: id)
metadata_columns["doc_id","category"]Additional columns to include in policy metadata

Ingest your first document

python
from gateco_sdk import GatecoClient

client = GatecoClient(api_key="gck_live_...")

# Ingest a document
result = client.ingest.document(
    connector_id="your-connector-id",
    resource_id="doc-001",
    content="This document contains confidential HR information.",
    embedding=[0.1, 0.2, ...],  # your 1536-dim embedding
    metadata={"classification": "confidential", "department": "hr"},
)

Troubleshooting

ErrorCauseFix
SSL connection requiredMissing sslmode=requireAdd ?sslmode=require to the end of your connection string
vector type not foundpgvector extension not enabledRun CREATE EXTENSION IF NOT EXISTS vector in your database
permission denied for tableUser lacks SELECT permissionRun GRANT SELECT ON your_table TO gateco_user

Frequently asked questions

Does Gateco work with Neon branches?

Yes. Each Neon branch has its own connection string, so you can connect separate Gateco connectors to your main branch (production) and a development branch independently. Branch-based isolation is useful for testing policy changes before promoting to production.

Should I use the connection pooling (pooled) connection string or the direct string?

Use the direct connection string, not the pooled one. Gateco's connector holds a persistent connection pool internally and does not benefit from Neon's external pooler. The pooled endpoint also limits some SQL features that Gateco uses for metadata queries. The direct string is labeled "Direct connection" in the Neon Console.

What happens if I change my vector table schema after connecting Gateco?

Gateco reads the schema on demand when testing the connection. If you add columns, re-run the connection test in Connectors → your connector → Test. If you rename or drop the embedding column, update the search configuration in Connectors → your connector → Search config before the next retrieval.

Ready to add policy-aware retrieval?

Connect your Neon setup to Gateco in under 5 minutes.