Re: Additional minor pg_dump cleanups

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Additional minor pg_dump cleanups
Date: 2024-07-04 12:49:53
Message-ID: CAEudQAo0PG7n7vttXQXm9-rP5vyMmHrQ+QJXz8GJjUMEGYdzVQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Em qui., 4 de jul. de 2024 às 05:18, Daniel Gustafsson <daniel(at)yesql(dot)se>
escreveu:

> > On 3 Jul 2024, at 13:29, Ranier Vilela <ranier(dot)vf(at)gmail(dot)com> wrote:
>
> > With the function *getPublications* I think it would be good to free up
> the allocated memory?
> >
> > }
> > + pg_free(pubinfo);
> > +cleanup:
> > PQclear(res);
>
> Since the pubinfo is recorded in the DumpableObject and is responsible for
> keeping track of which publications to dump, it would be quite incorrect to
> free it here.
>
> > With the function *getExtensions* I think it would be good to return
> NULL in case ntups = 0?
> > Otherwise we may end up with an uninitialized variable.
> >
> > - ExtensionInfo *extinfo;
> > + ExtensionInfo *extinfo = NULL;
>
> I guess that won't hurt, though any code inspecting extinfo when
> numExtensions
> is returned as zero is flat-out wrong. It may however silence a static
> analyzer so there is that.
>
> > Funny, the function *getExtensionMembership* does not use the parameter
> ExtensionInfo extinfo.
> > getExtensions does not have another caller, Is it really necessary?
>
> Yes, see processExtensionTables().
>
I saw, thanks.

LGTM.

best regards,
Ranier Vilela

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jelte Fennema-Nio 2024-07-04 13:31:49 Re: Make query cancellation keys longer
Previous Message Yao Wang 2024-07-04 12:45:33 Re: 回复: An implementation of multi-key sort