This video shows how to export data from PostgreSQL query result to Excel file in a few clicks with Withdata DBToFile, or with the free Export PostgreSQL query result to Excel online tool. It covers the postgres query side and the Excel side.
This shows how to export the result of a PostgreSQL SELECT — a filtered, joined or aggregated result — to an Excel workbook, rather than dumping a whole table. The video above is the full flow.
SELECT you want to export.Exporting a query instead of a table lets you shape the data before it reaches the spreadsheet: select only the columns you need, filter rows, join several tables and aggregate. That keeps the workbook small and the headers meaningful.
id; use AS so each spreadsheet header is unique.numeric/decimal keep their scale; bigint above 2^53 can lose precision if a reader treats it as a double.timestamp/timestamptz become spreadsheet datetimes; format the column if you only want the date.boolean becomes TRUE/FALSE; NULL is left as an empty cell, distinct from an empty string.jsonb_array_elements or unnest in the query to flatten them into columns.Prefer a browser-based tool? See Export PostgreSQL to Excel, or the app overview Withdata DBToFile.