From: | Yves Weißig <weissig(at)rbg(dot)informatik(dot)tu-darmstadt(dot)de> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Best way to construct Datum out of a string? |
Date: | 2011-04-27 20:35:16 |
Message-ID: | 4DB87E04.3020004@rbg.informatik.tu-darmstadt.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Am 27.04.2011 16:11, schrieb Heikki Linnakangas:
> On 27.04.2011 17:06, Yves Weißig wrote:
>> Hi,
>>
>> sadly, so far my search in the source code wasn't very successfull on
>> this topic.
>> So, how can I construct a Datum out of a string?
>
> What kind of a Datum do you want it to be? What data type? See
> CStringGetDatum, or perhaps CStringGetTextDatum(). Or perhaps you want
> to call the input function of some other datatype, with InputFunctionCall.
>
Ok, but how do I do that?
Currently I am using:
_ebi_mtab_insert(rel, CStringGetTextDatum(BVEC_NULL), bin_enc);
This function does not mere than hashing the 2nd passed argument (with
the internal hash functions of hash.c) but each time a different hash
value is returned, so I am thinking I might pass a pointer and not the
real Datum. I am highly irritated now... as for now I thought I
understood Datum...
From | Date | Subject | |
---|---|---|---|
Next Message | Dave Page | 2011-04-27 20:35:38 | Re: make world fails |
Previous Message | Alvaro Herrera | 2011-04-27 20:31:22 | Re: pgsql: Fix pg_size_pretty() to avoid overflow for inputs close to INT64 |