From: | Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Michael Fuhr <mike(at)fuhr(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: BIN() |
Date: | 2005-11-30 03:40:20 |
Message-ID: | 438D1F24.5070407@familyhealth.com.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Tom Lane wrote:
> Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au> writes:
>
>>>test=> SELECT ltrim(textin(bit_out(12::bit(64))), '0');
>>>ltrim
>>>-------
>>>1100
>>>(1 row)
>
>
>>Sweeeeet. Good old i/o functions.
>
>
> Who needs the I/O functions? Just cast int to bit(n).
Then how do you remove all leading zeros, and make sure you choose a
high enough 'n'?
Chris
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Treat | 2005-11-30 03:58:34 | Re: [pgsql-advocacy] Please let us know if you will come to the PostgreSQL Anniversary |
Previous Message | Tom Lane | 2005-11-30 03:35:32 | Re: BIN() |