Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group