Re: Urgent help in bit_string data type

Поиск
Список
Период
Сортировка
От Joe
Тема Re: Urgent help in bit_string data type
Дата
Msg-id 1176327841.782.2.camel@pampa
обсуждение исходный текст
Ответ на Urgent help in bit_string data type  (Karthikeyan Sundaram <skarthi98@hotmail.com>)
Список pgsql-sql
Hi skarthi,

On Wed, 2007-04-11 at 13:30 -0700, Karthikeyan Sundaram wrote:
>         insert into test_a values (to_char(1,'9'));
>
>         ERROR:  column "b" is of type bit but expression is of type
>         text
>         HINT:  You will need to rewrite or cast the expression.

As suggested by the error, you should use a cast, e.g.,

    insert into test_a values 9::bit(3);

This will result in binary '001' being inserted because you need 4 bits
to represent decimal 9.

Joe


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

Предыдущее
От: Karthikeyan Sundaram
Дата:
Сообщение: Urgent help in bit_string data type
Следующее
От: Karthikeyan Sundaram
Дата:
Сообщение: Re: [ADMIN] Urgent help in bit_string data type