Re: function that resolves IP addresses

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Bruno Wolff III <bruno(at)wolff(dot)to>
Cc: Marcel Gsteiger <Marcel(dot)Gsteiger(at)milprog(dot)ch>, pgsql-general(at)postgresql(dot)org
Subject: Re: function that resolves IP addresses
Date: 2005-10-29 19:10:19
Message-ID: 4363C91B.3040508@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Bruno Wolff III wrote:

>On Wed, Oct 19, 2005 at 14:36:46 +0200,
> Marcel Gsteiger <Marcel(dot)Gsteiger(at)milprog(dot)ch> wrote:
>
>
>>Hi all
>>
>>Does anybody know how I could create a database function that accepts
>>an INET parameter and reverse-lookups the hostname via DNS PTR lookup?
>>Something like the dnsname command line utility in the djbdns package. I
>>need this function for analyzing firewall logs stored in the database
>>with ulogd.
>>
>>Any idea would much be appreciated.
>>
>>
You could do this easily with plPerlU or plPythonU. However you probably
don't want to do this
as a per entry basis due to the reasons listed below. Run it as a batch
process.

>
>Note that dns lookups can be slow and that might cause some issues for you
>if it leaves resources needed for other queries locked while the function
>waits for a response.
>
>---------------------------(end of broadcast)---------------------------
>TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match
>
>

--
The PostgreSQL Company - Command Prompt, Inc. 1.503.667.4564
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Managed Services, Shared and Dedicated Hosting
Co-Authors: plPHP, plPerlNG - http://www.commandprompt.com/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Matthew Peter 2005-10-29 19:22:21 Re: dynamic table naming in function
Previous Message Tom Lane 2005-10-29 18:16:26 Re: dynamic table naming in function