0
votes

I am having a table in Hsql DB which now I am migrating to Postgres. For this I export a CSV (using SQLSquirrel) from Hsql and import into Postgres using the COPY..FROM postgres command.
I have an attribute of Type VARBINARY in the hsql table (lets call it "attr1"), which in Postgres table becomes Type bytea.

Suppose one row has the value of attr1 as \x00 in the hsqldb. The exported CSV contains the value as 00. But after importing it into Postgres it gets converted to \x3030 (when viewed in hex format). For importing CSV into Postgres I use the command as :
\COPY <tablename> FROM 'Data.csv' DELIMITER ',' CSV HEADER;

What am I missing ? How can I solve this ?

1

1 Answers

0
votes

Use the same program to export from HSQLDB and import into PostgreSQL.

The HSQLDB SqlTool can be used for this purpose.