Re: Pluggable Storage - Andres's take

From: Amit Khandekar <amitdkhan(dot)pg(at)gmail(dot)com>
To: Dmitry Dolgov <9erthalion6(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Peter Geoghegan <pg(at)bowt(dot)ie>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Pluggable Storage - Andres's take
Date: 2019-01-15 09:07:36
Message-ID: CAJ3gD9e7V68EWgoKLzS0EaxadjMZT0a3NqMnt+Kz1iXHkzVALA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, 12 Jan 2019 at 18:11, Dmitry Dolgov <9erthalion6(at)gmail(dot)com> wrote:
> > On Sat, Jan 12, 2019 at 1:44 AM Andres Freund <andres(at)anarazel(dot)de> wrote:
> > > /* other fields were zeroed above */
> > >
> > > @@ -9355,7 +9370,7 @@ dumpComment(Archive *fout, const char *type, const char *name,
> > > * post-data.
> > > */
> > > ArchiveEntry(fout, nilCatalogId, createDumpId(),
> > > - tag->data, namespace, NULL, owner,
> > > + tag->data, namespace, NULL, owner, NULL,
> > > "COMMENT", SECTION_NONE,
> > > query->data, "", NULL,
> > > &(dumpId), 1,
> >
> > We really ought to move the arguments to a struct, so we don't generate
> > quite as much useless diffs whenever we do a change around one of
> > these...
>
> That's what I thought too. Maybe then I'll suggest a mini-patch to the master to
> refactor these arguments out into a separate struct, so we can leverage it here.

Then for each of the calls, we would need to declare that structure
variable (with = {0}) and assign required fields in that structure
before passing it to ArchiveEntry(). But a major reason of
ArchiveEntry() is to avoid doing this and instead conveniently pass
those fields as parameters. This will cause unnecessary more lines of
code. I think better way is to have an ArchiveEntry() function with
limited number of parameters, and have an ArchiveEntryEx() with those
extra parameters which are not needed in usual cases. E.g. we can have
tablespace, tableam, dumpFn and dumpArg as those extra arguments of
ArchiveEntryEx(), because most of the places these are passed as NULL.
All future arguments would go in ArchiveEntryEx().
Comments ?

--
Thanks,
-Amit Khandekar
EnterpriseDB Corporation
The Postgres Database Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2019-01-15 09:47:25 regress tests fails
Previous Message Haribabu Kommi 2019-01-15 08:55:35 Re: current_logfiles not following group access and instead follows log_file_mode permissions