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 1fuGE3-0004zI-5f for pgsql-general@arkaria.postgresql.org; Mon, 27 Aug 2018 12:02:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fuGE1-0007Tw-N9 for pgsql-general@arkaria.postgresql.org; Mon, 27 Aug 2018 12:02:29 +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 1fuGE1-0007To-FE for pgsql-general@lists.postgresql.org; Mon, 27 Aug 2018 12:02:29 +0000 Received: from n3.nabble.com ([162.255.23.22]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fuGDy-0001da-Ks for pgsql-general@postgresql.org; Mon, 27 Aug 2018 12:02:29 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id C04F4EC4D839 for ; Mon, 27 Aug 2018 05:02:24 -0700 (MST) Date: Mon, 27 Aug 2018 05:02:24 -0700 (MST) From: TalGloz To: pgsql-general@postgresql.org Message-ID: <1535371344785-0.post@n3.nabble.com> In-Reply-To: <15017.1535214682@sss.pgh.pa.us> 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> 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 Hello, I'm having a small problem. The code works but the array cells don't hold the whole length of *localT1* and *localT2* texts, I think it has something to do with *int16 typlen* in my set parameters: ArrayType *array; Datum elements[2]; int16 typlen; bool typbyval; char typalign; elements[0] = CStringGetDatum(localT1.c_str()); elements[1] = CStringGetDatum(localT2.c_str()); get_typlenbyvalalign(TEXTOID, &typlen, &typbyval, &typalign); array = construct_array(elements, 2, TEXTOID, typlen, typbyval, typalign); I can't change the int16 to int32 or int64 because the get_typlenbyvalalign() function takes an int16. Is there a way to change my settings so that each input (in this example the *localT1* and *localT2*) fits fully in each sell? Best regards, Tal -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html