Re: Bit string help, please

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Bit string help, please
Дата
Msg-id 47CFA7B7.9080902@archonet.com
обсуждение исходный текст
Ответ на Bit string help, please  (tyrrill_ed@emc.com)
Ответы Re: Bit string help, please
Список pgsql-sql
tyrrill_ed@emc.com wrote:
> 
> insert into table1 values( DEFAULT, B'1'::bit( n ) );
> 
> Where n is one of the parameters to the PL/pgSQL function, but that
> doesn't work.  PostgreSQL doesn't like having a variable for the bit
> string length.  Does anyone have any ideas how I could achieve this?

Try casting from a string:  SELECT ('1' || repeat('0', n-1))::bit varying;


--   Richard Huxton  Archonet Ltd


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

Предыдущее
От: "Yura Gal"
Дата:
Сообщение: RETURN QUERY generates error
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: RETURN QUERY generates error