about type cast - Mailing list pgsql-hackers

From zoulx1982
Subject about type cast
Date
Msg-id 799126a4.12eee.13551391cf1.Coremail.zoulx1982@163.com
Whole thread Raw
Responses Re: about type cast  (Robert Haas <robertmhaas@gmail.com>)
List 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.


pgsql-hackers by date:

Previous
From: Shigeru Hanada
Date:
Subject: Re: pgsql_fdw, FDW for PostgreSQL server
Next
From: Simon Riggs
Date:
Subject: Re: 16-bit page checksums for 9.2