From: Stephen Quinney <stephen.quinney@computing-services.oxford.ac.uk>
To: Chris Gamache <cgg007@yahoo.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Converting integer to binary
Date: Fri, 11 Jun 2004 08:54:02 +0100
Message-ID: <20040611075402.GA4887@computing-services.oxford.ac.uk> (raw)
In-Reply-To: <20040610222731.GA26006@wolff.to>
References: <20040610182756.GA22247@wolff.to>
<20040610202415.89117.qmail@web13804.mail.yahoo.com>
<20040610222731.GA26006@wolff.to>
On Thu, Jun 10, 2004 at 05:27:31PM -0500, Bruno Wolff III wrote:
> On Thu, Jun 10, 2004 at 13:24:15 -0700,
> Chris Gamache <cgg007@yahoo.com> 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)
That would probably work for me in this case as I am interfacing to
postgresql via the Perl DBI layer. With perl reading out that field
would give me a string representation.
Thanks for the tips,
Stephen Quinney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: stephen.quinney@computing-services.oxford.ac.uk, cgg007@yahoo.com
Subject: Re: Converting integer to binary
In-Reply-To: <20040611075402.GA4887@computing-services.oxford.ac.uk>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox