Thus spake Tom Lane
> darcy@druid.net (D'Arcy J.M. Cain) writes:
> > char cardnum[48];
> > ...
> > newval = CStringGetDatum(cardnum);
>
> And you are trying to assign this datum to what kind of column?
> (Hint: there isn't any kind for which a plain C string is valid data.)
Right. That was just my latest try. I did notice that CStringGetDatum was
just defined as PointerGetDatum. I tried to find something specific for
text but nothing seemed to fit the bill. I saw DatumGetTextP but that
detoasts a toasted object. There were the various PG_RETURNxxx macros
but this is a user created strting, not an argument.
Do I have to manually create a varlena? I'll try that next.
--
D'Arcy J.M. Cain <darcy@{druid|vex}.net> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.