Re: casting from integer to boolean

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: casting from integer to boolean
Дата
Msg-id 20080327074031.GA5519@svana.org
обсуждение исходный текст
Ответ на Re: casting from integer to boolean  (Seb <spluque@gmail.com>)
Ответы Re: casting from integer to boolean  ("Richard Broersma" <richard.broersma@gmail.com>)
Список pgsql-general
On Wed, Mar 26, 2008 at 05:28:18PM -0500, Seb wrote:
> > INSERT INTO my_table (var_bool) VALUES ( CAST( 0 AS BOOLEAN )); or
> > INSERT INTO my_table (var_bool) VALUES (0::BOOLEAN);
>
> Thanks Richard.  Is there a way to do it without changing the INSERT
> command?  As I mentioned, there are many more columns of different
> types, so finding and replacing the VALUES would be very difficult.

Don't think anyone mentioned it, but if you could get it to output
quotes around the value, like:

INSERT INTO my_table (var_bool) VALUES ('0');

It will also work.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

Вложения

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

Предыдущее
От: Guillaume Lelarge
Дата:
Сообщение: Re: Survey: renaming/removing script binaries (createdb, createuser...)
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: psql /usr/lib/libgcc dependency in pg 8.3