Re: BRIN indexes - TRAP: BadArgument - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: BRIN indexes - TRAP: BadArgument
Date
Msg-id 20141108032714.GX1791@alvin.alvh.no-ip.org
Whole thread Raw
In response to Re: BRIN indexes - TRAP: BadArgument  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> David Rowley <dgrowleyml@gmail.com> writes:
> > I'm having problems getting this to compile on MSVC. Attached is a patch
> > which fixes the problem.
> 
> The committed code is completely broken on compilers that don't accept
> varargs macros, and this patch will not make them happier.

I tried to make it fire only on GCC, which is known to support variadic
macros, but I evidently failed.

> Probably what needs to happen is to put extra parentheses into the call
> sites, along the lines of
> 
>        #ifdef BRIN_DEBUG
>        #define BRIN_elog(args) elog args
>        #else
>        #define BRIN_elog(args) ((void) 0)
>        #endif
> 
> 
>        BRIN_elog((LOG, "fmt", ...));

That works for me, thanks for the suggestion.

> Or we could decide we don't need this debugging crud anymore and just
> nuke it all.

I'm removing one which seems pointless, but keeping the others for now.
We can always remove them later.  (I also left BRIN_DEBUG turned on by
default; I'm turning it off.)

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [PATCH] HINT: pg_hba.conf changed since last config reload
Next
From: Tom Lane
Date:
Subject: Re: row_to_json bug with index only scans: empty keys!