Re: Convert Datum* to char* - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Convert Datum* to char*
Date
Msg-id CA+Tgmob_1yVBsFxO47yREdNYm4BrFtHizcb4xqShsL2YkN5KSw@mail.gmail.com
Whole thread Raw
In response to Re: Convert Datum* to char*  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: Florian Pflug
Date:
Subject: Re: How to reproduce serialization failure for a read only transaction.
Next
From: AK
Date:
Subject: Re: How to reproduce serialization failure for a read only transaction.