Snowflake on Azure FDW lets PostgreSQL query Azure-hosted Snowflake data through foreign tables.
Snowflake deployed in Microsoft Azure provides scalable cloud warehousing. PostgreSQL can read that data through a Foreign Data Wrapper (FDW), so developers join Snowflake facts with local PostgreSQL dimensions without ETL.
The community odbc_fdw
or the commercial multicorn
FDW works. Both rely on Snowflake’s ODBC driver for Azure. Install the driver, then create the FDW.
Run CREATE EXTENSION odbc_fdw;
in the target database. Ensure the PostgreSQL server library path contains the Snowflake ODBC driver (libSnowflake.so
).
Create a server with connection parameters that match your Azure region, Snowflake account, warehouse, database, and schema. Example syntax appears in the next section.
Use CREATE USER MAPPING
to store the Snowflake username, password, and optional role. Keep sensitive values in postgresql.conf
or a secrets manager, not plaintext DDL scripts.
IMPORT FOREIGN SCHEMA
pulls table definitions automatically. Alternatively, define each foreign table manually to rename columns or change data types.
Once foreign tables exist, use standard SELECT, JOIN, and WHERE clauses. PostgreSQL pushes filters to Snowflake when possible, reducing egress costs.
Select only required columns, push predicates, and use Snowflake clustering keys for heavily filtered columns. Keep your warehouse size appropriate; tiny warehouses throttle FDW queries.
Restrict the FDW user in Snowflake to read-only roles. Store credentials in postgresql.auto.conf
with ALTER SYSTEM SET odbc_fdw.password = '•••';
and reload.
Connection failures usually mean the ODBC driver, DSN, or network rules are incorrect. Import errors often occur when Snowflake column names exceed 63 characters; alias them during import.
Yes. The driver rewrites WHERE clauses so Snowflake filters data before sending results back, saving bandwidth and cost.
Most FDWs are read-only. Use Snowflake’s REST API or Snowpipe to load data if you need two-way sync.
Snowflake requires TLS by default. Set sslmode 'require'
in the server options to avoid handshake failures.