Re: server-side extension in c++ - Mailing list pgsql-general

From Craig Ringer
Subject Re: server-side extension in c++
Date
Msg-id 4C04A4EE.4050108@postnewspapers.com.au
Whole thread Raw
In response to Re: server-side extension in c++  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: server-side extension in c++  (David Fetter <david@fetter.org>)
Re: server-side extension in c++  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On 01/06/10 11:05, Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
>> Tom Lane wrote:
>>> Personally I would reduce this section to
>>>     Don't.
>
>> Well, I would have avoided this mine-trap except we have this 9.0
>> release note item:
>>        Allow use of <productname>C++</> functions in backend code (Kurt
>>        Harriman, Peter Eisentraut)
>
> I'd be interested to see a section like this written by someone who'd
> actually done a nontrivial C++ extension and lived to tell the tale.

I can't speak up there - my own C++/Pg backend stuff has been fairly
trivial, and has been where I can maintain a fairly clean separation of
the C++-exposed and the Pg-backend-exposed parts. I was able to keep
things separate enough that my C++ compilation units didn't include the
Pg backend headers; they just exposed a pure C public interface. The Pg
backend-using compilation units were written in C, and talked to the C++
part over its exposed pure C interfaces.

This was very much pain-free, but I certainly wouldn't want to try to
use C++ code tightly intermixed with Pg backend-using code. It'd be a
nightmare.

--
Craig Ringer

Tech-related writing: http://soapyfrogs.blogspot.com/

pgsql-general by date:

Previous
From: Nilesh Govindarajan
Date:
Subject: Re: What Linux edition we should chose?
Next
From: Scott Marlowe
Date:
Subject: Re: What Linux edition we should chose?