Skip to content

PostgreSQL to Excel

Send PostgreSQL data to Excel automatically

Connect PostgreSQL to Mammoth, pick the fields you want and send them to Excel. Mammoth keeps Excel up to date on a schedule, so nobody exports a report by hand.
  1. PostgreSQL
  2. Mammoth
  3. Excel
    Order IDCustomerStatusTotal
    50213Pine & CoShipped$412.00
    50214Delta SupplyPending$1,080.00
    50215Marlow CafeShipped$96.50
    50216Pine & CoRefunded$58.00

Shown on sample data.

Set up PostgreSQL to Excel in three steps

  1. Step 1

    Connect PostgreSQL

    Enter your server's host, port, database and a user with read access. An SSH bastion host works too.

  2. TablesViewsYour SQL
    Step 2

    Pick your fields

    Pick a table, or write your own SQL. Mammoth shows the rows before you save.

  3. Updated
    Step 3

    Send it to Excel

    Email the Excel file after every update, or connect Excel to a Live link.

Start free and connect PostgreSQL14-day Pro trial · No credit card

Choose how Excel updates

Your PostgreSQL data refreshes every day, or only when you ask. You can set a different schedule.

Excel
Order IDCustomerStatusTotal
50213Pine & CoShipped$412.00
50214Delta SupplyPending$1,080.00
50215Marlow CafeShipped$96.50
Email the file

Sends a new Excel file after every update.

Best for people who want the file in their inbox.

Excel
Order IDCustomerStatusTotal
50213Pine & CoShipped$412.00
50214Delta SupplyPending$1,080.00
50215Marlow CafeShipped$96.50
Live link

Excel refreshes from a fixed web address.

Best for a workbook you keep and refresh.

Emails go to up to 50 people in your workspace. Files over 10 MB arrive as a download link.

Clean and combine your PostgreSQL data first

Mammoth gets the data ready before it goes to Excel.

Join

Add your other data

Join PostgreSQL with HubSpot, Xero, Salesforce or 100+ other sources.

Status codes turned into wordsDuplicate customers merged
Clean

Fix the data first

Remove duplicates, fill blanks and fix formats. The same fixes run every time.

Lifetime value = Sum of Total by Customer
Calculate

Add the columns you need

Work out lifetime value, order count or month so they arrive ready to use.

What teams use PostgreSQL in Excel for

  • Weekly operations file

    Orders by status, in the team's inbox every Monday.

  • Finance workbook

    Revenue by customer and month, refreshed in Excel.

  • Reports for people without database access

    The numbers they need, without a login to the database.

Ways to get PostgreSQL data into Excel

The free way

How to export PostgreSQL data to Excel by hand

  1. 1Open psql and connect to your database.
  2. 2Run \copy (SELECT * FROM orders) TO 'orders.csv' WITH CSV HEADER.
  3. 3In Excel, choose Data, then From Text/CSV, pick the file and click Load.

\copy writes the file on your own computer and needs no superuser rights. COPY ... TO writes it on the server instead.

You repeat these steps for every update, and any cleaning is done again by hand. Mammoth does it on a schedule.

PostgreSQL: psql \copy

Mammoth

For PostgreSQL data in Excel, cleaned and emailed on a schedule.

  • ✓Clean the data before it reaches Excel
  • ✓Join CRM or accounting data
  • ✓Send the file to people without database access
  • ✓Send the same data to Google Sheets or Power BI
  • ✕No extra tool between the database and Excel

Excel's own PostgreSQL connector

For people who can reach the database from Excel.

  • ~Clean the data before it reaches ExcelIn Power Query
  • ~Join CRM or accounting dataIn Power Query
  • ✕Send the file to people without database access
  • ✕Send the same data to Google Sheets or Power BI
  • ✓No extra tool between the database and Excel

Common questions about PostgreSQL to Excel

How do I connect PostgreSQL to Excel?
Connect PostgreSQL to Mammoth and pick the fields you want. Then export them to Excel, and Mammoth keeps it up to date.
Does Excel update automatically?
Yes. Your PostgreSQL data refreshes every day, or only when you ask. You can set a different schedule. After each refresh, Mammoth sends the new data to Excel.
Can I limit how often the email sends?
Yes. By default it sends whenever the data updates. You can limit it to at most once a day or once a week.
How do I connect Excel to a Live link?
In Excel, choose Data, then From Web, and paste the link. Excel fetches the latest data each time you refresh.
What access does Mammoth need in PostgreSQL?
A database user with SELECT permission on the tables you want. Mammoth only reads.

Step-by-step setup is in our docs for PostgreSQL and Excel.

Keep Excel up to date with PostgreSQL data.

Start free, connect PostgreSQL, and send it to Excel.

  • ✓ 14-day Pro trial
  • ✓ No credit card
  • ✓ Viewers always free