Converting integer to binary - Mailing list pgsql-sql

From Stephen Quinney
Subject Converting integer to binary
Date
Msg-id 20040610135240.GD27245@computing-services.oxford.ac.uk
Whole thread Raw
Responses Re: Converting integer to binary  (Bruno Wolff III <bruno@wolff.to>)
List 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



pgsql-sql by date:

Previous
From: Martin Schäfer
Date:
Subject: Re: Find out whether a view's column is indexed?
Next
From: Tom Lane
Date:
Subject: Re: Schema + User-Defined Data Type Indexing problems...