From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Alvaro Herrera <alvherre(at)atentus(dot)com> |
Cc: | "Johnson, Shaunn" <SJohnson6(at)bcbsm(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: get date in binary number format |
Date: | 2002-09-27 04:41:19 |
Message-ID: | 21155.1033101679@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Alvaro Herrera <alvherre(at)atentus(dot)com> writes:
> Tom Lane dijo:
>> 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;
Oh, of course, I keep forgetting that now that cstring is a first-class
type, all things are possible via abutted I/O function calls ;-)
You could simplify that as
select varcharin(bit_out("bit"(1)), 0, -1);
But either way you must admit that the above is an ugly hack not proper
support.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Martijn van Oosterhout | 2002-09-27 05:02:42 | Re: Quick Pg/PLSQL question |
Previous Message | Alvaro Herrera | 2002-09-27 04:34:11 | Re: get date in binary number format |