Re: "reverse()" on strings

Поиск
Список
Период
Сортировка
От Jeff Boes
Тема Re: "reverse()" on strings
Дата
Msg-id ake4lb$20ed$1@news.hub.org
обсуждение исходный текст
Ответ на "reverse()" on strings  (h012@ied.com)
Ответы Re: "reverse()" on strings  (Josh Berkus <josh@agliodbs.com>)
Список pgsql-sql
On Mon, 26 Aug 2002 16:13:44 -0400, h012 wrote:


>  CREATE INDEX extension_idx ON file (reverse(name));
> -- but I didn't find a function called "reverse"
> 
>  CREATE INDEX extension_idx ON file (regex_match( '.*(\.[^\.]*)$' );
> -- but I didn't find a function called "regex_match" which would return
> string matched in brackets ()
> 

You probably want to do a

$ createlang plperl

and then something like this:

CREATE FUNCTION fn_strrev(text) returns text as '
return reverse($_[0])
' language 'plperl' with (iscachable);

The same approach can be used to provide a regex match with Perl syntax,
but I don't have an example of that coded up and at hand.


-- 
Jeff Boes                                      vox 269.226.9550 ext 24
Database Engineer                                     fax 269.349.9076
Nexcerpt, Inc.                                 http://www.nexcerpt.com          ...Nexcerpt... Extend your Expertise


В списке pgsql-sql по дате отправления:

Предыдущее
От: h012@ied.com
Дата:
Сообщение: "reverse()" on strings
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: "reverse()" on strings