IP Address Validation

From: "Jasbinder Singh Bali" <jsbali(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: IP Address Validation
Date: 2007-05-10 04:22:37
Message-ID: a47902760705092122s27acbe81h449ffac1676089ec@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,
I need to check whether the input string is in ip address format or not in
one of my pl/pgsql functions.
What function should be used to accomplish this

I tried using
if inet(strInput)

However, it throws an exception if the input string is not in IP address
format.

I could have caught this exception but really don't know what type of
exception category would this exception come under..

Any kind of help would be highly appreciated.

Thanks,

Jas

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Wall 2007-05-10 04:30:44 Re: Replication for PG 8 recommendations
Previous Message Tom Lane 2007-05-10 04:06:06 Re: Views- Advantages and Disadvantages