Re: type cast about int to bit

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: type cast about int to bit
Date: 2012-02-06 11:05:15
Message-ID: jgoc5b$l1j$6@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

does the mailing list mangle these, or is it just GMANE?

On 2012-02-06, zoulx1982 <zoulx1982(at)163(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Adrian Klaver 2012-02-07 01:19:11 Re: type cast about int to bit
Previous Message Achilleas Mantzios 2012-02-06 08:42:43 Re: array dimensions, pg_catalog.pg_attribute and the \d command