Re: Convert Datum* to char*

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Convert Datum* to char*
Дата
Msg-id CA+Tgmob_1yVBsFxO47yREdNYm4BrFtHizcb4xqShsL2YkN5KSw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Convert Datum* to char*  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Mon, Jan 6, 2014 at 11:34 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Masterprojekt Naumann1 <mpws2013n1@gmail.com> writes:
>> Nevertheless, slot->tts_nvalid is always 0. I hope that there is no other
>> problem.
>
> You should not be touching the tts_values/tts_isnull arrays without having
> first called slot_getsomeattrs or slot_getallattrs.
>
> See comments in src/include/executor/tuptable.h for some documentation.

Another problem is that TextDatumGetCString() is only the right thing
to do if the value is, in fact, of type text.  If you've got an
integer column, for example, TextDatumGetCString() is not your friend.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

Предыдущее
От: Florian Pflug
Дата:
Сообщение: Re: How to reproduce serialization failure for a read only transaction.
Следующее
От: AK
Дата:
Сообщение: Re: How to reproduce serialization failure for a read only transaction.