Re: Returning Vector of Pairs with a PostgreSQL C ExtensionFunction

Поиск
Список
Период
Сортировка
От TalGloz
Тема Re: Returning Vector of Pairs with a PostgreSQL C ExtensionFunction
Дата
Msg-id 1535371344785-0.post@n3.nabble.com
обсуждение исходный текст
Ответ на Re: Returning Vector of Pairs with a PostgreSQL C Extension Function  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Returning Vector of Pairs with a PostgreSQL C ExtensionFunction  (TalGloz <glozmantal@gmail.com>)
Список pgsql-general
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


В списке pgsql-general по дате отправления:

Предыдущее
От: Tim Clarke
Дата:
Сообщение: archive items not in correct section order
Следующее
От: TalGloz
Дата:
Сообщение: Re: Returning Vector of Pairs with a PostgreSQL C ExtensionFunction