Thread: Nasty tsvector can make dumps unrestorable

Nasty tsvector can make dumps unrestorable

From
Stuart Bishop
Date:
To continue our streak of bad luck, here is the second tsearch2 bug we found
this week.

The attached script creates a tsvector with a value that can be dumped using
pg_dump, but not loaded again using pg_restore. This causes restores of a
dump containing this value to fail.

This script only tested with PG 8.2.5 under Ubuntu Feisty so far, although
we found the original problem under 8.2.4 on Ubuntu Dapper.

Also reported in the Ubuntu bug tracker at:

https://bugs.launchpad.net/ubuntu/+source/postgresql-8.2/+bug/146382


--
Stuart Bishop <stuart@stuartbishop.net>
http://www.stuartbishop.net/
\i /usr/share/postgresql/8.2/contrib/tsearch2.sql

CREATE TABLE Foo(bar tsvector);

INSERT INTO Foo(bar) VALUES ('''0'':58A ''1'':92A,127A ''2'':5A ''e'':146A,151A ''n'':148A ''r'':147A ''10'':51A
''12'':50A''45'':52A ''ad'':149A ''id'':32A ''ip'':86A ''nt'':68A ''200'':57A ''5.0'':69A ''5.5'':66A ''bug'':6A,12A
''e.g'':145A''get'':54A ''one'':11A,17A ''ran'':9A ''tri'':95A ''use'':119A,138A ''255c'':61A ''8303'':38A,94A,133A
''blob'':35A,130A''give'':106A ''hint'':137A ''hole'':75A ''line'':104A,126A ''msie'':65A ''null'':93A ''psql'':102A
''tool'':105A''valu'':37A,132A ''warn'':116A,117A,167A ''zope'':4A,45A,81A ''+0200'':53A ''along'':111A
''error'':26A,28A,109A,163A''escap'':121A,140A,144A ''extra'':115A ''found'':40A,135A ''liter'':125A ''secur'':78A
''start'':154A''anonym'':48A ''compat'':64A ''execut'':97A ''follow'':42A,114A ''import'':7A ''insert'':20A,29A
''is/was'':84A''logfil'':46A ''messag'':36A,110A,131A ''ncould'':71A ''postgr'':14A ''result'':158A ''server'':90A
''string'':124A,141A,157A''syntax'':27A,142A,162A ''window'':67A ''address'':87A ''command'':103A ''content'':33A,128A
''generat'':22A''sequenc'':34A,129A ''t312461'':70A ''webserv'':82A ''without'':165A ''/scripts'':60A ''complain'':15A
''http/1.1'':56A''sqlobject'':24A ''statement'':21A,99A ''02/may/2002'':49A ''mozilla/4.0'':63A ''nonstandard'':118A
''213.46.5.117'':59A,83A''messagechunk'':31A ''/p_/zopebutton'':55A ''programmingerror'':25A ''nystrom.no-ip.org'':91A
''np3ee224f1.dip.t-dialin.net'':47A''255cwinnt/system32/cmd.exe?/c+dir+c:\\\\'':62A'); 


Attachment

Re: Nasty tsvector can make dumps unrestorable

From
Tom Lane
Date:
Stuart Bishop <stuart@stuartbishop.net> writes:
> The attached script creates a tsvector with a value that can be dumped using
> pg_dump, but not loaded again using pg_restore. This causes restores of a
> dump containing this value to fail.

Hmm, sorta looks like tsvectorout should be doubling backslashes?

            regards, tom lane