Error passing script from a Firebird database table to PostgreSQL

0

I'm trying to pass a script to create and insert data from a Firebird database to PostgreSQL, however in some tables syntax error is occurring, I'm using the SQL Manager Interbase & Firebird to generate the * .sql files from my Firebird database tables. I have already tried via CMD to send the files to the bank through the following command:

psql -h host -p 5432 -U postgres -d database -f (* .sql file location)

but the following error returns me:

psql:C:/Backup/Script/CONTROLEIMPRESSOES.sql:573: ERROR: column "DATA" is of type date but expression is of type integer LINHA 6: (163, 6, 2007-02-01, 29138, 31432, 2294, 160.58, 31388, 33...)

DICA: You will need to rewrite or cast the expression

SoIwentthroughpgAdminandtheonlywaytoinsertitintothedatabasewastoputthedatebetween"2007-02-01" .

My question is, how can I generate a * .sql file where the dates already come in parentheses, so I do not need to change row by row by adding "" on each date.

    
asked by anonymous 07.12.2016 / 16:51

1 answer

1

If you have the same structure in both banks and are migrating from one to the other, you may be using the FullCopyConvert tool which is paid but I think the trial version can help.

If it is a process to be executed few times you can use a regular text editor with regular expression support and add quotes on the dates so you would not have to do it manually on each line. You can use Notepad ++ and use the replace option as in the image below:

    
07.12.2016 / 19:13