Re: [BUGS] Nasty tsvector can make dumps unrestorable - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: [BUGS] Nasty tsvector can make dumps unrestorable
Date
Msg-id 47352B2E.7020507@dunslane.net
Whole thread Raw
In response to Re: [BUGS] Nasty tsvector can make dumps unrestorable  (Bruce Momjian <bruce@momjian.us>)
Responses Re: [BUGS] Nasty tsvector can make dumps unrestorable  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers

Bruce Momjian wrote:
> However, I am still unclear if the dump code is correct because I don't
> see the backslash preserved in \\'' cases, just \\\\ cases:
>
>     test=> CREATE TABLE Foo(bar tsvector);
>     CREATE
>     test=> INSERT INTO Foo(bar) VALUES (E'\\''x');
>     INSERT 0 1
>     test=> select * from foo;
>       bar
>     -------
>      '''x'
>     (1 row)
>
> and pg_dump outputs:
>
>     COPY foo (bar) FROM stdin;
>     '''x'
>     \.
>
>
> While the COPY will load into the table, this doesn't:
>
>     test=> INSERT INTO Foo(bar) VALUES (E'''''x');
>     ERROR:  syntax error in tsvector: "''x"
>
> I am confused.
>
>   


These two are not equivalent. What happens if you try this?
  INSERT INTO Foo(bar) VALUES (E'''''''x''');


cheers

andrew




pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [BUGS] Nasty tsvector can make dumps unrestorable
Next
From: Bruce Momjian
Date:
Subject: Re: [BUGS] Nasty tsvector can make dumps unrestorable