Re: Converting integer to binary

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Stephen Quinney <stephen(dot)quinney(at)computing-services(dot)oxford(dot)ac(dot)uk>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Converting integer to binary
Date: 2004-06-10 18:27:56
Message-ID: 20040610182756.GA22247@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Thu, Jun 10, 2004 at 14:52:41 +0100,
Stephen Quinney <stephen(dot)quinney(at)computing-services(dot)oxford(dot)ac(dot)uk> wrote:
>
> I have searched around but I cannot see any standard way in PostgreSQL
> to convert from an integer into a binary representation.
>
> 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.

There doesn't seem to currently be a function that does this. to_char
would be the logical place since that is what is used to convert various
numeric types to strings with a decimal representation.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Chris Gamache 2004-06-10 20:24:15 Re: Converting integer to binary
Previous Message Franco Bruno Borghesi 2004-06-10 15:45:45 Re: query optimization