Re: Any functions to convert bit(5) to text?

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Együd Csaba <csegyud(at)vnet(dot)hu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Any functions to convert bit(5) to text?
Date: 2005-02-10 07:16:53
Message-ID: 20050210071653.GA59760@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Feb 10, 2005 at 12:00:31AM -0700, Michael Fuhr wrote:
>
> CREATE FUNCTION bit2text(bit) RETURNS text AS '
> BEGIN
> RETURN $1;
> END;
> ' LANGUAGE plpgsql IMMUTABLE STRICT;

This also appears to work:

CREATE TABLE foo (b varbit);
INSERT INTO foo VALUES ('10011');
SELECT textin(bit_out(b)) FROM foo;

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2005-02-10 07:31:57 Re: Any functions to convert bit(5) to text?
Previous Message Michael Fuhr 2005-02-10 07:00:31 Re: Any functions to convert bit(5) to text?