From: Dobrica Pavlinusic Date: Tue, 22 Jan 2013 19:09:31 +0000 (+0100) Subject: added README with description X-Git-Url: http://git.rot13.org/?p=pgsql-fix-value-too-long;a=commitdiff_plain added README with description --- 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.