<p dir="ltr">Would it be possible to delete the contents of the to tsvector column before exporting and rebuild after import? </p>
<p dir="ltr">Sent from my mobile </p>
<div class="gmail_quote">On Jan 30, 2014 11:06 AM, "Scott Pezanowski" <<a href="mailto:scottpez@hotmail.com">scottpez@hotmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div dir="ltr">Sandro,<div><br><div><div>Thank you for your advice and I apologize for the lengthy delay in my reply. Based on your advice, I seem to have narrowed the problem to one record the restore script hits and its tsvector value (perhaps there are other records that may fail after this, but the restore fails to get past this one). Below is the error I am getting when using <a href="http://postgis_restore.pl" target="_blank">postgis_restore.pl</a>.</div>
<div><br></div><div><br></div><div> Reading list of functions to ignore...</div><div> Writing manifest of things to read from dump file...</div><div> Writing ASCII to stdout...</div><div>ERROR: syntax error in tsvector: "'2012':5 'call':8 'elect':17 'gagnam':12 'hurrican':14 'koni':7 'mayb':10 'olymp':11 'presidenti':16 'rt':1 'sandi':15 'stop':6 'style':13 'summari':3 'wt"</div>
<div>CONTEXT: COPY twitter_datatable_2012_12, line 46295160, column textsearchable_index_col_with_stop: "'2012':5 'call':8 'elect':17 'gagnam':12 'hurrican':14 'koni':7 'mayb':10 'olymp':11 'presidenti':16..."</div>
<div><br></div><div>The actual complete tsvector text is shown below.</div><div><br></div><div>"'2012':5 'call':8 'elect':17 'gagnam':12 'hurrican':14 'koni':7 'mayb':10 'olymp':11 'presidenti':16 'rt':1 'sandi':15 'stop':6 'style':13 'summari':3 'wtffact':2"</div>
<div><br></div><div>Therefore, there is more text in the tsvector field, which seems to be being truncated. I do not see anything out of the ordinary with any characters near where the truncation occurs, that would cause this - Unless it is perhaps actually failing somewhere other than at the 'wt part. Do you think there may be a need for some sort of escape of certain characters like the apostrophe? Or perhaps a length imposed on the text?</div>
<div><br></div><div>I am not quite sure what the problem with the data could be. If I simply insert the full actual value into the tsvector column, it inserts fine. So I think it seems like the text being truncated for some reason causes the "syntax error".</div>
<div><br></div><div>Based upon this, can you see what the problem may be or do you have any other suggestions on things I can look at to try to diagnose the problem?</div><div><br></div><div>Thanks again,</div><div>Scott</div>
<br><br><div>> Date: Tue, 7 Jan 2014 18:04:39 +0100<br>> From: <a href="mailto:strk@keybit.net" target="_blank">strk@keybit.net</a><br>> To: <a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
> Subject: Re: [postgis-users] hard upgrade of database fails because of tsvector syntax error<br>> <br>> On Mon, Jan 06, 2014 at 09:03:05PM -0500, Scott Pezanowski wrote:<br>> <br>> > When I do a straight pg_restore of the dump file into a PostGIS database without using the <a href="http://postgis_restore.pl" target="_blank">postgis_restore.pl</a> script, the database restores fine. Is there any chance I could do this and have the latest version of PostGIS 2 work on it as-is? Or could I perhaps load the legacy.sql file and then do this?<br>
> > Is there any way I could modify the <a href="http://postgis_restore.pl" target="_blank">postgis_restore.pl</a> script where it would accomplish what it needs to do with the PostGIS upgrade, but then use the pg_restore command instead of piping the results to psql?<br>
> > I also have the database dumped as a SQL file. Is there any way I can use this and achieve a solid restore to PostGIS 2?<br>> <br>> What you could do is send the output of "<a href="http://postgis_restore.pl" target="_blank">postgis_restore.pl</a>" to a file,<br>
> and compare it with the output of pg_restore to see where things get<br>> messed up. <br>> <br>> --strk;<br>> _______________________________________________<br>> postgis-users mailing list<br>> <a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></div></div></div> </div></div>
<br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div>