Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nMcNZ-0000Xv-Vy for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Feb 2022 21:07:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nMcNY-0000oU-Uc for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Feb 2022 21:07:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nMcNY-0000oJ-Jo for pgsql-hackers@lists.postgresql.org; Tue, 22 Feb 2022 21:07:24 +0000 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nMcNV-0007Yp-Ju for pgsql-hackers@postgresql.org; Tue, 22 Feb 2022 21:07:24 +0000 Received: by mail-pf1-x430.google.com with SMTP id z15so7584454pfe.7 for ; Tue, 22 Feb 2022 13:07:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=HHTFMnehY1BohrzrwWehyjanfQUY5Z/IeYRk4B7Ht/c=; b=eEwxLoSNYmik+R6II7vBX6rEv51B37qo/Ae/lUc2ys+R2LoRSx388L3dWbF5WPEXaQ tymkJaJdDeWZG5/zNSGGlNAZhXO9baURAzmfh/qu4gqnnRHvmFOvcmB0mfzeX1ZyXdwi 38M7najPmA0XAW8dkyejvhYTVjVj+Zi8oQcRDomXmEdpuls678i7wDnJ1wg7EYiYkaAI 2Fcx2HoHxAUeZ3VuWYmW0HRFJpM5It4e8ci0MKVROm5hYG5c8XIep/bxeSz1+jqhjqT7 gWZ6HK1HIa/16S4qivdNzU/7DTHo9dZZ1lySpX4sFMcGghTUhmO4/urA0SV7ZdVsnFFR +i5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=HHTFMnehY1BohrzrwWehyjanfQUY5Z/IeYRk4B7Ht/c=; b=ODdrcjbZvgfSjOOJd3Ac55YtgdzPz8zPQwwodZW2pj27m3fKT73XeFhiEIJ8fe6ZHR LvDz8ZY2tFvh3geJFsrcuHtu9MkcEAFKwktvnkUFfMGgvWMb5HLvvy4H4r3iPMgjaHER 1vxa2iTNQlAcpyBLTrRb3dY1Qv9SS4bhbfe3JkohsjXwsxYPZTsBdtss0N7e/nBlM+kN 1LFZKM5D8IwYnba6yygkeySuzUPBWsipkA1ycvDOttmxq186ZlL9JAg0X9KcPS/1sew5 TgC85kkmFPbc1hId1ds3P/UA+Hw/nL6dJsxzl059i6zn2qArjtD1/S1/HtV1ZdiIja2x Yt5w== X-Gm-Message-State: AOAM531w7QpLjWk4Tns0+1zPPZ65TXw6tDcr6EcOat7MCGquplPvgD8L b+Ra0NLM418WhJDJTHQbJz4= X-Google-Smtp-Source: ABdhPJyBlYnjRA1k2DFuQscf0bxhmwk4fe7P2qMQr8us1awvdQgiYcTFeEOL9wIFOg6EW/plCkLQXA== X-Received: by 2002:a63:1b5e:0:b0:36f:e756:c118 with SMTP id b30-20020a631b5e000000b0036fe756c118mr20998627pgm.562.1645564038656; Tue, 22 Feb 2022 13:07:18 -0800 (PST) Received: from nathanxps13 ([50.54.155.70]) by smtp.gmail.com with ESMTPSA id q5sm19725846pfu.199.2022.02.22.13.07.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Feb 2022 13:07:18 -0800 (PST) Date: Tue, 22 Feb 2022 13:07:16 -0800 From: Nathan Bossart To: Shmuel Kamensky Cc: pgsql-hackers@postgresql.org Subject: Re: C++ Trigger Framework Message-ID: <20220222210716.GA45420@nathanxps13> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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