Skip site navigation (1) Skip section navigation (2)

Re: BIN()

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 (view raw or flat)
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


In response to

pgsql-hackers by date

Next:From: Robert TreatDate: 2005-11-30 03:58:34
Subject: Re: [pgsql-advocacy] Please let us know if you will come to the PostgreSQL Anniversary
Previous:From: Tom LaneDate: 2005-11-30 03:35:32
Subject: Re: BIN()

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group