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 1n8GAy-0001u7-C1 for pgsql-hackers@arkaria.postgresql.org; Fri, 14 Jan 2022 06:35:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n8GAx-0002dq-7I for pgsql-hackers@arkaria.postgresql.org; Fri, 14 Jan 2022 06:35:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n8GAw-0002dh-Tc for pgsql-hackers@lists.postgresql.org; Fri, 14 Jan 2022 06:35:02 +0000 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1n8GAq-0003dk-7m for pgsql-hackers@postgresql.org; Fri, 14 Jan 2022 06:35:02 +0000 Received: by mail-pl1-x62c.google.com with SMTP id c6so4040234plh.6 for ; Thu, 13 Jan 2022 22:34:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=VEPsggUAyYbcgXOpQNGk2yp6VMlw6ZmNZceZZ9+l1wE=; b=XeXf+E+fNrZboprdJJAAHi9/SIHD7dUNaPlQsnKORyKfxSICJmiBJZ67K9MsWHp/R/ TD30Znn1c9le4LaioiqFX4kUuFghj5kUHrPj0hDkG3mdaTsLFCpAbdJOuYSFUjmjDbPE 2uM6YkQPNL8YjBUGUms6jupKWqDnOKD2qTb4z/5tY0uIUeK1E9xTlOOky6qumT5bpDK1 mky+xru3lOHYHbLWin0wU1YGybnIVHD4+u2zwp11A5CVpM8uPj8zbAF/C78ls785IV/D /bZbdvoVGXDMKBKN6opGl9k1KzBVqT3HH9ruiIxX+SQD4rv2AlLoRvX7/e/A9hFZXtEp 96iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=VEPsggUAyYbcgXOpQNGk2yp6VMlw6ZmNZceZZ9+l1wE=; b=XVsAQqjDA190edQCue+MZX2m+WwJFgO2o+5NYj8w8RfH1qJmMUPt7UH6272RGjzava pZCM2anSD1a+76PUCzk9B8EZgfcl4OtxS6hQn2LjpvWUdzafQIF9yBSE8Q3O6W5BsrSQ aGcFOxb3K1YQyboTA1HHBVuLIOcE2q/LBWu9wOa8D+jWk+Zcr3giH05aA3aBSo4NgEru Vs9q5hAD0VB33t3ZtBNniIym+uNZ2HnWOhiovyO4M5g1f+gTUF7jlTpPo44PMBCzpjc+ Mo256tTYLeHmuKK78w45KddN5YURgIl7Zh6KUIRN7pMHsJhgJL7/8AkzbGyDXXiZQKXx WV8Q== X-Gm-Message-State: AOAM531vIEEQhCXG2NmgN1B42YtrTR/YwCYsOxE/+OAc8tjE8MVKQwHM rzHrpSwTwx7NEMIBpZzf4w0= X-Google-Smtp-Source: ABdhPJyciIikQ3w1FkSoeU+q7w1avoqNC63Ixr4fKSiEmsYtzrTkncYMXAhYvHSqKlg1L40NS1dsxA== X-Received: by 2002:a17:90a:cc03:: with SMTP id b3mr14343833pju.97.1642142093671; Thu, 13 Jan 2022 22:34:53 -0800 (PST) Received: from jrouhaud (1-171-185-43.dynamic-ip.hinet.net. [1.171.185.43]) by smtp.gmail.com with ESMTPSA id oa9sm4484069pjb.31.2022.01.13.22.34.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jan 2022 22:34:53 -0800 (PST) Date: Fri, 14 Jan 2022 14:34:49 +0800 From: Julien Rouhaud To: "houzj.fnst@fujitsu.com" Cc: PostgreSQL Hackers Subject: Re: relcache not invalidated when ADD PRIMARY KEY USING INDEX Message-ID: <20220114063449.3ebk7bun2goahlfq@jrouhaud> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Mon, Dec 20, 2021 at 06:45:33AM +0000, houzj.fnst@fujitsu.com wrote: > > I tried to write a patch to fix this by invalidating the relcache after marking > primary key in index_constraint_create(). The cfbot reports that you have a typo in your regression tests: https://api.cirrus-ci.com/v1/artifact/task/4806573636714496/regress_diffs/contrib/test_decoding/regression.diffs diff -U3 /tmp/cirrus-ci-build/contrib/test_decoding/expected/ddl.out /tmp/cirrus-ci-build/contrib/test_decoding/results/ddl.out --- /tmp/cirrus-ci-build/contrib/test_decoding/expected/ddl.out 2022-01-11 16:46:51.684727957 +0000 +++ /tmp/cirrus-ci-build/contrib/test_decoding/results/ddl.out 2022-01-11 16:50:35.584089784 +0000 @@ -594,7 +594,7 @@ DELETE FROM table_dropped_index_no_pk WHERE b = 1; DELETE FROM table_dropped_index_no_pk WHERE a = 3; DROP TABLE table_dropped_index_no_pk; --- check table with newly added primary key +-- check tables with newly added primary key Could you send an updated patch? As far as I can see the rest of the regression tests succeed so the patch can probably still be reviewed. That being said, there are pending comments by Euler so I think it's appropriate to zsh:1: command not found: q