pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Peter Geoghegan <pg@heroku.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Jim Nasby <Jim.Nasby@bluetreble.com>
Cc: Gavin Flower <GavinFlower@archidevsys.co.nz>
Cc: dandl <david@andl.org>
Cc: Adam Brusselback <adambrusselback@gmail.com>
Cc: Joy Arulraj <jarulraj@cs.cmu.edu>
Cc: kang joni <kangjoni76@gmail.com>
Cc: Dmitry Igrishin <dmitigr@gmail.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Cc: Peter Eisentraut <peter_e@gmx.net>
Subject: Re: [GENERAL] C++ port of Postgres
Date: Tue, 16 Aug 2016 16:59:56 -0400
Message-ID: <28200.1471381196@sss.pgh.pa.us> (raw)
In-Reply-To: <20160816205518.yesjo6w2t6os3kvu@alap3.anarazel.de>
References: <CAOmy0wLcyE3d=jbfpgoKtTicGoZ64AKKfEkG+ccXxtmajSBGeQ@mail.gmail.com>
	<CABgyVxBjX6VbnbHfZRSDJBav4xKH5vSLZqTpr989sMOb+jX+jA@mail.gmail.com>
	<CAMjNa7e7E81T3NqoReixYxrCFQpfWd+Mht0NhetW3bJB=Gs7Og@mail.gmail.com>
	<007001d1f786$d903fa90$8b0befb0$@andl.org>
	<00a52208-3199-5858-8846-2530b0bb34df@archidevsys.co.nz>
	<f7682c24-4271-1ff5-d963-053ecb0fce40@BlueTreble.com>
	<CA+Tgmoa8=kMNkOGDCZYR-L_PAoQ2Vdb9EmSV+=7pRv+J3u7_CA@mail.gmail.com>
	<27271.1471366764@sss.pgh.pa.us>
	<CAM3SWZSu+++ZvHdHst71fSKdLON5GMo-2L_Lk2mN5QvBmuBNBg@mail.gmail.com>
	<CAM3SWZRf9u8CbyOZY4W2iS3Xj_bafMHYraetSbc=W79NQKn_DA@mail.gmail.com>
	<20160816205518.yesjo6w2t6os3kvu@alap3.anarazel.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Andres Freund <andres@anarazel.de> 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



view thread (76+ messages)  latest in thread

Message-ID: <28200.1471381196@sss.pgh.pa.us>
Permalink:  ../28200.1471381196@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/28200.1471381196@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, pg@heroku.com, robertmhaas@gmail.com, Jim.Nasby@bluetreble.com, GavinFlower@archidevsys.co.nz, david@andl.org, adambrusselback@gmail.com, jarulraj@cs.cmu.edu, kangjoni76@gmail.com, dmitigr@gmail.com, pgsql-hackers@postgresql.org, peter_e@gmx.net
  Subject: Re: [GENERAL] C++ port of Postgres
  In-Reply-To: <28200.1471381196@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox