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

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Any functions to convert bit(5) to text?
Дата
Msg-id 20050210070031.GA59628@winnie.fuhr.org
обсуждение исходный текст
Ответ на Any functions to convert bit(5) to text?  (Együd Csaba <csegyud@vnet.hu>)
Ответы Re: Any functions to convert bit(5) to text?  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-general
On Thu, Feb 10, 2005 at 07:32:35AM +0100, Együd Csaba wrote:
>
> In case of arrays I can use array_to_string(), but I couldn't find any
> functions to convert bit(*) to string (in a format like this: e.g. '10011').

I don't know if this will always work, but with current implementations
of PL/pgSQL you can do this:

CREATE FUNCTION bit2text(bit) RETURNS text AS '
BEGIN
    RETURN $1;
END;
' LANGUAGE plpgsql IMMUTABLE STRICT;

See also CREATE CAST.

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

В списке pgsql-general по дате отправления:

Предыдущее
От: Együd Csaba
Дата:
Сообщение: Any functions to convert bit(5) to text?
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: Any functions to convert bit(5) to text?