Query an external PostgreSQL database directly from Databricks using Unity Catalog Lakehouse Federation

domain: docs.databricks.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Create a Unity Catalog connection with CREATE CONNECTION <name> TYPE POSTGRESQL OPTIONS (host, port, user, and a reference to a Databricks secret rather than a literal password), requiring the CREATE CONNECTION privilege on the metastore.
  2. Create a foreign catalog mirroring the external database with CREATE FOREIGN CATALOG <catalog> USING CONNECTION <name> OPTIONS (database '<db>'), requiring CREATE CATALOG privilege plus ownership or CREATE FOREIGN CATALOG privilege on the connection.
  3. Browse the foreign catalog's schemas/tables in Catalog Explorer or via SQL just like a native Unity Catalog catalog.
  4. Run federated queries, including cross-catalog joins with native Unity Catalog tables, and inspect the query plan to confirm predicate/column pushdown is occurring.
  5. Apply Unity Catalog grants on the foreign catalog/schema/table to control access, since Lakehouse Federation enforces governance at the Databricks layer in addition to the source system's own permissions.

Known gotchas

Related routes

Register external lineage metadata in Unity Catalog for pipelines and BI tools that run outside Databricks
docs.databricks.com · 5 steps · unrated
Understand and create managed vs external volumes in Unity Catalog
docs.databricks.com · 5 steps · unrated
Grant privileges on Unity Catalog securable objects using SQL
docs.databricks.com · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans