Re: casting from integer to boolean

Поиск
Список
Период
Сортировка
От Richard Broersma
Тема Re: casting from integer to boolean
Дата
Msg-id 396486430803261546v501d2cb5p1a5c756c786c511a@mail.gmail.com
обсуждение исходный текст
Ответ на Re: casting from integer to boolean  (Seb <spluque@gmail.com>)
Список pgsql-general
On Wed, Mar 26, 2008 at 3:28 PM, Seb <spluque@gmail.com> wrote:
On Wed, 26 Mar 2008 15:11:47 -0700,
"Richard Broersma" <richard.broersma@gmail.com> 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.
 
My understanding is that a temporary staging table could be used to receive all of your data into postgresql.  Next, you can perform most of your data scrubbing within postgres with simple update statements.
Last, you and insert to the cleaned data with an insert+select statement with the appropriate casts.  this way you only need to do the casting in a single statement.
 

--
Regards,
Richard Broersma Jr.

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

Предыдущее
От: Sam Mason
Дата:
Сообщение: Re: casting from integer to boolean
Следующее
От: Seb
Дата:
Сообщение: Re: casting from integer to boolean