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