Re: pg_restore silently chokes on object comments/descriptions ending in a backslash

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Julian Mehnle <julian(at)mehnle(dot)net>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: pg_restore silently chokes on object comments/descriptions ending in a backslash
Date: 2011-07-27 03:27:14
Message-ID: 23791.1311737234@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Julian Mehnle <julian(at)mehnle(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Julian Mehnle 2011-07-27 04:01:57 Re: pg_restore silently chokes on object comments/descriptions ending in a backslash
Previous Message Julian Mehnle 2011-07-27 00:42:18 pg_restore silently chokes on object comments/descriptions ending in a backslash