Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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?
share|improve this question

5 Answers 5

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.

share|improve this answer

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.

share|improve this answer

http://opensource.apple.com/source/PostgreSQL/PostgreSQL-23/

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.

share|improve this answer

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.

share|improve this answer

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

martin$ find /usr/ -name postgre*
/usr//include/postgres_ext.h
/usr//include/postgresql
/usr//include/postgresql/internal/postgres_fe.h
/usr//include/postgresql/server/postgres.h
/usr//include/postgresql/server/postgres_ext.h
/usr//include/postgresql/server/postgres_fe.h
/usr//lib/postgresql
/usr//share/devicemgr/backend/vendor/rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
/usr//share/devicemgr/backend/vendor/rails/railties/configs/databases/postgresql.yml
/usr//share/devicemgr/webserver/gems/gems/eventmachine-0.12.10/lib/em/protocols/postgres3.rb
/usr//share/man/man1/postgres.1.gz
/usr//share/postgresql
/usr//share/postgresql/postgres.bki
/usr//share/postgresql/postgres.description
/usr//share/postgresql/postgres.shdescription
/usr//share/postgresql/postgresql.conf.sample

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.

share|improve this answer
1  
"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. –  Martín Marconcini Jul 29 '11 at 11:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.