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: (view raw, whole thread or download thread mbox)
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');
>>>(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'?


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-2017 The PostgreSQL Global Development Group