Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TLdHT-0004DD-7G for pgsql-committers@postgresql.org; Tue, 09 Oct 2012 17:07:43 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TLdHR-0005Ll-Dy for pgsql-committers@postgresql.org; Tue, 09 Oct 2012 17:07:42 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q99H7bZ5025906; Tue, 9 Oct 2012 13:07:37 -0400 (EDT) From: Tom Lane To: Alvaro Herrera cc: pgsql-committers@postgresql.org Subject: Re: pgsql: Fix thinko in previous commit In-reply-to: <20121009122009.GB4214@alvh.no-ip.org> References: <20121009041314.GC28686@alvh.no-ip.org> <20695.1349757261@sss.pgh.pa.us> <2547.1349760458@sss.pgh.pa.us> <20121009122009.GB4214@alvh.no-ip.org> Comments: In-reply-to Alvaro Herrera message dated "Tue, 09 Oct 2012 09:20:09 -0300" Date: Tue, 09 Oct 2012 13:07:36 -0400 Message-ID: <25905.1349802456@sss.pgh.pa.us> X-Pg-Spam-Score: -4.0 (----) X-Archive-Number: 201210/127 X-Sequence-Number: 49436 Alvaro Herrera writes: > Tom Lane wrote: >> Looking again at the spoonbill failure, it's striking that it gets as >> far as plpython before choking. The symptoms are consistent with the >> theory that USE_INLINE is getting #define'd by some Python header or >> other, after having *not* been defined by pg_config.h. Maybe we should >> rename that to PG_USE_INLINE? > Ahh, that makes a lot of sense, yes; and I see that the Python headers > in my machine do mention USE_INLINE (though this is not defined, even on > pyconfig.h), so it is indeed possible that on some other machines it is > defined somewhere in those headers. I will go rename ours. Thanks for > the research. I'd not tried a build with plpython on my old HPUX box recently, but looking into its Python headers I find $ grep -r USE_INLINE /usr/local/include/python2.5 /usr/local/include/python2.5/pyport.h:#undef USE_INLINE /* XXX - set via configure? */ /usr/local/include/python2.5/pyport.h:#elif defined(USE_INLINE) which means on this box things would have failed in the opposite direction (undefined references to non-provided external functions) without the rename. So that's the right fix for sure. >> It's (probably) not contributing to this particular breakage, but I >> can't say that I think undef'ing things like _POSIX_C_SOURCE midstream >> is a bright idea at all. Seems to me that could easily result in >> inconsistent results from reading different system header files. > Ugh. The more I think about that, the more worried I get. It's not just that _POSIX_C_SOURCE might be defined or not, it's that the *value* it has affects what definitions you get. At least that's how it looks on my box. So our existing code potentially allows Python.h to redefine it with a different value than what we'd defined it as, which could result in inconsistencies between the system headers included by postgres.h and those included later. I think this needs reconsideration. Not sure what to do about it exactly, though :-( regards, tom lane