pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Justin Pryzby <pryzby@telsasoft.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Ronan Dunklau <ronan@dunklau.fr>
Cc: Tomas Vondra <tomas.vondra@enterprisedb.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Preserve attstattarget on REINDEX CONCURRENTLY
Date: Wed, 10 Feb 2021 00:58:05 -0600
Message-ID: <20210210065805.GG20012@telsasoft.com> (raw)
In-Reply-To: <YByqzE9qu16vuEB+@paquier.xyz>
References: <16628084.uLZWGnKmhe@laptop-ronand>
	<d4df50ad-fcb0-bc25-d0a4-71e0165b8511@enterprisedb.com>
	<80274775044a11f6f42af9c39640a055@dunklau.fr>
	<YByqzE9qu16vuEB+@paquier.xyz>

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





view thread (11+ messages)  latest in thread

Message-ID: <20210210065805.GG20012@telsasoft.com>
Permalink:  ../20210210065805.GG20012@telsasoft.com/
Also on:    postgresql.org/message-id/20210210065805.GG20012@telsasoft.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: pryzby@telsasoft.com, michael@paquier.xyz, ronan@dunklau.fr, tomas.vondra@enterprisedb.com
  Subject: Re: Preserve attstattarget on REINDEX CONCURRENTLY
  In-Reply-To: <20210210065805.GG20012@telsasoft.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox