Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fowlg-0002NJ-Sy for pgsql-general@arkaria.postgresql.org; Sun, 12 Aug 2018 20:15:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fowlc-00025h-Fi for pgsql-general@arkaria.postgresql.org; Sun, 12 Aug 2018 20:15:12 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fowlc-00025K-4C for pgsql-general@lists.postgresql.org; Sun, 12 Aug 2018 20:15:12 +0000 Received: from n3.nabble.com ([162.255.23.22]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fowlV-00011c-7a for pgsql-general@postgresql.org; Sun, 12 Aug 2018 20:15:10 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 382E8E851874 for ; Sun, 12 Aug 2018 13:15:04 -0700 (MST) Date: Sun, 12 Aug 2018 13:15:04 -0700 (MST) From: TalGloz To: pgsql-general@postgresql.org Message-ID: <1534104904227-0.post@n3.nabble.com> In-Reply-To: <1607.1534101134@sss.pgh.pa.us> References: <1534093538827-0.post@n3.nabble.com> <1534097342417-0.post@n3.nabble.com> <31921.1534098408@sss.pgh.pa.us> <1534099202325-0.post@n3.nabble.com> <1607.1534101134@sss.pgh.pa.us> Subject: Re: PostgreSQL C Language Extension with C++ Code MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Let me see if I understood you correctly. I cant have a code like this: extern "C" { int sum_of_numbers(){ std::vector numbers {23, 445, 64}; int sum = 0; for (auto &item : numbers){ sum += item; } return sum; } } And I have to declare my function with inside the Datum sum_of_numbers(PG_FUNCTION_ARGS){ // function code here } Sorry for the log mails. I'm having problems to understand, how to change the construction of myfunc.cpp to run the code. -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html