Subject: INSTALL file nits

From: Rich Morin <[email-masked]>
Date: Wed, 28 Sep 2005 18:29:07 -0700

I just grabbed a copy of PostgreSQL from

   http://www.apple.com/downloads/macosx/unix_open_source/postgresql.html

and installed it on my Mac OS X (Tiger; 10.4.2) machine.  I followed the
"Short Version" in the INSTALL file until I ran into problems, then did
some workarounds, as discussed below.  Perhaps this file should be made
a bit more explicit or an INSTALL.OSX file could be generated...

./configure
	No reported problems.

gmake
	No such command, but I ran "make --version" and saw that it
	was GNU Make, so I used it.  No reported problems.

su
	This command requires a root password, which does not exist.
         OSX uses "sudo -s" for this sort of thing.

gmake install
	Used make; no reported problems.

adduser postgres
	No such command.  I considered using System Preferences > Accounts
	to add a user, but this seemed like a rather bogus approach, as it
	would put a user in the Login dialog (unlike lp, postfix, ...).  I
	found a (slightly dated) note from Apple, however, that suggested
         just this approach, so I gave it a try.

	  http://developer.apple.com/internet/opensource/postgres.html

mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
	No reported problems.

su - postgres
	No reported problems (when run under sudo).

/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 &
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test
	No reported problems, but the last command left me at a prompt
	with no particular instructions as to what I should do next.

-r
-- 
email: [email-masked]; phone: +1 650-873-7841
http://www.cfcl.com        - Canta Forda Computer Laboratory
http://www.cfcl.com/Meta   - The FreeBSD Browser, Meta Project, etc.

---

From: Michael Glaesemann <[email-masked]>
Date: Thu, 29 Sep 2005 10:59:38 +0900

Hello!

Not clear if you're new to PostgreSQL or not, but regardless, a warm  
welcome is extended.

>   http://www.apple.com/downloads/macosx/unix_open_source/ 

Nifty! I didn't know Apple had a link there. And it's even a recent  
version!

> some workarounds, as discussed below.

The short version is definitely that: short. It ceases to be short  
when one adds all of the caveats for all of the various systems and  
environments in which PostgreSQL will run.

> Perhaps this file should be made

One of the joys of open source is that the community can contribute,  
be that source code or documentation. (hint hint)

>         just this approach, so I gave it a try.

To get around this, you can create a user using NetInfo  (or nicl or  
niutil at the command line) by copying another user, such as www.  
Make sure the userid is low (less than 100, iirc) and they will not  
appear in the login window, nor will a home folder be created. I use  
this technique for setting up a svn user on my machine (though I  
haven't done it yet for a postgres user).

Depending on your needs, you may want to bump up the shmmall and  
shmmax values in /etc/rc. They're quite small on a default Mac OS X  
install. I've needed to increase them if I'm running more than one  
installation of PostgreSQL on my box, or if I'm increasing the number  
of allowed connections to the server. With 2GB of available RAM, I  
allocated 256MB rather than the default 4MB. (I include the notes in  
the /etc/rc file so I remember what it was I did.)

Here are my settings
# original supplied with Mac OS X 10.4
# sysctl -w kern.sysv.shmmax=4194304 kern.sysv.shmmin=1  
kern.sysv.shmmni=32 kern.sysv.shmseg=8 kern.sysv.shmall=1024
# Defaults are for 4MB
# shmmax (4MB * 1024KB/MB * 1024 bytes/KB = 4194304 bytes)
# shmall (4MB @ 4K/page => 1024 pages)
# Increase to 256MB
# shmmax (256MB * 1024KB/MB * 1024 bytes/KB = 268435456)
# shmall (256MB @ 4K/page => 65536 pages)
sysctl -w kern.sysv.shmmax=268435456 kern.sysv.shmmin=1  
kern.sysv.shmmni=32 kern.sysv.shmseg=8 kern.sysv.shmall=65536

Don't know if this will be necessary for you, but thought you might  
like to know.

Michael Glaesemann
grzm myrealbox com

---

From: Rich Morin <[email-masked]>
Date: Wed, 28 Sep 2005 19:22:14 -0700

>Not clear if you're new to PostgreSQL or not, but regardless, a warm

Thanks!  I've been lurking on this list for quite a while.  I published
the PostgreSQL manuals a few years ago (under the PTF/Dossier imprint),
but that enterprise wasn't profitable enough to sustain itself.  I also
hang out with some PostgreSQL types in the SF Bay Area and have been
looking at using PostgreSQL with Ruby on Rails, because it handles some
things that neither MySQL nor Rails does (in any reasonable fashion :-).

>environments in which PostgreSQL will run.

Yeah, well, I _did_ scan down the file in search of specific OSXisms.

>be that source code or documentation. (hint hint)

Well, I'm not really expert enough to document the "right" Way To Do It,
but reporting bugs isn't chopped liver...

>To get around this, ...

See, you have all this wonderful arcana at your fingertips.  Why not put
it in an OSX-specific README, let it bounce across the list a few times,
and put it in the distro (or on a wiki, if that's preferable)?

Thanks, in any case, for the useful hints...

-r

---

From: Josh Berkus <[email-masked]>
Date: Thu, 29 Sep 2005 09:27:59 -0700

Rich,

>   http://www.apple.com/downloads/macosx/unix_open_source/postgresql.html

There's a much *bigger* issue than the ones you mention.  That's 
PostgreSQL 7.3, 3 years old.   I've written Apple several times about 
updating it, but no response.

I suggest getting your PostgreSQL from Entropy.ch instead.

--Josh

---

From: Rich Morin <[email-masked]>
Date: Thu, 29 Sep 2005 10:16:54 -0700

Actually, it's version 8.0.3, as of 2005.09.21.  Izzat OK?

-r

At 9:27 AM -0700 9/29/05, Josh Berkus wrote:
>PostgreSQL 7.3, 3 years old.   I've written Apple several times
>about updating it, but no response.

---

From: Josh Berkus <[email-masked]>
Date: Thu, 29 Sep 2005 10:38:50 -0700

Rich,

> Actually, it's version 8.0.3, as of 2005.09.21.  Izzat OK?

Oh, cool!  They updated it!  They just didn't mail me I suppose.

Oh, I see.  This isn't an Apple Download, it's just a link to source 
downloads off of our site.   

I think you're correct, the best thing would be to add something to the 
docs about "installing on OSX".   Could you write such a thing?  You've 
posted most of it, but if you could do a HOWTO-style that would be keen.

Of course, we still recommend entropy.ch:
http://www.entropy.ch/software/macosx/postgresql/

--Josh

-- 
__Aglio Database Solutions_______________
Josh Berkus		       Consultant
[email-masked]	 www.agliodbs.com
Ph: 415-752-2500	Fax: 415-752-2387
2166 Hayes Suite 200	San Francisco, CA

---

From: Josh Berkus <[email-masked]>
Date: Thu, 29 Sep 2005 10:44:41 -0700

Rich, All,

Even better, Dru seems to have an installer:

http://pgsqlformac.sourceforge.net/

I'm going to contact him about mirroring his installer through the FTP 
sites.

--Josh

---

From: Devrim GUNDUZ <[email-masked]>
Date: Thu, 29 Sep 2005 20:49:42 +0300 (EEST)

Hi,

> I'm going to contact him about mirroring his installer through the FTP

Inviting Dru to pgfoundry is better I think, that will make it easier to 
mirror the installer from our FTP and the mirrors like other pgfoundry 
projects.

Regards,

--
Devrim GUNDUZ
Kivi Bilişim Teknolojileri - http://www.kivi.com.tr
devrim~gunduz.org, devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
                       http://www.gunduz.org