# How to set up a Postgres database on your Mac

> This is content from just-tim, the data-and-analytics channel by Tim Ngwena (formerly 'Tableau Tim'). Tim has 12+ years of hands-on BI experience and covers Tableau most of all, plus Power BI, Looker, Hex, SQL and data modelling, the analytics industry, and the craft of doing the job — always tool-agnostic and honest about the trade-offs.

- **Author:** Tim Ngwena (just-tim, https://just-tim.com/about)
- **Published:** 2020-09-04
- **Format:** Video · 13 min watch · transcript available
- **Topics:** Data engineering, Data prep
- **Tools:** Tableau (prep)
- **Canonical:** https://just-tim.com/posts/how-to-set-up-a-postgres-database-on-your-mac
- **Watch:** https://youtu.be/TqWZup5vySs

I walk through installing PostgreSQL 12.4 on a Mac, including how to handle a leftover data directory from a previous install and how to finish the PostGIS plugin install manually around macOS Catalina's quirks. I then launch pgAdmin and write a table from Tableau Prep to confirm the database works.

## Key takeaways

- Download the PostgreSQL installer from EnterpriseDB and keep the default install and data directories unless you know what you're doing
- If a previous install left a Postgres data folder behind, move or delete the leftover folder in the Library before re-running the installer
- On Catalina, let Stack Builder download the PostGIS plugin but skip its install, then run the unzipped installer manually so it prompts correctly for credentials
- Postgres doesn't show as a normal app — launch it via PG_ADMIN4 in the Applications/Postgres folder and watch for the elephant icon to confirm the server is running
- Connect Tableau Prep to localhost with database and username 'postgresql' to write a table, using Replace Data to avoid appending duplicate rows on re-runs

## Chapters

- 0:21 Downloading the installer
- 0:58 Running the setup and fixing a leftover data directory
- 4:40 Stack Builder and the PostGIS plugin
- 6:06 Finishing the plugin install manually
- 7:13 Launching Postgres with pgAdmin
- 9:11 Writing a table from Tableau Prep
- 11:40 Uninstalling Postgres cleanly

Watch the full video, read the transcript and use chapter deep-links on the page: https://just-tim.com/posts/how-to-set-up-a-postgres-database-on-your-mac

---
just-tim — Data and analytics, with a point of view. · https://www.youtube.com/channel/UC7HYxRWmaNlJux-X7rNLZyw · https://twitter.com/TableauTim · https://www.linkedin.com/in/timngwena
