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

From Tom Lane
Subject Re: patch adding new regexp functions
Date
Msg-id 26219.1174541573@sss.pgh.pa.us
Whole thread Raw
In response to Re: patch adding new regexp functions  (Jeremy Drake <pgsql@jdrake.com>)
Responses Re: patch adding new regexp functions  (Jeremy Drake <pgsql@jdrake.com>)
List pgsql-patches
Jeremy Drake <pgsql@jdrake.com> writes:
> I could not find such a thing using ctags, nor TextPGetDatum().  I looked
> at PG_RETURN_TEXT_P and it just uses PG_RETURN_POINTER, which in turn uses
> PointerGetDatum.  If there is such a thing, it is well camoflaged...

AFAIR, the reason there's no TextPGetDatum (and ditto for lots of other
datatypes) is lack of obvious usefulness.  A function dealing with a
"text *" doesn't normally have reason to convert that to a Datum until
it returns --- and at that point PG_RETURN_TEXT_P is the thing to use.
Do you have a counterexample, or does this just suggest that the regexp
function patch needs some refactoring?

            regards, tom lane

pgsql-patches by date:

Previous
From: Jeremy Drake
Date:
Subject: Re: patch adding new regexp functions
Next
From: ITAGAKI Takahiro
Date:
Subject: LIKE optimization in UTF-8 and locale-C