Re: Converting a plperlu function to a plpgsql function

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Converting a plperlu function to a plpgsql function
Дата
Msg-id 12272.1090528445@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Converting a plperlu function to a plpgsql function  (Jeff Eckermann <jeff_eckermann@yahoo.com>)
Список pgsql-sql
Jeff Eckermann <jeff_eckermann@yahoo.com> writes:
>> Second line:
>> 
>> if ($r=~/^-([0-9]?)([A-z_]+)/)
>> {
>>      my $locid = $1;
>>      my $table = $2;

> PostgreSQL doesn't offer capturing parentheses.

Hm?  See the substring function:

regression=# select substring('foobar' from 'o(.)a');substring
-----------b
(1 row)

You'd have to use it twice to collect two separate substrings, which is
mildly annoying, but it's hard to see how to do better without bizarre
behind-the-scenes stuff (like Perl's magic $n variables).
        regards, tom lane


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

Предыдущее
От: Devin Whalen
Дата:
Сообщение: Re: Converting a plperlu function to a plpgsql function
Следующее
От: "Chris Cox"
Дата:
Сообщение: Re: LIKE on index not working