pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Quinney <stephen.quinney@computing-services.oxford.ac.uk>
To: pgsql-sql@postgresql.org
Subject: Converting integer to binary
Date: Thu, 10 Jun 2004 14:52:41 +0100
Message-ID: <20040610135240.GD27245@computing-services.oxford.ac.uk> (raw)


I have searched around but I cannot see any standard way in PostgreSQL
to convert from an integer into a binary representation.

i.e. I want to do:

16 ==> 10000
32 ==> 100000
64 ==> 1000000
96 ==> 1100000

etc..

Now I have an algorithm to do it so I could write an SQL function, I
guess. If there's a standard way to do it though that would be quite nice.

Thanks in advance,

Stephen Quinney




view thread (5+ messages)  latest in thread

Message-ID: <20040610135240.GD27245@computing-services.oxford.ac.uk>
Permalink:  ../20040610135240.GD27245@computing-services.oxford.ac.uk/
Also on:    postgresql.org/message-id/20040610135240.GD27245@computing-services.oxford.ac.uk

 · 

reply

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
  Subject: Re: Converting integer to binary
  In-Reply-To: <20040610135240.GD27245@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