Re: [GENERAL] Restore from dump file: parse error

From: Herouth Maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il>
To: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] Restore from dump file: parse error
Date: 1999-05-10 08:33:10
Message-ID: l03130303b35c491b521d@[147.233.159.109]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

At 10:37 +0300 on 10/05/1999, darold wrote:

> Hi,
>
> Well to quote that single quote, you have to quote that single quote :-)
> ex : s_field='suivre l'actualite'
> => s_field='suivre l''actualite'
>
> pg_dump -D mydatabase > recover.sql or other options will never solve
> this pg_dump feature.
>
> You can make a little program with perl to process your entire file by
> search single quote not after an = and not before a , and space and ) and (.
>
> Regards,
>
> Gilles Darold

Just a minute. I tried dumping and restoring fields with and without single
quotes in them in 6.4.2, and there was no problem, and I didn't need to
change anything. Single quotes should not be a problem for COPY, because
they are not considered delimiters. The strings are not surrounded with
quotes. Thus, the strings you see in the COPY commands are the actual
strings that you have in the database, except for newlines and tabs that
have a backslash before them.

So, the question is what went wrong with the dump. Has it dumped correctly,
that is, with a single, unescaped quote where a single quote is in the
fields? In that case, the 6.3.2 psql is the culprit, and since your issue
is with upgrading to 6.4.2, you need not worry.

If, on the other hand, the dump makes the copy with single quotes doubled
or backslashed, you will have to use some sed or perl script to remove
that, because they will not be interpreted correctly. This is the 6.3.2
dump's fault.

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma

In response to

Browse pgsql-general by date

  From Date Subject
Next Message J M Doren 1999-05-10 12:05:02 SQl Mail LIst (Spanish)
Previous Message Herouth Maoz 1999-05-10 08:24:24 Re: [GENERAL] PostGreSQL and LiveWire??