Thus spake Tom Lane
> darcy@druid.net (D'Arcy J.M. Cain) writes:
> > Do I have to manually create a varlena? I'll try that next.
>
> The best way to get from a C string to a valid datum is to invoke the
> datatype's input conversion routine. If you know you want text,
> you could do
>
> #define _textin(str) DirectFunctionCall1(textin, CStringGetDatum(str))
>
> to produce a datum from a C string.
Ah, that was it. I had done a similar thing in another trigger with a
date type. I should have thought of that.
Hmm. Does this suggest more macros in fmgr.h or postgres.h?
--
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.