pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: zoulx1982 <zoulx1982@163.com>
To: pgsql-sql@postgresql.org
Subject: type cast about int to bit
Date: Mon, 6 Feb 2012 14:11:12 +0800 (CST)
Message-ID: <18656bf8.13415.13551499b55.Coremail.zoulx1982@163.com> (raw)

hi,
there is a problem about type cast that i don't understand, follow is my test.
 
postgres=# select 10::bit(3);
 bit
-----
 010
(1 row)
postgres=# select 10::bit varying(3);
ERROR:  cannot cast type integer to bit varying
LINE 1: select 10::bit varying(3);
                 ^
postgres=#
 
my question is why int can cast to bit , i want to know the reason.
thank you for your timing.



view thread (4+ messages)  latest in thread

Message-ID: <18656bf8.13415.13551499b55.Coremail.zoulx1982@163.com>
Permalink:  ../18656bf8.13415.13551499b55.Coremail.zoulx1982@163.com/
Also on:    postgresql.org/message-id/18656bf8.13415.13551499b55.Coremail.zoulx1982@163.com

 · 

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: zoulx1982@163.com
  Subject: Re: type cast about int to bit
  In-Reply-To: <18656bf8.13415.13551499b55.Coremail.zoulx1982@163.com>

* 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