Re: Mostly Harmless: Welcoming our C++ friends - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: Mostly Harmless: Welcoming our C++ friends
Date
Msg-id 87prk6x3ie.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: Mostly Harmless: Welcoming our C++ friends  (Kurt Harriman <harriman@acm.org>)
Responses Re: Mostly Harmless: Welcoming our C++ friends  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Kurt Harriman <harriman@acm.org> writes:

> Hi Peter,
>
>> Have you considered writing a procedural language plugin for C++?
>
> C++ can masquerade as C, so I don't think it needs a separate
> plugin.  Just tell PostgreSQL that your user-defined function
> is C even though you secretly know it is C++.

Well one thing that might be useful for a c++ procedural language would be
catching C++ exceptions and translating them into ereports which could then be
caught in Postgres.

That's actually what I thought you had done but I just reread your mail and
realized you only handled unhandled exceptions which cause the backend to die.

The other way around could be useful too -- catching ereports/elogs within a
backend API call from C++ code and throwing a C++ exception. I'm not sure if
that's doable though.

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Ask me about EnterpriseDB's RemoteDBA services!


pgsql-hackers by date:

Previous
From: Kurt Harriman
Date:
Subject: Re: Mostly Harmless: Welcoming our C++ friends
Next
From: Peter Eisentraut
Date:
Subject: Re: Mostly Harmless: Welcoming our C++ friends