Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l9jS0-0002ow-C8 for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Feb 2021 06:58:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l9jRz-0005nb-8r for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Feb 2021 06:58:11 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l9jRy-0005nU-Rm for pgsql-hackers@lists.postgresql.org; Wed, 10 Feb 2021 06:58:11 +0000 Received: from mail-io1-xd2c.google.com ([2607:f8b0:4864:20::d2c]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1l9jRv-0005du-U1 for pgsql-hackers@postgresql.org; Wed, 10 Feb 2021 06:58:09 +0000 Received: by mail-io1-xd2c.google.com with SMTP id u20so826127iot.9 for ; Tue, 09 Feb 2021 22:58:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=mBo154i/jbF58tPriZhaNM6Qg4l0EtUeAfZRDlmboSY=; b=KFrsy6Tf+E2SZst3LVgoBnj2iYnUEmRwvN1xFWXoDDMd9p6wWRF7zAqUPTm6aWE7Ue 4lIVxRA52+6rFbdIPEC5D7ZQUrINAdGl5Sj5tKGLTvsVC22KRzaDbjDBWYZiCF0z4lLr 2GLFNQ3r6jz57n6FNGy6Z3xPyla7S1GYCOcMn1moRmfEBdWi/M1DYY+DgM0KfiGRvlSs u2Bj0cGvhWqtZxZXfkgHxOwPk2Oi3TDeTncBM2x6NiL8K6eipmWG+ASA2kYoIqZdrk0J hgfXa3oHGXwvrfEEud+zoOm9/VyTOSsyhys5oYB96S0mBrdRqN6dWUK7UroW4iQAipdk lMZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=mBo154i/jbF58tPriZhaNM6Qg4l0EtUeAfZRDlmboSY=; b=a1bqVUQlxG+/7tmaFe9RhChPN5lAb9EXZ8BAqSUFbtLW+Yp+p9mKZUDXsBemlxHhEy coTVCNjxKkDR8YD4igF6ZkgX87LsQUBpXptPSp9jh/kmlfM7361gQ6NpTo5eWfKO3Ls0 R67rHfNGd0HGDg85LSG2B1CM2GPibNpfHZ8glcV2thqUoc8vUu1UETerAvnMe6d/OSZ3 kZXUavDlwLurzYavj/eiB1bwSTuedaZ8S6uVHBchg5Lh5a3wDwdMeoRUzHoyBeFhBSvl AUozJuAO1CToMmgbb99xtLtWrPfozfNdiuAOm+0qmbsyRAzB0yDmwV2jjhsXWq9KDtPk lHIA== X-Gm-Message-State: AOAM531lu7sg6Sc43WPYu9ltmcyJvFmZEqsEA9TUJxDg5oaE40aMJivP pIm1yHx/opW03RsWOJvy6q5Kuw== X-Google-Smtp-Source: ABdhPJxqyLX5TKyH3gUtcqx4+jNJR/1bhY4Kp634xXr7zYpF4WY8h6eZPfcB2Y0tdST3uERn9khRvQ== X-Received: by 2002:a5d:93c2:: with SMTP id j2mr1444109ioo.166.1612940287150; Tue, 09 Feb 2021 22:58:07 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id n7sm544776ili.79.2021.02.09.22.58.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Feb 2021 22:58:06 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id A7061800A3B; Wed, 10 Feb 2021 00:58:05 -0600 (CST) Date: Wed, 10 Feb 2021 00:58:05 -0600 From: Justin Pryzby To: Michael Paquier Cc: Ronan Dunklau , Tomas Vondra , pgsql-hackers@postgresql.org Subject: Re: Preserve attstattarget on REINDEX CONCURRENTLY Message-ID: <20210210065805.GG20012@telsasoft.com> References: <16628084.uLZWGnKmhe@laptop-ronand> <80274775044a11f6f42af9c39640a055@dunklau.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, Feb 05, 2021 at 11:17:48AM +0900, Michael Paquier wrote: > Let's copy this data in index_concurrently_swap() instead. The > attached patch does that, and adds a test cheaper than what was > proposed. There is a minor release planned for next week, so I may be > +++ b/src/test/regress/sql/create_index.sql > @@ -1103,6 +1104,13 @@ SELECT starelid::regclass, count(*) FROM pg_statistic WHERE starelid IN ( > 'concur_exprs_index_pred'::regclass, > 'concur_exprs_index_pred_2'::regclass) > GROUP BY starelid ORDER BY starelid::regclass::text; > +-- attstattarget should remain intact > +SELECT attrelid::regclass, attnum, attstattarget > + FROM pg_attribute WHERE attrelid IN ( > + 'concur_exprs_index_expr'::regclass, > + 'concur_exprs_index_pred'::regclass, > + 'concur_exprs_index_pred_2'::regclass) > + ORDER BY 'concur_exprs_index_expr'::regclass::text, attnum; If I'm not wrong, you meant to ORDER BY attrelid::regclass::text, attnum; -- Justin