There's be mention made of the fact that OS X Lion Server ships with PostgreSQL as it's standard database rather than MySQL.

Can anyone confirm:

  1. It this specific to server or does OS X Lion "client" ship with it too?

    I can see indications in the file system on my Mac that it might be included but don't know whether they're the result of a previous aborted Postgres install I did on my machine pre-Lion or just some form of standardisation of directory structures that stops short of an actual install.

  2. Is this intended for use as an end user database or is it just supporting functionality within the OS?


1) Yes, it's included in Lion's client factory default from my 2011 macbook air. I found it accidentally, psql -v will gives you postgresql's latest version, which is version 9 at the moment, entering which psql will give you it's path which resides in /usr/bin/psql. I found postgresql's default user which is _postgres, simply change the password to your desired password as you will by entering sudo passwd _postgres.

2) Nope, I didn't think it's for end user database. Even though the psql binary is there, I couldn't found where's the initdb to initialize the database. But, I can't confirm whether it's to support lion's internal system or not, maybe someone can confirm this part?

If you need a working postgresql installation, my suggestion would be installing from source, by using the user _postgres.


On OS X Lion "client", here's what you can find:

martin$ find /usr/ -name postgre*

So no binary or similar on a default install (yet there are c/c++ headers) and rails stuff. (note I have Xcode 4.1 installed, and this is where all these Header files may have come from).

2) OS X doesn't use a relational database for anything as far as I know. If it's there is to support development or, well, the service itself.

  • 2
    "OS X doesn't use a relational database for anything as far as I know". Actually, it makes quite heavy use of SQLite. – Thilo Jul 29 '11 at 9:55
  • @Thilo well, but that's a different story, SQLite you know, is far from being a process like PostgreSQL. I believe you know what I mean. OS X doesn't have SQLite server running for its own usage that you could use and create dbs, and users, and host applications into. – Martin Marconcini Jul 29 '11 at 11:37

They seem to have renamed the server to postgres_real on my non-server version of Lion.

 $ /usr/bin/postgres_real --version
 postgres (PostgreSQL) 9.0.5
 $ /usr/bin/psql --version
 psql (PostgreSQL) 9.0.5
 contains support for command-line editing

I haven't found initdb or pg_ctl yet so far it seems using it in practice still requires a separate userland install. I just pray that doesn't introduce conflicts and confusion between the two.



It's used as the datastore for the stuff serveradmin(8) works on, Server.App and Server Essentials.

But oh yes, you have it on the client, Server.App activates the stuff, does not install it.


Yes, a clean install of Lion 10.7.2 includes Postgres.

I mean client/desktop edition (I've not used the Server edition).

The included documentation suggests Apple bundled version 9.0.4 of Postgres: file:///Library/WebServer/Documents/postgresql/html/index.html

FYI, current versions of Postgres today are 9.0.6 and 9.1.2.

Besides the list of /usr/ items posted by Martín Marconcini, I also found: /System/Library/PrivateFrameworks/PostgreSQLClient.framework

This was after installing lots of stuff including Java and Eclipse, but not yet doing my own install of Postgres.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .