Hi!
We have a Postgres DB, which we use for processing some data (few millions
rows). We thought about moving some part of the processing to H2 (because
that "internal" state is not critical, we are happy to store it in H2).
I've started playing around and my first difficulty is about transferring
data. My idea is that i copy the data from Postgres
(COPY (select * from table) TO 'outfile.csv' WITH FORMAT csv)'
I created the same table structure in H2, so i thought using the csv will
be plain and simple. What happened, though, is that my insert in H2 failed
because of the different number of columns. I double checked everything,
the table structure is OK.
It turned out that in my first few lines of the csv, the last column is
null (so, in the file, it is empty), meaning the H2 didn't read that column.
So this command failed:
INSERT INTO table select * from csvread('outfile');
But this one succceded:
INSERT INTO table select *,null from csvread('outfile');
Of course, i could change the select * to list all of the columns and make
sure the last one is the primary key (so never null), i hope there is a
better solution.
I wonder what problems i'll have when i have to transfer the data out. I
don't want to lose / mix up data, so i'm kinda worried.
Thanks,
Tony
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.