Re: Segfault when restoring -Fd dump on current HEAD

Dmitry Dolgov <9erthalion6@gmail.com>

From: Dmitry Dolgov <9erthalion6@gmail.com>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Michael Paquier <michael@paquier.xyz>, Justin Pryzby <pryzby@telsasoft.com>, Hubert Lubaczewski <depesz@depesz.com>, pgsql-hackers mailing list <pgsql-hackers@postgresql.org>
Date: 2019-02-27T09:36:22Z
Lists: pgsql-hackers
> On Tue, Feb 26, 2019 at 11:53 PM Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
>
> On 2019-Feb-26, Dmitry Dolgov wrote:
>
> > Yes, it should be rather simple, we can e.g. return to the old less consistent
> > NULL handling approach something (like in the attached patch), or replace a NULL
> > value with an empty string in WriteToc. Give me a moment, I'll check it out. At
> > the same time I would suggest to keep replace_line_endings -> sanitize_line,
> > since it doesn't break compatibility.
>
> Hmm, shouldn't we modify sanitize_line so that it returns strdup(hyphen)
> when input is empty and want_hyphen, too?

Yes, you're right.

> I think it would be better to just put back the .defn = "" (etc) to the
> ArchiveEntry calls.

Then we should do this not only for defn, but for owner and dropStmt too. I can
update the fix patch I've sent before, if it's preferrable approach in this
particular situation. But I hope there are no objections if I'll then submit
the original changes with more consistent null handling separately to make
decision about them more consciously.


Commits

  1. pg_dump: store unused attribs as NULL instead of '\0'

  2. pg_dump: Fix ArchiveEntry handling of some empty values