Power Query needs Npgsql in the Windows GAC, and Npgsql 4.1 and above break it. Every method compared, including what works on Mac and web Excel.
PostgreSQL is one of the most widely used open-source databases, but getting it into Excel has more friction than SQL Server. Power Query has a PostgreSQL connector, but it needs the Npgsql provider installed in the Windows Global Assembly Cache, and only version 4.0.17 works. Npgsql 4.1 and above are incompatible due to .NET version constraints, which catches people who install the latest version. On top of that, everything driver-based is Windows desktop only. Here is every method, including the ones that work on Mac and Excel on the web.
Method 1: Power Query PostgreSQL connector
In Windows desktop Excel, go to Data, Get Data, From Database and look for From PostgreSQL Database. Before this option will connect, install Npgsql version 4.0.17 from the Npgsql GitHub releases page. Run the .msi installer, and during setup check the Npgsql GAC Installation option so the library is registered where Excel can find it. Match the architecture: if your Excel is 32-bit, install the 32-bit Npgsql, and vice versa.
Once installed, enter the server hostname and database name in the dialog. Power Query loads the schema and lets you pick tables or write a native SQL query under Advanced Options. Credentials are stored per connection.
The catch: Windows desktop Excel only. Npgsql 4.1 and above are explicitly not supported; installing the latest Npgsql breaks the connection. Version compatibility is the most common failure point for people who followed recent Npgsql documentation.
Method 2: ODBC via the psqlODBC driver
Download the psqlODBC driver from the PostgreSQL downloads page, install it on Windows, and create a DSN in ODBC Data Sources. In Excel, go to Data, Get Data, From Other Sources, From ODBC, pick the DSN, and connect. Power Query wraps the connection and lets you write SQL in the advanced options.
The catch: Windows desktop only, and the 32-bit vs 64-bit architecture must match between the driver and your Excel install. For remote databases, port 5432 must be open and the PostgreSQL host-based authentication file (pg_hba.conf) must permit connections from your machine's IP.
Method 3: psql \copy to CSV, then open in Excel
From a terminal with psql connected to your database, run a \copy command to export a query result to a CSV file:
\copy (SELECT * FROM orders WHERE created_at >= NOW() - INTERVAL '30 days') TO '/tmp/orders.csv' WITH CSV HEADER
Open the resulting CSV in Excel. This works on any platform, including Mac and web Excel, because you are importing a plain file. Tools like TablePlus, DBeaver, and pgAdmin also have CSV export options if you prefer a GUI. In pgAdmin 4, right-click any table, choose Import/Export Data, set the direction to Export, choose CSV, and download the file.
The catch: entirely manual. Every refresh is a repeat of the export. Fine for one-off snapshots, not for recurring reports.
Method 4: Brooked for Excel (Mac, web, RDS, Supabase, Neon)
Brooked for Excel is an add-in that connects to PostgreSQL directly using a standard connection string. It accepts the connection strings from hosted providers including Amazon RDS, Supabase, and Neon without any driver installs. It runs inside Excel's ribbon and works in desktop Excel on Windows, desktop Excel on Mac, and Excel on the web. The AI analyst lets you ask plain-English questions about the data you imported.
Honest framing: Excel support is in beta. Manual imports and the AI analyst work today; scheduled refresh is rolling out through the beta. The Google Sheets version of the connector is fully live, so the PostgreSQL plumbing itself is mature.
Setting up the PostgreSQL connection
Open Brooked in the Excel ribbon, choose PostgreSQL as the source, and paste the connection string or enter the host, port, database, and credentials. For RDS, confirm the security group allows inbound connections on port 5432. For Supabase, use the session pooler connection string from the Connect panel in your project dashboard, which is reachable on IPv4. Pick the tables or write a SQL query, choose the destination sheet, and import.
Method comparison
| Method | Cost | Works on | Refresh | Best for |
|---|---|---|---|---|
| Power Query PostgreSQL connector | Free (requires Npgsql v4.0.17) | Windows desktop Excel only | Refresh All in Power Query | Windows shops willing to manage Npgsql |
| ODBC via psqlODBC driver | Free | Windows desktop Excel only | Refresh All in Power Query | Windows environments with IT-managed ODBC |
| psql \copy to CSV, open in Excel | Free | Any Excel | Manual re-export | Developers comfortable with the command line |
| Brooked for Excel | Free during beta | Desktop, Mac and web Excel | Scheduled (rolling out in beta) | RDS, Supabase, Neon; Mac and web Excel |
What teams build with this
- Product analytics reports from a PostgreSQL data warehouse, refreshed weekly into a formatted Excel workbook
- SaaS billing summaries joining subscription and payment tables for a monthly close packet
- User activity cohort tables built from event logs in PostgreSQL, for retention analysis in Excel
- Engineering on-call reports showing error rates and latency percentiles pulled from a metrics database
- Marketing attribution exports from a PostgreSQL-backed analytics backend, delivered to a shared workbook
Troubleshooting common issues
Related Articles
- How to Connect MySQL to Excel
- How to Connect Supabase to Excel
- PostgreSQL to Google Sheets: Connect & Auto-Sync in 10 Minutes (2026)
Frequently asked questions
Does Excel have a built-in PostgreSQL connector?
Power Query includes a PostgreSQL Database option, but it is not truly built-in: it requires the Npgsql ADO.NET provider to be installed on the Windows machine and registered in the Windows Global Assembly Cache. The specific version that works is 4.0.17. Npgsql 4.1 and above are not supported due to .NET version incompatibilities. It is available only on Windows desktop Excel, not on Mac or Excel on the web.
Can I connect PostgreSQL to Excel on a Mac?
Not with Power Query or ODBC. Both depend on Windows drivers that do not exist on macOS. On a Mac, the options are exporting CSV from psql or a tool like TablePlus, or using a connector add-in that runs natively in Excel for Mac. Brooked for Excel works on Mac.
Can I connect PostgreSQL to Excel on the web?
No database connector in Power Query works in Excel on the web. The web version does not have Get Data panels that can reach an external database. You need a manual export or an add-in. Brooked for Excel supports Excel on the web.
Does the Power Query PostgreSQL connector work with Amazon RDS or Neon?
It can, as long as the host and port are reachable from the Windows machine, the Npgsql version matches, and SSL requirements are met. RDS requires the security group to allow inbound connections on port 5432 from your machine's IP. Neon and Supabase require SSL and may use different hostnames for pooled connections. Using a connector add-in like Brooked avoids these setup steps.
Can I refresh PostgreSQL data in Excel automatically on a schedule?
Refresh All in Power Query re-runs queries when you click it, but Excel has no built-in timer. Unattended scheduled refresh requires a macro running on a machine that stays awake, or a connector add-in. Brooked for Excel is rolling out scheduled refresh through its beta.
Why does my Power Query PostgreSQL connection fail with a provider error?
The most common cause is the wrong Npgsql version. Npgsql 4.1 and above are not supported; install version 4.0.17 from the Npgsql GitHub releases page and make sure to select GAC Installation during setup. A 32-bit vs 64-bit mismatch between Npgsql and Excel is the second most common cause. Confirm both use the same architecture.
Can I export PostgreSQL data to Excel without installing anything?
Yes, for a one-off snapshot. In pgAdmin 4, right-click the table you want, choose Import/Export Data, set the direction to Export, pick CSV, and download the file. Open the file in Excel. From psql, the \copy command writes the query result to a local CSV file. Online converter tools (such as RebaseData) accept a PostgreSQL dump file and return an Excel file, which may work for small static exports but gives you no live connection.
Get live PostgreSQL data in Excel, on any platform.
Brooked for Excel is in beta and free to try. Using Google Sheets instead? Read the Sheets version of this guide.
See Brooked for Excel →

