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 1mi20N-0002Fw-9G for pgsql-general@arkaria.postgresql.org; Tue, 02 Nov 2021 22:11:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mi20L-0005o9-S4 for pgsql-general@arkaria.postgresql.org; Tue, 02 Nov 2021 22:11:41 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mi20L-0005o0-6F for pgsql-general@lists.postgresql.org; Tue, 02 Nov 2021 22:11:41 +0000 Received: from carbon.misis.ru ([85.143.104.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mi20H-0002UY-OD for pgsql-general@lists.postgresql.org; Tue, 02 Nov 2021 22:11:39 +0000 Received: from mail.tzirechnoy.ru (unknown [10.1.250.11]) by carbon.misis.ru (Postfix) with ESMTP id B71BB1FDDA for ; Wed, 3 Nov 2021 01:11:34 +0300 (MSK) Received: by mail.tzirechnoy.ru (Postfix, from userid 1000) id 32682A42A4; Wed, 3 Nov 2021 01:11:34 +0300 (MSK) Date: Wed, 3 Nov 2021 01:11:34 +0300 From: Ilya Anfimov To: pgsql-general@lists.postgresql.org Subject: Re: develop a extension with cpp? Message-ID: <20211102221133.GA2571211@azor.tzirechnoy.ru> Mail-Followup-To: Ilya Anfimov , pgsql-general@lists.postgresql.org References: <1743125197.2944577.1635816682155.ref@mail.yahoo.com> <1743125197.2944577.1635816682155@mail.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1743125197.2944577.1635816682155@mail.yahoo.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: B71BB1FDDA X-Rspamd-Server: carbon X-Spamd-Result: default: False [1.00 / 15.00]; ARC_NA(0.00)[]; BAYES_SPAM(0.00)[34.80%]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; SUBJECT_ENDS_QUESTION(1.00)[]; RCVD_COUNT_TWO(0.00)[2] List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Nov 02, 2021 at 01:31:22AM +0000, huangning290@yahoo.com wrote: > Hi > if i can develop a extension with cpp language? > regards! Generally, like in any other language. Write files, use calls and APIs available inside Postgres, compile it and install to postgres directory. The only one I know of as of now is https://github.com/postgrespro/rusmorph And it's not an example of a well-documented extension, unfortu- nately. Hoewever, it works. It's possible that you can find some more examples on pgxn.org Also, probably you would need to compile it with USE_PGXS=1 make with_llvm=no While the USE_PGXS=1 is a standard way to compile extension out of the postgres source tree, the with_llvm=no is a workaround of some bug in the llvm-7, that doesn't allow JIT compilation of C++ code.