Re: inet type and network() - Mailing list pgsql-general

From Tom Lane
Subject Re: inet type and network()
Date
Msg-id 12640.984630030@sss.pgh.pa.us
Whole thread Raw
In response to inet type and network()  ("Daniel J. Kressin" <dkressin@globalcrossing.com>)
List pgsql-general
"Daniel J. Kressin" <dkressin@globalcrossing.com> writes:
> The .0s get dropped.  Is there a way to force it to leave the .0s
> attached?

In 7.1 the default display of inet values is the way you want it.

In 7.0 I think you have to use brute force:

play=> select host('192.168.1.0/22'::inet) || '/' || masklen('192.168.1.0/22'::inet);
    ?column?
----------------
 192.168.1.0/22
(1 row)

            regards, tom lane

pgsql-general by date:

Previous
From: "Daniel J. Kressin"
Date:
Subject: inet type and network()
Next
From: Aristide Aragon
Date:
Subject: Gupta