Re: patch adding new regexp functions

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Jeremy Drake" <pgsql(at)jdrake(dot)com>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Neil Conway" <neilc(at)samurai(dot)com>, "Peter Eisentraut" <peter_e(at)gmx(dot)net>, "David Fetter" <david(at)fetter(dot)org>, "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "PostgreSQL Patches" <pgsql-patches(at)postgresql(dot)org>, "Mark Dilger" <pgsql(at)markdilger(dot)com>
Subject: Re: patch adding new regexp functions
Date: 2007-03-21 12:51:38
Message-ID: 87k5xahi91.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


"Gregory Stark" <stark(at)enterprisedb(dot)com> writes:

> "Jeremy Drake" <pgsql(at)jdrake(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2007-03-21 12:58:31 Re: Question about the TODO, numerics, and division
Previous Message Gregory Stark 2007-03-21 12:34:12 Re: patch adding new regexp functions

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2007-03-21 13:45:48 Re: patch adding new regexp functions
Previous Message Gregory Stark 2007-03-21 12:34:12 Re: patch adding new regexp functions