pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander M. Pravking <fduch@antar.bryansk.ru>
To: pgsql-sql@postgresql.org
Subject: TEXT::CIDR/INET::CIDR output confusion
Date: Sat, 13 Nov 2004 00:31:58 +0300
Message-ID: <20041112213158.GF12640@dyatel.antar.bryansk.ru> (raw)

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



view thread (3+ messages)  latest in thread

Message-ID: <20041112213158.GF12640@dyatel.antar.bryansk.ru>
Permalink:  ../20041112213158.GF12640@dyatel.antar.bryansk.ru/
Also on:    postgresql.org/message-id/20041112213158.GF12640@dyatel.antar.bryansk.ru

 · 

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: fduch@antar.bryansk.ru
  Subject: Re: TEXT::CIDR/INET::CIDR output confusion
  In-Reply-To: <20041112213158.GF12640@dyatel.antar.bryansk.ru>

* 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