Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZGRy4-0004dy-PT for pgsql-hackers@arkaria.postgresql.org; Sat, 18 Jul 2015 13:15:52 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZGRy3-0001mJ-F6 for pgsql-hackers@arkaria.postgresql.org; Sat, 18 Jul 2015 13:15:51 +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) (envelope-from ) id 1ZGRy1-0001mA-JW for pgsql-hackers@postgresql.org; Sat, 18 Jul 2015 13:15:49 +0000 Received: from smtp-auth.no-ip.com ([8.23.224.61] helo=out.smtp-auth.no-ip.com) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZGRxr-00022o-JE for pgsql-hackers@postgresql.org; Sat, 18 Jul 2015 13:15:47 +0000 X-No-IP: alvh.no-ip.org@noip-smtp X-Report-Spam-To: abuse@no-ip.com Received: from alvin.alvh.no-ip.org (unknown [85.114.2.253]) (Authenticated sender: alvh.no-ip.org@noip-smtp) by smtp-auth.no-ip.com (Postfix) with ESMTPA id 79156400AE9; Sat, 18 Jul 2015 06:15:32 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 600E2C92; Sat, 18 Jul 2015 17:15:28 +0400 (SAMT) Date: Sat, 18 Jul 2015 16:15:28 +0300 From: Alvaro Herrera To: Heikki Linnakangas Cc: Michael Paquier , Kevin Grittner , "pgsql-hackers@postgresql.org" Subject: Re: [COMMITTERS] pgsql: Retain comments on indexes and constraints at ALTER TABLE ... TY Message-ID: <20150718131528.GV2301@postgresql.org> References: <81620362.883169.1437142581761.JavaMail.yahoo@mail.yahoo.com> <55A94C2D.1010204@iki.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <55A94C2D.1010204@iki.fi> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -2.6 (--) 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 Heikki Linnakangas wrote: > On 07/17/2015 05:40 PM, Michael Paquier wrote: > >On Fri, Jul 17, 2015 at 11:16 PM, Kevin Grittner wrote: > >>Heikki Linnakangas wrote: > >> > >>>This fixes bug #13126, reported by Kirill Simonov. > >> > >>It looks like you missed something with the addition of > >>AT_ReAddComment: > >> > >>test_ddl_deparse.c:80:11: warning: enumeration value 'AT_ReAddComment' not handled in switch [-Wswitch] > >> switch (subcmd->subtype) > >> ^ > > > >Oops. If someone could pick up the attached (backpatch to 9.5 needed)... > > Hmm, that function is pretty fragile, it will segfault on any AT_* type that > it doesn't recognize. Thankfully you get that compiler warning, but we have > added AT_* type codes before in minor releases. Yeah, that module was put together in a bit of a rush when I decided to remove the JSON deparsing part of the DDL patch. > I couldn't quite figure out what the purpose of that module is, as > there is no documentation or README or file-header comments on it. Well, since it's in src/test/modules I thought it was clear that the intention is just to be able to test the pg_ddl_command type -- obviously not. I will add a README or something. > If it's there just to so you can run the regression tests that come > with it, it might make sense to just add a "default" case to that > switch to handle any unrecognized commands, and perhaps even remove > the cases for the currently untested subcommands as it's just dead > code. Well, I would prefer to have an output that says "unrecognized" and then add more test cases to the SQL files so that there's not so much dead code. I prefer that to removing the C support code, because then as we add extra tests we don't need to modify the C source. > If it's supposed to act like a sample that you can copy-paste and > modify, then perhaps that would still be the best option, and add a > comment there explaining that it only cares about the most common > subtypes but you can add handlers for others if necessary. I wasn't thinking in having it be useful for copy-paste. My longer-term plan is to have the JSON deparsing extension live in src/extensions. -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers