Tom Lane dijo:
> Alvaro Herrera <alvherre@atentus.com> writes:
> > Is there a way to cast these bitstrings into varchars or something? I
> > can't find any.
>
> regression=# select ("bit"((date_part('doy', now()))::integer))::text;
> ERROR: Cannot cast type bit to text
Well, there is:
testing=> select varcharin(bit_out(bitv), 0, length(bitv)+4 ) FROM
(select "bit"(1) AS bitv) as t;
varcharin
----------------------------------
00000000000000000000000000000001
(1 row)
So going back to Shaunn's question, it's rather confusing to set
everything up (you'll have to use cut'n pasting from this message and my
previous followup), BUT it doesn't work in previous releases (only in
7.3beta). Maybe you can adapt it, but it's not clear to me that the
casting from bit to varchar is possible in 7.2.
--
Alvaro Herrera (<alvherre[a]atentus.com>)
"La realidad se compone de muchos sueños, todos ellos diferentes,
pero en cierto aspecto, parecidos..." (Yo, hablando de sueños eróticos)