Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bZlTZ-0001pw-2Z for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Aug 2016 21:00:45 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bZlTY-0001Xn-LS for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Aug 2016 21:00:44 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bZlTX-0001Va-KJ for pgsql-hackers@postgresql.org; Tue, 16 Aug 2016 21:00:43 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bZlTU-00043n-E0 for pgsql-hackers@postgresql.org; Tue, 16 Aug 2016 21:00:42 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u7GKxu5p028201; Tue, 16 Aug 2016 16:59:56 -0400 From: Tom Lane To: Andres Freund cc: Peter Geoghegan , Robert Haas , Jim Nasby , Gavin Flower , dandl , Adam Brusselback , Joy Arulraj , kang joni , Dmitry Igrishin , Pg Hackers , Peter Eisentraut Subject: Re: [GENERAL] C++ port of Postgres In-reply-to: <20160816205518.yesjo6w2t6os3kvu@alap3.anarazel.de> References: <007001d1f786$d903fa90$8b0befb0$@andl.org> <00a52208-3199-5858-8846-2530b0bb34df@archidevsys.co.nz> <27271.1471366764@sss.pgh.pa.us> <20160816205518.yesjo6w2t6os3kvu@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Tue, 16 Aug 2016 13:55:18 -0700" Date: Tue, 16 Aug 2016 16:59:56 -0400 Message-ID: <28200.1471381196@sss.pgh.pa.us> X-Pg-Spam-Score: -2.5 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Andres Freund writes: > On 2016-08-16 13:40:06 -0700, Peter Geoghegan wrote: >> Actually, come to think of it, I guess this is wrong. The problem with >> what I say here is that longjmp() and setjmp() are incompatible with >> the stack unwinding used by C++ destructors in general (exceptions are >> another issue). I think that the practical implication of that is that >> we can never use any C++ feature that hides the complexity of resource >> management, unless and until elog() is reimplemented to not use >> longjmp() and setjmp(). > FWIW, IIRC that's not true for gcc/glibc, because they IIRC use common > codepaths. But obviously that's not all-encompassing enough to rely on that. I wonder whether it'd be possible to implement the PG_TRY/CATCH macros to use C++ exceptions when building in C++. This would probably mean that C and C++ builds would be incompatible as far as loadable extensions are concerned, because it'd amount to an ABI difference. But maybe that's OK. We could certainly have the PG_MODULE_MAGIC macro guard against the case. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers