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 1fuHBt-00085T-Er for pgsql-general@arkaria.postgresql.org; Mon, 27 Aug 2018 13:04:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fuHBr-0000WH-Bi for pgsql-general@arkaria.postgresql.org; Mon, 27 Aug 2018 13:04:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fuHBr-0000WA-3g for pgsql-general@lists.postgresql.org; Mon, 27 Aug 2018 13:04:19 +0000 Received: from n3.nabble.com ([162.255.23.22]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fuHBo-00030j-5b for pgsql-general@postgresql.org; Mon, 27 Aug 2018 13:04:18 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 6D3C4EC50271 for ; Mon, 27 Aug 2018 06:04:14 -0700 (MST) Date: Mon, 27 Aug 2018 06:04:14 -0700 (MST) From: TalGloz To: pgsql-general@postgresql.org Message-ID: <1535375054445-0.post@n3.nabble.com> In-Reply-To: References: <1535201678396-0.post@n3.nabble.com> <4192.1535211864@sss.pgh.pa.us> <1535212627744-0.post@n3.nabble.com> <15017.1535214682@sss.pgh.pa.us> <1535371344785-0.post@n3.nabble.com> <1535373637716-0.post@n3.nabble.com> Subject: Re: Returning Vector of Pairs with a PostgreSQL C Extension Function 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 Pavel Stehule wrote > There are already prepared macros > > #define CStringGetTextDatum(s) PointerGetDatum(cstring_to_text(s)) > #define TextDatumGetCString(d) text_to_cstring((text *) > DatumGetPointer(d)) Thanks for pointing out the macros, for some reason I've missed them. Best regards, Tal -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html