Re: about type cast

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: zoulx1982 <zoulx1982(at)163(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: about type cast
Date: 2012-02-06 17:08:01
Message-ID: 20437.1328548081@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> 2012/2/6 zoulx1982 <zoulx1982(at)163(dot)com>:
>> my question is why int can cast to bit , but bot for bit varying?

> Off the top of my head, I'm guessing that it's just a case of nobody
> having implemented it.

I have some vague recollection that we didn't want to be squishy about
the length of the resulting bitstring. When you cast to bit you're more
or less forced to specify what you want, since the spec-mandated default
length is only 1. varbit would leave us having to make a decision in
the code.

Anyway, try searching the pgsql-hackers archives if you want some
history.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2012-02-06 17:18:19 Re: [GENERAL] pg_dump -s dumps data?!
Previous Message Robert Haas 2012-02-06 16:57:30 Re: about type cast