On Wed, Mar 26, 2008 at 3:28 PM, Seb <spluque@xxxxxxxxx> wrote:
On Wed, 26 Mar 2008 15:11:47 -0700,
"Richard Broersma" <richard.broersma@xxxxxxxxx> wrote:
[...]
Thanks Richard. Is there a way to do it without changing the INSERT
> INSERT INTO my_table (var_bool) VALUES ( CAST( 0 AS BOOLEAN )); or
> INSERT INTO my_table (var_bool) VALUES (0::BOOLEAN);
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.