Re: pgsql: Remove useless default clause in switch

2018-04-23 Thread David Rowley
On 24 April 2018 at 13:50, Alvaro Herrera wrote: > David Rowley wrote: >> On 24 April 2018 at 03:12, Alvaro Herrera wrote: >> > Remove useless default clause in switch >> > >> > The switch covers all values of the enum driver variable, so having a >> > default: clause is useless, even if it's onl

Re: pgsql: Remove useless default clause in switch

2018-04-23 Thread Alvaro Herrera
David Rowley wrote: > On 24 April 2018 at 03:12, Alvaro Herrera wrote: > > Remove useless default clause in switch > > > > The switch covers all values of the enum driver variable, so having a > > default: clause is useless, even if it's only to do Assert(false). > > Just for my own understanding

Re: pgsql: Remove useless default clause in switch

2018-04-23 Thread Amit Langote
On 2018/04/24 10:20, Michael Paquier wrote: > On Tue, Apr 24, 2018 at 12:27:27PM +1200, David Rowley wrote: >> I always thought that when all options were covered that we generally >> kept a default just in case someone added another enum and forgot to >> update the code. >> >> I know generally tho

Re: pgsql: Remove useless default clause in switch

2018-04-23 Thread Michael Paquier
On Tue, Apr 24, 2018 at 12:27:27PM +1200, David Rowley wrote: > I always thought that when all options were covered that we generally > kept a default just in case someone added another enum and forgot to > update the code. > > I know generally those are with elog ERRORs but both would be designed

Re: pgsql: Remove useless default clause in switch

2018-04-23 Thread Andrew Gierth
> "David" == David Rowley writes: David> I always thought that when all options were covered that we David> generally kept a default just in case someone added another enum David> and forgot to update the code. That's what compiler warnings (-Wswitch, included in -Wall) are for; it's actu

Re: pgsql: Remove useless default clause in switch

2018-04-23 Thread Tom Lane
David Rowley writes: > On 24 April 2018 at 03:12, Alvaro Herrera wrote: >> Remove useless default clause in switch > I always thought that when all options were covered that we generally > kept a default just in case someone added another enum and forgot to > update the code. Actually, there's

Re: pgsql: Remove useless default clause in switch

2018-04-23 Thread David Rowley
On 24 April 2018 at 03:12, Alvaro Herrera wrote: > Remove useless default clause in switch > > The switch covers all values of the enum driver variable, so having a > default: clause is useless, even if it's only to do Assert(false). Just for my own understanding: I always thought that when all

pgsql: Remove useless default clause in switch

2018-04-23 Thread Alvaro Herrera
Remove useless default clause in switch The switch covers all values of the enum driver variable, so having a default: clause is useless, even if it's only to do Assert(false). Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/dfce1f9e4eef3adcccbb23670fa1c432eebb0b90