Re: get date in binary number format

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Johnson, Shaunn" <SJohnson6(at)bcbsm(dot)com>
Cc: "'Alvaro Herrera'" <alvherre(at)atentus(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: get date in binary number format
Date: 2002-09-27 02:52:17
Message-ID: 20271.1033095137@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Johnson, Shaunn" <SJohnson6(at)bcbsm(dot)com> writes:
> I get this when I try the following select:

> testdb=> select "bit"((date_part('doy', now()))::integer);
> ERROR: Function 'bit(int4)' does not exist

In CVS tip I get

regression=# select "bit"((date_part('doy', now()))::integer);
bit
----------------------------------
00000000000000000000000100001101
(1 row)

but I think the int4-to-bit(32) conversion function was added for 7.3.
There also seems to be an int8-to-bit(64) function now:

regression=# select "bit"((date_part('doy', now()))::int8);
bit
------------------------------------------------------------------
0000000000000000000000000000000000000000000000000000000100001101
(1 row)

IIRC, Tom Lockhart put in both of those a couple months ago.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-09-27 03:07:44 Re: [HACKERS] Performance while loading data and indexing
Previous Message Tom Lane 2002-09-27 02:44:33 Re: Unixtime (epoch) into timestamp?