# PostgreSQL AI Ontology & Row-Governed MCP Connector

Canonical URL: https://naditu.com/connectors/postgresql
Category: Databases & Warehouses
Read path: `Streaming Read Replica · Scoped Read-Only Role · TLS`
Write gate: `SQL mutations blocked · Writes routed to application APIs`

The fastest way to fail an enterprise security audit is dropping a generic PostgreSQL MCP container onto an internal database: the LLM guesses joins across unindexed JSONB columns, misinterprets soft-delete flags and runs under a static database role with zero per-employee masking. Naditu puts a deterministic ontology, row-level caller policies and pre-query refusal in front of PostgreSQL.

## Business objects & field-level governance.

- **Customer & Tenant Account** (`accounts · organizations · billing_profiles`) — Tenant / territory row filter & PII column masking
- **Order & Line Transaction** (`orders · order_items · shipments · payments`) — Wholesale cost, fee & margin columns restricted by role
- **Product & Warehouse Stock** (`products · skus · inventory_ledgers`) — Supplier cost masked outside Purchasing & Finance
- **Operational Ticket & Event** (`tickets · workflow_runs · audit_events`) — Closed tables (auth tokens, HR, secrets) refused pre-query

## Three physical schema traps solved in the layer.

1. **Soft-deleted rows (deleted_at IS NOT NULL) and draft state rows:** Application schemas frequently retain cancelled or soft-deleted rows in active tables. Naditu bakes active-record predicates into every canonical object definition.
2. **Polymorphic associations and untyped JSONB payload columns:** Microservice databases drop foreign-key constraints in favor of polymorphic entity_type/entity_id pairs and JSONB blobs. The ontology records verified join paths and typed JSONB paths.
3. **Money stored in minor units (cents/kuruş) alongside decimal columns:** Mixing integer cent columns with numeric currency columns causes 100x reporting errors in raw Text-to-SQL. Naditu normalizes units and currency codes explicitly.

## Common engineering questions.

### Why not use Anthropic’s reference PostgreSQL MCP server in production?

Reference database MCP servers expose raw schema inspection and unrestricted SELECT execution under one shared connection string, with no IdP user mapping, no column masking, no business dictionary and no cross-system joins.

### How does Naditu protect production PostgreSQL OLTP performance?

Naditu connects to a hot-standby read replica using a read-only role with statement_timeout, row limits and blocked DDL/DML verbs.

### Can PostgreSQL tables be joined with SAP, Logo or Salesforce in one question?

Yes. Custom internal PostgreSQL applications join cleanly with commercial ERPs and CRMs inside the same ontology.
