Re: inet type and network()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Daniel J(dot) Kressin" <dkressin(at)globalcrossing(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: inet type and network()
Date: 2001-03-15 04:20:30
Message-ID: 12640.984630030@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Daniel J. Kressin" <dkressin(at)globalcrossing(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Aristide Aragon 2001-03-15 05:46:51 Gupta
Previous Message Daniel J. Kressin 2001-03-15 03:03:29 inet type and network()