Re: pg_restore silently chokes on object comments/descriptions ending in a backslash - Mailing list pgsql-bugs

From Tom Lane
Subject Re: pg_restore silently chokes on object comments/descriptions ending in a backslash
Date
Msg-id 23791.1311737234@sss.pgh.pa.us
Whole thread Raw
In response to pg_restore silently chokes on object comments/descriptions ending in a backslash  (Julian Mehnle <julian@mehnle.net>)
Responses Re: pg_restore silently chokes on object comments/descriptions ending in a backslash
List pgsql-bugs
Julian Mehnle <julian@mehnle.net> writes:
> If the comment/description of a database object (table, function, etc.)
> ends in a backslash (which generally works fine otherwise), then
> pg_restore is unable to completely restore a custom-format dump of the
> schema.

Reproduced here against HEAD.  The problem seems to be that
pg_backup_db.c's _sendSQLLine() contains a mini SQL lexer that is not
cognizant of standard_conforming_strings.  Not sure about a simple fix,
and I rather wonder if we shouldn't try to remove that code entirely
instead of "fix" it.

As a temporary workaround, the SQL text file that pg_restore produces
by default seems to be valid, so you could pipe that into psql.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Julian Mehnle
Date:
Subject: pg_restore silently chokes on object comments/descriptions ending in a backslash
Next
From: Julian Mehnle
Date:
Subject: Re: pg_restore silently chokes on object comments/descriptions ending in a backslash