Re: C++ Trigger Framework - Mailing list pgsql-hackers

From Shmuel Kamensky
Subject Re: C++ Trigger Framework
Date
Msg-id CAFOdk+CjLnmPz0rq7Og0au+NJTUvWdWQf7LDAAiGXxsH6xqHpw@mail.gmail.com
Whole thread Raw
In response to Re: C++ Trigger Framework  (Nathan Bossart <nathandbossart@gmail.com>)
Responses Re: C++ Trigger Framework  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
Hi Nathan,

Thanks for the reply. I did indeed read that document and it's a great place to get started. But it doesn't quite answer my questions. Do you personally have experience writing software in C++ that interacts with Postgres?

On Tue, Feb 22, 2022, 23:07 Nathan Bossart <nathandbossart@gmail.com> wrote:
On Tue, Feb 22, 2022 at 04:02:39PM +0200, Shmuel Kamensky wrote:
> I'm interested in creating a Postgres extension that would enable
> developers to write triggers in (modern) C++. Does anyone know if there is
> already some sort of translation wrapper between the native Postgres C
> API's and C++? Or if there's already a project that allows for writing
> triggers in C++ with ease?
> I see that https://github.com/clkao/plv8js-clkao/blob/master/plv8_type.cc
> does implement an abstraction of sorts, but it's specific to v8 types and
> is not genericized as a way of interacting with Postgres C API's from C++
> from *an*y C++ code.
>
> Can you imagine any potential technical challenges I may encounter (e.g.
> massaging postgres' custom allocator to work with C++'s new and delete
> operators, or unresolvable compiler incompatibilities)?

This might answer your questions:

        https://www.postgresql.org/docs/devel/xfunc-c.html#EXTEND-CPP

--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com

pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Using operators to do query hints
Next
From: Andres Freund
Date:
Subject: Re: making pg_regress less noisy by removing boilerplate