Re: Passing CopyMultiInsertInfo structure to CopyMultiInsertInfoNextFreeSlot()

From: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>, Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
Subject: Re: Passing CopyMultiInsertInfo structure to CopyMultiInsertInfoNextFreeSlot()
Date: 2019-05-14 01:19:30
Message-ID: CAKJS1f9V9k1bd2P2pOqus7PxEUf0Jvh-9ZWeHBtyjOyzY+a31A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 14 May 2019 at 13:00, Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Mon, May 13, 2019 at 08:17:49PM +0530, Ashutosh Sharma wrote:
> > Thanks for the confirmation David. The patch looks good to me.
>
> It looks to me that it can be a matter a consistency with the other
> APIs dealing with multi-inserts in COPY. For now I have added an open
> item on that.

When I wrote the code I admit that I was probably wearing my
object-orientated programming hat. I had in mind that the whole
function series would have made a good class. Passing the
CopyMultiInsertInfo was sort of the non-OOP equivalent to having
this/Me/self available, as it would be for any instance method of a
class. Back to reality, this isn't OOP, so I was wearing the wrong
hat. I think the unused parameter should likely be removed. It's
probably not doing a great deal of harm since the function is static
inline and the compiler should be producing any code for the unused
param, but for the sake of preventing confusion, it should be removed.
Ashutosh had to ask about it, so it wasn't immediately clear what the
purpose of it was. Since there's none, be gone with it, I say.

--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2019-05-14 01:49:50 ldapbindpasswdfile
Previous Message Michael Paquier 2019-05-14 01:06:05 Re: pg12 release notes