Re: Any functions to convert bit(5) to text? - Mailing list pgsql-general

From Michael Fuhr
Subject Re: Any functions to convert bit(5) to text?
Date
Msg-id 20050210071653.GA59760@winnie.fuhr.org
Whole thread Raw
In response to Re: Any functions to convert bit(5) to text?  (Michael Fuhr <mike@fuhr.org>)
Responses Re: Any functions to convert bit(5) to text?  (Michael Fuhr <mike@fuhr.org>)
List 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/

pgsql-general by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Any functions to convert bit(5) to text?
Next
From: Michael Fuhr
Date:
Subject: Re: Any functions to convert bit(5) to text?