Converting integer to binary

From: Stephen Quinney <stephen(dot)quinney(at)computing-services(dot)oxford(dot)ac(dot)uk>
To: pgsql-sql(at)postgresql(dot)org
Subject: Converting integer to binary
Date: 2004-06-10 13:52:41
Message-ID: 20040610135240.GD27245@computing-services.oxford.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Karsten Hilbert 2004-06-10 14:06:27 Re: Find out whether a view's column is indexed?
Previous Message Martin Schäfer 2004-06-10 13:48:33 Re: Find out whether a view's column is indexed?