top | item 28084271

Postgres.app

325 points| simonebrunozzi | 4 years ago |postgresapp.com

154 comments

order
[+] elnygren|4 years ago|reply
I've always preferred Docker for setting up databases and database-like services on a development machine because then everything is nicely isolated. i.e no need to worry about random files in /etc/foo, easy to setup many versions per project etc.

This is what I've been using for Postgres:

        docker volume create postgres
        docker run -d \
          -p 127.0.0.1:5432:5432 \
          -v postgres:/var/lib/postgresql/data \
          --name postgres \
          --restart always \
          postgres
(this one is just latest, but adding a version is trivial)
[+] afavour|4 years ago|reply
I went down this road for a long time and eventually realised I was gaining very little from it and picking up a bunch of downsides.

Obviously everyone’s experience is different because we’re all doing different things but I mostly work with Rust and Node, I use Postgres.app as a local dev database and just run the code natively, sometimes Node via nvm when I care about specific runtime versions.

It works great. It performs better then any Docker-based solution (I’m on a Mac) and doesn’t leave me with a bunch of weird dangling images/containers/whatever taking up resources. I still like the idea of using the same Docker environment in dev that I use in production but in reality I just don’t need it.

[+] nightpool|4 years ago|reply
I love using Docker Compose in theory, but I've found it really difficult to do local development with a "Docker only" setup on Mac, due to the performance issues with the filesystem layer (even when using cached volumes, etc). Ruby gemfiles and node_modules are big culprits here, since they involve a lot of filesystem accesses to load/install dependencies. It might be more manageable if I was just using Postgres from docker and had e.g. rubyenv and nodenv installed locally, but that sacrifices a lot of the benefits you gain from having a docker-compose setup, and I've never had any problems with managing multiple PG versions in my Postgres.app install.
[+] Doctor_Fegg|4 years ago|reply
Postgres.app supports multiple versions, and doesn't put random files in /etc/foo - everything is in the right place for a Mac app, i.e. Postgres itself is in /Applications and the database is in ~/Library/Application\ Support/Postgres.
[+] moonchrome|4 years ago|reply
Docker on Mac is a performance and battery hog in my experience.
[+] NelsonMinar|4 years ago|reply
Let's see... the user could download an app, click it, and run Postgres. Or they could figure out how to install Docker, then run a terminal, then type two obscure and inscrutable commands into it. Perhaps administrator privileges are required along the way.

Sure, the Docker route is better in many ways. But perhaps you're not understanding the audience for a packaged Mac application.

[+] ramraj07|4 years ago|reply
I’m yet to see people who use docker for development do it faster than People who don’t. They always end up having to mount specific folders etc which nullifies the isolAtion point and you lose so much because even something as simple as ide debugging becomes a complicated (if not impossible) task.
[+] Macha|4 years ago|reply
I use docker (well, podman) for postgres on my personal machine because it's the one package that causes me headaches in my rolling release distro. Postgres n -> n+1 always requires a migration process (and you can't shortcut n -> n+x), so if I spend a period of time not working on my Postgres using projects, I find I've updated from n -> n+2 or more and need to figure out how to get the old version installed again since it's a dependency of the migration tools to have both versions available.
[+] EamonnMR|4 years ago|reply
While Postgres works fine on macs, being able to run MySQL in a docker container and not have to deal with actually keeping it running on our macs has been a huge time saver.
[+] mekster|4 years ago|reply
I trust OS packages for main daemons like database, smtp, http daemons.

How are you meant to apply only security patches on docker containers?

What's the point of "isolating" daemons to avoid "random" files in /etc?

It just makes it harder to git control and back up /etc by splitting it all over the containers.

[+] WhyNotHugo|4 years ago|reply
Yeah, same. I usually use docker-compose per-project and manage the database (and other services) using that.

The idea of a "system" postgres is kinda wierd, since that single instance has to work with all my projects -- which might have conflicting needs.

[+] SkyMarshal|4 years ago|reply
Doesn't the OS X .app format package everything in a nicely isolated single file too? That's what it seems postgres.app does.
[+] bob1029|4 years ago|reply
> because then everything is nicely isolated

This is why we use SQLite for all the things. I don't even remember what a database installation process looks like anymore. It's just a nuget dependency and some code for us.

[+] Lockyy|4 years ago|reply
I love postgres.app, such a great solution. It always bothered me though that https://postgres.app would just 404 whenever I'd go to look up the docs or go to install on a new machine.

Hopefully a few other people have had their lives made a tiny bit easier by the redirect I set up.

[+] sudhirj|4 years ago|reply
That's really nice of you, thanks!
[+] harg|4 years ago|reply
It looks nice for beginners but personally I find that a simple docker-compose file per project that spins up a postgresql container works pretty nicely and is really easy to use. I just run `docker-compose up -d` and I have a database running. Docker containers also stay out of the way of the os and I can run the right versions for whichever project.
[+] dagw|4 years ago|reply
I think you and this app are solving quite different problems. For you (and most people replying) it sounds like PostgreSQL is a component in a larger app that will eventually get deployed and run somewhere else and only be interacted with via that app.

Others (like myself) use PostgreSQL as a local datastore and analysis engine. All my interaction with the database is via ad hoc SQL commands and locally run scripts and desktop applications. For this usecase, something like this is much easier to use than docker compose.

[+] mosselman|4 years ago|reply
> beginners

Why is this for beginners? Because it is so easy to use? I guess I am a beginner then.

> works pretty nicely

Postgres.app works perfectly and is very minimal in system requirements vs having docker running and the amount of storage it requires.

[+] DelightOne|4 years ago|reply
Makes you able to automatically run initialization scripts too.
[+] aoms|4 years ago|reply
I do this too, much easier
[+] jamil7|4 years ago|reply
For a really nice client for macOS see Postico:

https://eggerapps.at/postico/

(not affiliated, just a fan)

[+] b6z|4 years ago|reply
It's mentioned and linked in the article. And "[i]t’s made by the same people that maintain Postgres.app."
[+] rubyist5eva|4 years ago|reply
I would recommend TablePlus as it supports more than just postgres, and is also on Windows if you need it.

Not affiliated, just an extremely happy customer.

[+] elpatoisthebest|4 years ago|reply
Postico is the only application I miss from the days when I developed exclusively on the mac.

To be fair, I use (and like) TablePlus, but it's no Postico...

[+] ultrarunner|4 years ago|reply
Also a fan of Postico. For anyone curious, I emailed support asking if there would be access to multiple query tabs after purchase/activation, but got no response. I'm happy to report that it does work that way, and works well. I hope this is app is still being supported because it's overall it's quite well done.
[+] Doctor_Fegg|4 years ago|reply
Can't recommend this highly enough. It comes with the full PostGIS stack included, so command-line gdal, ogr2ogr, proj etc. - just add to your path and it's there for you. It runs multiple versions of Postgres, which came to my aid when Homebrew botched an upgrade: I could just copy the data files across to Postgres.app and recover them there. Overall it's so much better than installing Postgres via Homebrew.
[+] bradhe|4 years ago|reply
Been a Postgres.app user for years, it's been great. There are other more "sophisticated" setups that have advantages (and disadvantages!) but nothing beats the convenience, in my eyes, of Postgres.app.
[+] anonu|4 years ago|reply
I would recommend DBeaver as a good client/IDE as well.
[+] lamton|4 years ago|reply
Datagrip and Dbeaver are my favortie tools
[+] hestefisk|4 years ago|reply
Yes I can vouch for that. psql on command line is also quite good…
[+] fdr|4 years ago|reply
This was one of the more useful things Heroku ever seeded, though the maintenance in the intervening decade has certainly eclipsed the initial effort (https://blog.heroku.com/postgresapp_the_easiest_way_to_devel...).

These days I tend to use "asdf" for my Postgres version management. It's not as friendly, but I kind of like running my services (where n < 5) in the foreground myself so I can see errors in the console with ease, and I like that asdf handles all the tools where I have exacting version requirements consistently (and even a few I don't).

[+] boros2me|4 years ago|reply
Love the simplicity of the app, used it for years! However when I started working with docker-compose stacks exposing PostgreSQL port I had to uninstall it because it all got confusing.
[+] doctor_eval|4 years ago|reply
Used this for years. Can confirm awesomeness.
[+] xmodem|4 years ago|reply
Use it and love it. I use docker too for ephemeral databases but keep the long-lived ones here.

I just wish there was a version of this for mySQL/MariaDB.

[+] kiwicopple|4 years ago|reply
I switched to docker for most of my local dev these days, using this image for “pure Postgres with extensions” (PostGIS, pgRouting, pgTAP, plv8, wal2json):

https://github.com/supabase/postgres

It’s also bundled as an AWS image with pgbouncer

[+] hestefisk|4 years ago|reply
Had never heard of plv8. Has anyone used it for anything at scale? Quite cool with JS directly in functions although the dynamic typing could be a bit strange …
[+] evaneykelen|4 years ago|reply
If you like to use the ‘pg’ Ruby gem in conjunction with this app then you need to use `gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/X.Y/bin/pg_config` where X.Y refers to the correct version (IIRC you can also replace the version nr by `Latest`).
[+] jacobwg|4 years ago|reply
For something similar that also supports MySQL and Redis, DBngin (https://dbngin.com/) is pretty great, from the team that built TablePlus.
[+] shp0ngle|4 years ago|reply
I just use brew and `brew services start postgresql` but who cares
[+] KingOfCoders|4 years ago|reply
I've happily used that on OSX (simpler than docker etc.), now I've switched to Windows, anything like that for Windows?
[+] tyingq|4 years ago|reply
Obviously not a GUI, but WSL is pretty nice for this, even if you don't need it for anything else. You can run things like

  wsl.exe -d Ubuntu -u root /some/linux/script 
From powershell or the cmd.exe console. There's a bit of fiddling required to connect from windows to the WSL postgres instance, but once that's done, it's a nice setup.

Edit: You can also use WSL as a sort of "docker like" setup, using wsl --export / wsl --import to make WSL images with different versions of Postgres, start/stop them, etc. With a small distro like Alpine, it's relatively fast.

[+] jrochkind1|4 years ago|reply
Have been developing on MacOS using Postgres.app for years. It just works, never even think about it.
[+] wirddin|4 years ago|reply
Pretty awesome. I use this along with MongoDB.app and Redis.app makes a lot of small tasks easier.