From: Jasen Betts <jasen@xnet.co.nz>
To: pgsql-sql@postgresql.org
Subject: Re: type cast about int to bit
Date: 6 Feb 2012 11:05:15 GMT
Message-ID: <jgoc5b$l1j$6@reversiblemaps.ath.cx> (raw)
References: <18656bf8.13415.13551499b55.Coremail.zoulx1982@163.com>
does the mailing list mangle these, or is it just GMANE?
On 2012-02-06, zoulx1982 <zoulx1982@163.com> wrote:
>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.
possibly postgres doesn't know what size to make the result.
--
⚂⚃ 100% natural
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: jasen@xnet.co.nz
Subject: Re: type cast about int to bit
In-Reply-To: <jgoc5b$l1j$6@reversiblemaps.ath.cx>
* 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