Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-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

pgsql-hackers by date

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

pgsql-patches by date

Next:From: Tom LaneDate: 2007-03-21 13:45:48
Subject: Re: patch adding new regexp functions
Previous:From: Gregory StarkDate: 2007-03-21 12:34:12
Subject: Re: patch adding new regexp functions

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group