Re: patch adding new regexp functions - Mailing list pgsql-patches

From Gregory Stark
Subject Re: patch adding new regexp functions
Date
Msg-id 87k5xahi91.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: patch adding new regexp functions  (Gregory Stark <stark@enterprisedb.com>)
Responses Re: patch adding new regexp functions
List pgsql-patches
"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

pgsql-patches by date:

Previous
From: Gregory Stark
Date:
Subject: Re: patch adding new regexp functions
Next
From: Tom Lane
Date:
Subject: Re: patch adding new regexp functions