pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marc G. Fournier <scrappy@postgresql.org>
To: pgsql-sql@postgresql.org
Subject: Way to reverse ordering of an IP ... ?
Date: Wed, 6 Sep 2006 00:51:00 -0300 (ADT)
Message-ID: <20060906004355.V13992@ganymede.hub.org> (raw)


for Reverse DNS purposes, I'd like to reverse an IP ...

ie: 200.46.204.1 would become 1.204.46.200

Is there an easy way of doing this *short* of writing a plpgsql function?

I've checked the docs, and found the substring() function that allows for 
using a regex, which I thought might allow this, but can't seem to figure 
out a proper format for it ;(

If I have to write a function to do it, fine ... just wanted to make sure 
I wasn't missing something first ...

----
Marc G. Fournier           Hub.Org Networking Services (http://www.hub.org)
Email . scrappy@hub.org                              MSN . scrappy@hub.org
Yahoo . yscrappy               Skype: hub.org        ICQ . 7615664



view thread (2+ messages)  latest in thread

Message-ID: <20060906004355.V13992@ganymede.hub.org>
Permalink:  ../20060906004355.V13992@ganymede.hub.org/
Also on:    postgresql.org/message-id/20060906004355.V13992@ganymede.hub.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: scrappy@postgresql.org
  Subject: Re: Way to reverse ordering of an IP ... ?
  In-Reply-To: <20060906004355.V13992@ganymede.hub.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox