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.)
regards, tom lane