about type cast

From: zoulx1982 <zoulx1982(at)163(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: about type cast
Date: 2012-02-06 05:53:11
Message-ID: 799126a4.12eee.13551391cf1.Coremail.zoulx1982@163.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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 , but bot for bit varying?
i want to know the reason.
thank you for your timing.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2012-02-06 07:51:34 Re: 16-bit page checksums for 9.2
Previous Message Robert Haas 2012-02-06 05:15:09 Re: double writes using "double-write buffer" approach [WIP]