The result of TextDatumGetCString is already palloc'ed.
Attach a file by drag & drop or click to upload