Re: replicating DROP commands across servers

From: David Rowley <dgrowley(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, David Rowley <dgrowleyml(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, "Brightwell, Adam" <adam(dot)brightwell(at)crunchydatasolutions(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: replicating DROP commands across servers
Date: 2014-12-24 21:58:06
Message-ID: CAHoyFK9YmTDmqEU_pjJ4e-0=CZuY400mo9=xE4wACmrkVeA+hg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 25 December 2014 at 04:47, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> David Rowley <dgrowley(at)gmail(dot)com> writes:
> > On 25 December 2014 at 00:34, Andres Freund <andres(at)2ndquadrant(dot)com>
> wrote:
> >> I really wonder if we can't make msvc reliably recognize this kind of
> >> scenario - especially this case is pretty trivial?
>
> > The attached patch removes the warning, but likely can't be used in case
> > someone somewhere is doing elog(var++, "my error");
>
> Yeah, we're *not* doing that. There are definitely places where
> ereport/elog are used with nonconstant elevel.
>
>
Agreed. The patch was intended as a demo of where the problem is. Although
I don't see why non-const elevel matters. Non-stable expressions are what
actually matter.

> It's curious though that MSVC fails to notice that the variable never
> changes. I wonder whether we could get away with changing the elog
> macro to do
> const int elevel_ = (elevel);
> as ereport does, and whether it would help if so.
>
>
Unlikely, as the one that was just fixed above is an ereport.

I'll dig around a little more and see if there's some way to get MSVC to
optimise this somehow. The 1% reduction in the postgres.exe seems worth a
little bit of investigation time.

Regards

David Rowley

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-12-24 22:28:37 Re: hash_create API changes (was Re: speedup tidbitmap patch: hash BlockNumber)
Previous Message Jim Nasby 2014-12-24 19:58:41 Re: hash_create API changes (was Re: speedup tidbitmap patch: hash BlockNumber)