Re: get date in binary number format - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: get date in binary number format
Date
Msg-id Pine.LNX.4.44.0209261145360.9690-100000@alvh.no-ip.org
Whole thread Raw
In response to get date in binary number format  ("Johnson, Shaunn" <SJohnson6@bcbsm.com>)
List pgsql-general
Johnson, Shaunn dijo:

> Howdy:
>
> Silly question time -
>
> Is there a way to get the date and change
> it into a binary number?

Well, you can get the day of the year in binary:

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


> The algorithm to select backup number would be the
> smallest non-zero place in binary representation of
> the backup number (tape).

Recursive definition?  Sorry, I don't understand the algorithm.

--
Alvaro Herrera (<alvherre[a]atentus.com>)
"Ni aun el genio muy grande llegaria muy lejos
si tuviera que sacarlo todo de su propio interior" (Goethe)


pgsql-general by date:

Previous
From: Greg Copeland
Date:
Subject: Re: [HACKERS] Performance while loading data and indexing
Next
From: "mourad_dhambri"
Date:
Subject: dblink