Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d9IWN-00048R-U7 for pgsql-hackers@arkaria.postgresql.org; Fri, 12 May 2017 21:54:48 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d9IWN-0008Lk-AF for pgsql-hackers@arkaria.postgresql.org; Fri, 12 May 2017 21:54:47 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d9IWM-0008Kb-2b for pgsql-hackers@postgresql.org; Fri, 12 May 2017 21:54:46 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d9IWJ-0005Gd-DF for pgsql-hackers@postgresql.org; Fri, 12 May 2017 21:54:44 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v4CLsepZ019391; Fri, 12 May 2017 17:54:40 -0400 From: Tom Lane To: Alvaro Herrera cc: Simon Riggs , Andrew Dunstan , Tomas Vondra , PostgreSQL-development , Dean Rasheed Subject: Re: WITH clause in CREATE STATISTICS In-reply-to: <20170512214426.sdzcocysfv6ykjjr@alvherre.pgsql> References: <20170512214426.sdzcocysfv6ykjjr@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Fri, 12 May 2017 18:44:26 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19389.1494626080.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 12 May 2017 17:54:40 -0400 Message-ID: <19390.1494626080@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Alvaro Herrera 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' not handled 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 --=20 Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers