"Gregory Stark" <stark@enterprisedb.com> writes:
> "Jeremy Drake" <pgsql@jdrake.com> writes:
>
>> BTW, should I be calling get_typlenbyvalalign on TEXTOID or are there macros
>> for those also?
>
> Hardcoding -1 for typlen of varlenas is one of the few (the only?) magic
> constants used throughout the source code. I'm surprised there isn't a macro
> for it though.
>
> Do you need the alignment? If so I want to check the code against the packed
> varlena patch. Just in case.
Ah, it's just to construct an array, that's not a concern at all. And you're
detoasting the text data types before using or storing them so that's fine.
The only thing I would say is that this should maybe be a TextGetDatum() just
for code hygiene. It should be exactly equivalent though:
+ PointerGetDatum(matchctx->orig_str),
--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com