Sanitize newlines in object names in "pg_restore -l" output.
Sanitize newlines in object names in "pg_restore -l" output.

Commits 89e0bac86 et al replaced newlines with spaces in object names
printed in SQL comments, but we neglected to consider that the same
names are also printed by "pg_restore -l", and a newline would render
the output unparseable by "pg_restore -L".  Apply the same replacement
in "-l" output.  Since "pg_restore -L" doesn't actually examine any
object names, only the dump ID field that starts each line, this is
enough to fix things for its purposes.

The previous fix was treated as a security issue, and we might have
done that here as well, except that the issue was reported publicly
to start with.  Anyway it's hard to see how this could be exploited
for SQL injection; "pg_restore -L" doesn't do much with the file
except parse it for leading integers.

Per bug #14587 from Milos Urbanek.  Back-patch to all supported versions.

Discussion: d3f0adc0b78346713b2d6651f93f997af64d71bf@wrigleys.postgresql.org

xinzweb/gpdb,50wu/gpdb,adam8157/gpdb,xinzweb/gpdb,adam8157/gpdb,adam8157/gpdb,lisakowen/gpdb,xinzweb/gpdb,greenplum-db/gpdb,lisakowen/gpdb,lisakowen/gpdb,lisakowen/gpdb,50wu/gpdb,50wu/gpdb,greenplum-db/gpdb,xinzweb/gpdb,adam8157/gpdb,greenplum-db/gpdb,adam8157/gpdb,greenplum-db/gpdb,xinzweb/gpdb,adam8157/gpdb,xinzweb/gpdb,adam8157/gpdb,50wu/gpdb,50wu/gpdb,greenplum-db/gpdb,xinzweb/gpdb,greenplum-db/gpdb,50wu/gpdb,50wu/gpdb,lisakowen/gpdb,greenplum-db/gpdb,50wu/gpdb,greenplum-db/gpdb,lisakowen/gpdb,xinzweb/gpdb,lisakowen/gpdb,adam8157/gpdb,lisakowen/gpdb