You have cleaned your data in PostgreSQL and now you need to save it as a CSV file so you can upload it to GitHub. This guide shows you the quickest way to do that in pgAdmin 4 - no terminal, no command line.
What You Will Need
- pgAdmin 4 open and connected to your database.
- Your cleaned table ready in PostgreSQL.
- A folder on your computer where you are keeping your project files.
Option A - Right-Click Export (Easiest)
This is the same dialog you used to import your CSV - but this time you use Export mode.
- In the left panel, expand your database, then Schemas > public > Tables.
- Right-click your cleaned table and select Import/Export Data.
- At the top of the dialog, click Export (not Import).
- Click the folder icon next to Filename and choose where to save the file. Name it
retail_data_clean.csv. - Set Format to csv.
- Make sure Header is toggled on so the column names are included in the file.
- Click OK. pgAdmin will export the table and save the file.
Option B - Export Using a Query
If you only want to export specific rows or columns - for example, after filtering out bad data - you can run a query first and save the results.
- Open the Query Tool (Tools > Query Tool).
- Run your SELECT query to get exactly the rows you want.
- In the results panel, click the download icon (it looks like a floppy disk or arrow pointing down).
- Choose Download as CSV and save the file as
retail_data_clean.csv.
Check Your File
Open the file in Excel or a text editor to confirm it looks right. You should see your column headers in the first row and clean data below - no negatives, no blanks where you fixed them, no duplicates.
Next Step
You now have your clean CSV ready. Head back to your Bampaa project and continue with saving your query file.
Try it yourself
Start with Level 1: SELECT, in your browser.
The first 5 levels are free · no sign-up needed