Обсуждение: INSTALL file nits

Поиск
Список
Период
Сортировка

INSTALL file nits

От
Rich Morin
Дата:
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: rdm@cfcl.com; phone: +1 650-873-7841
http://www.cfcl.com        - Canta Forda Computer Laboratory
http://www.cfcl.com/Meta   - The FreeBSD Browser, Meta Project, etc.

Re: INSTALL file nits

От
Michael Glaesemann
Дата:
Hello!

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

On Sep 29, 2005, at 10:29 , Rich Morin wrote:

> I just grabbed a copy of PostgreSQL from
>
>   http://www.apple.com/downloads/macosx/unix_open_source/
> postgresql.html

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

> 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.

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
> a bit more explicit or an INSTALL.OSX file could be generated...

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

> 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.

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


Re: INSTALL file nits

От
Rich Morin
Дата:
At 10:59 AM +0900 9/29/05, Michael Glaesemann wrote:
>Not clear if you're new to PostgreSQL or not, but regardless, a warm
>welcome is extended.

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 :-).

>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.

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

>One of the joys of open source is that the community can contribute,
>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...

>>  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.
>
>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
--
email: rdm@cfcl.com; phone: +1 650-873-7841
http://www.cfcl.com        - Canta Forda Computer Laboratory
http://www.cfcl.com/Meta   - The FreeBSD Browser, Meta Project, etc.

Re: INSTALL file nits

От
Josh Berkus
Дата:
Rich,

> I just grabbed a copy of PostgreSQL from
>
>   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

Re: INSTALL file nits

От
Rich Morin
Дата:
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:
>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.
--
email: rdm@cfcl.com; phone: +1 650-873-7841
http://www.cfcl.com        - Canta Forda Computer Laboratory
http://www.cfcl.com/Meta   - The FreeBSD Browser, Meta Project, etc.

Re: INSTALL file nits

От
Josh Berkus
Дата:
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
josh@agliodbs.com     www.agliodbs.com
Ph: 415-752-2500    Fax: 415-752-2387
2166 Hayes Suite 200    San Francisco, CA

Re: INSTALL file nits

От
Josh Berkus
Дата:
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

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

Re: INSTALL file nits

От
Devrim GUNDUZ
Дата:
Hi,

On Thu, 29 Sep 2005, Josh Berkus wrote:

> 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.

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