From ccbac076f90e79532dad7d9dadbb3c732cec89a7 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Tue, 22 Jan 2013 20:09:31 +0100 Subject: [PATCH] added README with description --- README | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 README diff --git a/README b/README new file mode 100644 index 0000000..1267670 --- /dev/null +++ b/README @@ -0,0 +1,17 @@ +PostgreSQL - try to load SQL dump, parse errors and modify varchar to text for next re-try of dump load + +Sometimes when you try to load SQL dump from PostgreSQL you get errors like: + +ERROR: value too long for type character varying(50) +CONTEXT: COPY casopis, line 24713, column vrsta_rada: "...something too long..." + +in that case, you have to modify database dump (which is usually compressed) +while loading it into database. This is exactly what pgsql-fix-value-too-long.pl +does together with parsing of error messages to figure out which varchar +columns are too short and converting them to text columns on the fly. + +It's usually used by import-pgsql-dump.sh which will create file +log with all errors and then filter "value too long" ones to errors +file and run pgsql-fix-value-too-long.pl using this file. It will also +restart import if there are more errors, so it will probably run +import multiple times. -- 2.20.1