Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZB2Rj-0006xH-BA for pgsql-bugs@arkaria.postgresql.org; Fri, 03 Jul 2015 15:00:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZB2Ri-0002XT-IC for pgsql-bugs@arkaria.postgresql.org; Fri, 03 Jul 2015 15:00:06 +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 1ZB2Rg-0002WH-Po for pgsql-bugs@postgresql.org; Fri, 03 Jul 2015 15:00:04 +0000 Received: from mail-wi0-f173.google.com ([209.85.212.173]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZB2Rd-0002pN-Nk for pgsql-bugs@postgresql.org; Fri, 03 Jul 2015 15:00:03 +0000 Received: by wibdq8 with SMTP id dq8so102604402wib.1 for ; Fri, 03 Jul 2015 07:59:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=i9hRWLOMh4u5oF3raNULGCNGxyea2Tk/JudDNoXoMUo=; b=cYjC9CUis++yGpjsOD512nfN9Ww0Xr78eYMdp1uXXeM+H2l4M3cqkzKKqKKu5YSbZj jKsLqKAhVe5TtKe2T00h0y5CzR+oibSN981Ql0Vp01uz8pkZ8WkKaWZIKQ7/Ck9U+33Q hpC/l7C0wvZa/Wad/kKY+d6P/jL/l+rOkz/SR1QE3NO/ukAXPIaayHtMjm0vu1oD1KUC vIpbd1EvS5SsydDzPfE7H4AQFz1zmfReX6AQDg9hBxA2+9349nvH5+EDf8NLd1/tTjsM QJZjWDetFQSf0hDhcMGqU5iupO95RZ6v7ABdDups8MeKzi5FyahzvumNH97ybCp1//a+ JMPA== X-Gm-Message-State: ALoCoQlqmIaWYvtXy6awb7Z7cNww1N8xUNpm7+Eie4alYHHMscnft02MYMoHTt9oykH9cZCDpjlr X-Received: by 10.194.94.101 with SMTP id db5mr67547534wjb.91.1435935599876; Fri, 03 Jul 2015 07:59:59 -0700 (PDT) Received: from [192.168.1.233] (ip-89-176-99-192.net.upcbroadband.cz. [89.176.99.192]) by mx.google.com with ESMTPSA id pf4sm13737820wjb.23.2015.07.03.07.59.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Jul 2015 07:59:58 -0700 (PDT) Message-ID: <5596A36D.4030008@2ndquadrant.com> Date: Fri, 03 Jul 2015 16:59:57 +0200 From: Petr Jelinek User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Michael Paquier CC: Tom Lane , xi@resolvent.net, PostgreSQL mailing lists , PostgreSQL-development Subject: Re: BUG #13126: table constraint loses its comment References: <20150422154850.5198.26685@wrigleys.postgresql.org> <8519.1429995948@sss.pgh.pa.us> <559547A2.2000204@2ndquadrant.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 2015-07-03 15:50, Michael Paquier wrote: > On Thu, Jul 2, 2015 at 11:16 PM, Petr Jelinek wrote: >> I was going through the code and have few comments: >> - Why do you change the return value of TryReuseIndex? Can't we use reuse >> the same OidIsValid(stmt->oldNode) check that ATExecAddIndex is doing >> instead? > > As pointed out by Heikki previously, that is actually unnecessary, > comments are still lost even if the index is reused for constraints. > So perhaps for simplicity we could just unconditionally recreate the > comments all the time if they are available. > Ah ok, I missed Heikki's email. >> - I think the changes to ATPostAlterTypeParse should follow more closely the >> coding of transformTableLikeClause - namely use the idxcomment > > I am not sure I follow here. Could you elaborate? > Well for indexes you don't really need to add the new AT command, as IndexStmt has char *idxcomment which it will automatically uses as comment if not NULL. While I am not huge fan of the idxcomment it doesn't seem to be easy to remove it in the future and it's what transformTableLikeClause uses so it might be good to be consistent with that. -- Petr Jelinek http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs