gethostbyaddr() or equivalent?

Поиск
Список
Период
Сортировка
От Jeff Boes
Тема gethostbyaddr() or equivalent?
Дата
Msg-id all2qe$2led$1@news.hub.org
обсуждение исходный текст
Ответы Re: gethostbyaddr() or equivalent?
Список pgsql-general
I have a table which contains IP addresses (written as a log by
applications which may or may not be local to the box hosting the
database):

log_time  | timestamp
ip_addr   | text

I would like to display the ip_addr column as a symbolic hostname (all
the IP addresses are local and well-known).  My initial attempt was to
write a simple PLPerl function:

CREATE FUNCTION fn_ip2name(text) returns text as '
use Socket;
return scalar gethostbyaddr(inet_aton($_[0]),AF_INET)
' language 'plperl';

However, this fails:

ERROR:  creation of function failed:
require trapped by operation mask at (eval 2) line 2.

Any suggestions?

--
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-general по дате отправления:

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: statement triggers
Следующее
От: Daryl Beattie
Дата:
Сообщение: Re: [JDBC] Selecting Varchar range (through JDBC).