String functions like split() and join() in plpgsql

Поиск
Список
Период
Сортировка
От David U.
Тема String functions like split() and join() in plpgsql
Дата
Msg-id 004201c2bb74$bcbf0170$26b9fc80@pravda
обсуждение исходный текст
Ответы Re: String functions like split() and join() in plpgsql  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hi,

I'm writing a trigger to change the third field in a varchar record. (it's
an SOA field from DNS) and I can do it in plperl but since it needs to be a
trigger I have to do it in plpgsql (or other right?).

In perl it's as simple as:
// assuming $soa = 'ns1.domain.com hostmaster.domain.com 104249825 10800
3600 604000 86400';
@x =  split(/ /, $soa); $x[2] = time(); join(' ', @x);

Any ideas on how I can create a trigger to change the third field to now()?

Can I use perl as a trigger?

Thanks in advance,
davidu

--
"Never doubt that a small group of thoughtful citizens can change the
world. Indeed, it is the only thing that ever has." --Margaret Mead




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

Предыдущее
От: Justin Clift
Дата:
Сообщение: Re: PostgreSQL on Windows
Следующее
От: Tom Lane
Дата:
Сообщение: Re: String functions like split() and join() in plpgsql