Re: [HACKERS] WITH clause in CREATE STATISTICS - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] WITH clause in CREATE STATISTICS
Date
Msg-id 19390.1494626080@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] WITH clause in CREATE STATISTICS  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: [HACKERS] WITH clause in CREATE STATISTICS  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> Tom Lane wrote:
>> Oh, I see your patch also fixes missing code in getObjectDescription().
>> We need that.  Is there a decent way to get the compiler to warn about
>> that oversight?

> We could remove the default clause.  That results in the expected
> warning, and no others (i.e. the switch was already complete):

> /pgsql/source/master/src/backend/catalog/objectaddress.c:2657:2: warning: enumeration value 'OCLASS_STATISTIC_EXT'
nothandled in switch [-Wswitch] 

Hm.  That would behave less than desirably if getObjectClass() could
return a value that wasn't a member of the enum, but it's hard to
credit that happening.  I guess I'd vote for removing the default:
case from all of the places that have "switch (getObjectClass(object))",
as forgetting to add an entry seems like a much larger hazard.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [HACKERS] WITH clause in CREATE STATISTICS
Next
From: Alvaro Herrera
Date:
Subject: Re: [HACKERS] WITH clause in CREATE STATISTICS