TEXT::CIDR/INET::CIDR output confusion

From: "Alexander M(dot) Pravking" <fduch(at)antar(dot)bryansk(dot)ru>
To: pgsql-sql(at)postgresql(dot)org
Subject: TEXT::CIDR/INET::CIDR output confusion
Date: 2004-11-12 21:31:58
Message-ID: 20041112213158.GF12640@dyatel.antar.bryansk.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

It looks a bit strange that CIDR output depends on datatype it has been
casted from:

fduch=# SELECT '1.1.1.1'::cidr;
cidr
------------
1.1.1.1/32
(1 row)

fduch=# SELECT '1.1.1.1'::inet::cidr;
cidr
---------
1.1.1.1
(1 row)

However these two seem to be 'equal' in terms of backend:

fduch=# SELECT '1.1.1.1'::inet::cidr = '1.1.1.1'::inet;
?column?
----------
t
(1 row)

fduch=# SELECT '1.1.1.1'::inet::cidr = '1.1.1.1'::cidr;
?column?
----------
t
(1 row)

I'm just curious how can it even be...

fduch=# SELECT version();
version
------------------------------------------------------------------------------------------------
PostgreSQL 7.4.5 on i386-portbld-freebsd5.3, compiled by GCC cc (GCC) 3.4.2 [FreeBSD] 20040728

--
Fduch M. Pravking

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Kenneth Gonsalves 2004-11-13 06:48:17 anounce
Previous Message Markus Schaber 2004-11-12 09:57:19 Re: Unicode problem inserting records - Invalid UNICODE