I'm trying to restore a database from a text file. I'm following the answer on this question. How do I restore a plain text postgres .backup file
psql.exe -U sde sde < c:\backup\sde_04_06_2018.backup > c:\backup\result.txt
This seem to work but doesn't write the errors.
You get messages like this on the text file:
REVOKE GRANT SET ALTER DEFAULT PRIVILEGES ALTER DEFAULT PRIVILEGES
But on the command windows you see error like this:
ERROR: constraint "sde_layer_stats_version_id_fkey" for relation sde_layer_stats" already exists ERROR: constraint "xml_columns_fk1" for relation "sde_xml_columns" already exists ERROR: constraint "xml_columns_fk2" for relation "sde_xml_columns" already exists ERROR: constraint "xml_indextags_fk1" for relation "sde_xml_index_tags" already exists
The idea is save the error on the text file so I can review and decide if are something I need to handle.