Proposal for Prototype Implementation to Enhance C/C++ Interoperability in PostgreSQL

From: 盏一 <w(at)hidva(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Proposal for Prototype Implementation to Enhance C/C++ Interoperability in PostgreSQL
Date: 2023-05-07 06:48:14
Message-ID: tencent_319A34A95B66D9B4396133AF@qq.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

I am writing to propose a prototype implementation that can greatly enhance the C/C++ interoperability in PostgreSQL. The implementation involves converting PG longjmp to&nbsp;[force unwind](https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html#base-throw), which triggers the destruction of local variables on the stack. Additionally, it converts throw statements that are not associated with catch to PG longjmp, thereby avoiding the call to terminate.

The proposed implementation can significantly improve the interoperability between C and C++ code in PostgreSQL. It allows for seamless integration of C++ code with PostgreSQL, without the need for complex workarounds or modifications to the existing codebase.

I have submitted the implementation on&nbsp;[GitHub](https://github.com/postgres/postgres/commit/1a9a2790430f256d9d0cc371249e43769d93eb8e#diff-6b6034caa00ddf38f641cbd10d5a5d1bb7135f8b23c5a879e9703bd11bd8240f). I would appreciate it if you could review the implementation and provide feedback.

Thank you for your time and consideration.

Best regards,

盏一
----------

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Yurii Rashkovskii 2023-05-07 08:07:52 Re: [PATCH] Allow Postgres to pick an unused port to listen
Previous Message Erik Rijkers 2023-05-07 05:09:04 Re: 2023-05-11 release announcement draft