X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id DFCC1D1B18A for ; Thu, 10 Jun 2004 19:21:43 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 76340-06 for ; Thu, 10 Jun 2004 22:21:40 +0000 (GMT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 043E5D1B17C for ; Thu, 10 Jun 2004 19:21:36 -0300 (ADT) Received: (qmail 26162 invoked by uid 500); 10 Jun 2004 22:27:31 -0000 Date: Thu, 10 Jun 2004 17:27:31 -0500 From: Bruno Wolff III To: Chris Gamache Cc: Stephen Quinney , pgsql-sql@postgresql.org Subject: Re: Converting integer to binary Message-ID: <20040610222731.GA26006@wolff.to> Mail-Followup-To: Chris Gamache , Stephen Quinney , pgsql-sql@postgresql.org References: <20040610182756.GA22247@wolff.to> <20040610202415.89117.qmail@web13804.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040610202415.89117.qmail@web13804.mail.yahoo.com> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.1 tagged_above=0.0 required=5.0 tests=MAILTO_TO_SPAM_ADDR X-Spam-Level: * X-Archive-Number: 200406/93 X-Sequence-Number: 18038 On Thu, Jun 10, 2004 at 13:24:15 -0700, Chris Gamache wrote: Following up on the cast to bit idea, he could do something like casting to bit(32). I don't think there is an easy way to get this cast to string, so it may not completely solve his problem, depending on what he was going to do with the binary representation. On teh other hand, for some things a bit field might be more useful than a string. area=> select 6::bit(32); bit ---------------------------------- 00000000000000000000000000000110 (1 row)