Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 20A85632582 for ; Sat, 1 May 2010 19:52:33 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 15918-04 for ; Sat, 1 May 2010 22:52:20 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 2278D63228D for ; Sat, 1 May 2010 19:52:22 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o41MqJUl010670; Sat, 1 May 2010 18:52:19 -0400 (EDT) To: Gavin Kistner cc: pgsql-admin@postgresql.org Subject: Re: Fresh build on OS X not working (memory) In-reply-to: <7169B689-E23A-4B3C-B935-E88F2F2558EA@mac.com> References: <88181C2E-01CD-417C-8266-D5C9AF570C27@mac.com> <15253.1272606140@sss.pgh.pa.us> <25928.1272643065@sss.pgh.pa.us> <16976.1272663334@sss.pgh.pa.us> <7169B689-E23A-4B3C-B935-E88F2F2558EA@mac.com> Comments: In-reply-to Gavin Kistner message dated "Fri, 30 Apr 2010 20:44:51 -0600" Date: Sat, 01 May 2010 18:52:19 -0400 Message-ID: <10669.1272754339@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.86 tagged_above=-10 required=5 tests=AWL=0.050, BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201005/5 X-Sequence-Number: 34478 Gavin Kistner writes: > On Apr 30, 2010, at 3:35 PM, Tom Lane wrote: >> Does the theory of a pre-existing smaller shmem segment make sense from >> your end? In particular, had you previously had another Postgres server >> running on that machine, and perhaps killed it ungracefully? > It seems probably that you have hit the nail squarely on the head. I had installed from the one-click (which was working with the memory changes supplied in the README), and IIRC I tried to kill a few processes in preparation for a manual uninstall before I found the supplied uninstall app. I then compiled and installed from source. When that failed as described earlier, all changes I made to the settings were (as you guessed) through the sysctl -w option without a reboot. The first reboot I had was after I replaced my sysctl.conf wholesale with yours, and all was well. Yeah, I was able to reproduce the problem locally by kill -9'ing the postmaster and then enlarging max_connections in postgresql.conf before trying to restart. In your case it might've been caused by the new version needing a bit more shared memory rather than by any change in parameter settings, but the basic issue seems pretty clear now. I've applied a patch to our CVS to make PG behave more sanely in this case. It does do the right thing if it recognizes that the shmget failure is due to a pre-existing segment, but we weren't being sufficiently careful about distinguishing that from a bad size request. Thanks for the report! regards, tom lane