Re: Fast REVERSE() function? - Mailing list pgsql-hackers

From Chris Browne
Subject Re: Fast REVERSE() function?
Date
Msg-id 873aka4mro.fsf@dba2.int.libertyrms.com
Whole thread Raw
In response to Fast REVERSE() function?  (Chris Browne <cbbrowne@acm.org>)
List pgsql-hackers
depesz@depesz.com (hubert depesz lubaczewski) writes:
> On Mon, Sep 08, 2008 at 11:20:18AM -0400, Chris Browne wrote:
>> I've got a case where I need to reverse strings, and find that, oddly
>> enough, there isn't a C-based reverse() function.
>> A search turns up pl/pgsql and SQL implementations:
>
> just for completenes - there is also pl/perl and c versions freely
> available:
> http://www.depesz.com/index.php/2007/07/30/indexable-field-like-something/
> (pl/perl)
> http://blog.frosties.org/post/2007/08/28/Fonction-reverse-C-avec-PostgreSQL
> (c)

I hadn't thought about the Unicode issue (mentioned elsewhere in the
thread); that's a good reason why the method I mentioned *wouldn't* be
a good one!

I'm NOT interested in pl/perl as an option; building and deploying all
of Perl is a mighty expensive way to get *ONE* function (and I don't
think that fundamentally changes if it's 10 functions!).

In the long run, I'd be keen on there being a REVERSE function
available in pg_catalog, which is why I'm asking about the C version,
as that would be the way to put it into the "core."
-- 
"cbbrowne","@","linuxdatabases.info"
http://www3.sympatico.ca/cbbrowne/sap.html
DSK: STAN.K; ML EXIT -- FILE NOT FOUND


pgsql-hackers by date:

Previous
From: "David Rowley"
Date:
Subject: Re: [PATCHES] TODO item: Implement Boyer-Moore searching (First time hacker)
Next
From: Tom Lane
Date:
Subject: A few thoughts on the plan inval extension patch