Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5y6H-0000iP-HU for pgsql-general@arkaria.postgresql.org; Wed, 03 May 2017 17:30:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d5y6H-0003w9-24 for pgsql-general@arkaria.postgresql.org; Wed, 03 May 2017 17:30:05 +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_2) (envelope-from ) id 1d5y6G-0003vb-AK for pgsql-general@postgresql.org; Wed, 03 May 2017 17:30:04 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d5y6D-0002kQ-MJ for pgsql-general@postgresql.org; Wed, 03 May 2017 17:30:03 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v43HTvdO000650; Wed, 3 May 2017 13:29:57 -0400 From: Tom Lane To: Adrian Klaver cc: Philippe BEAUDOIN , pgsql-general@postgresql.org Subject: Re: Column rename in an extension update script In-reply-to: <331e2430-9c74-ebeb-6e6c-e2257058bf92@aklaver.com> References: <2cf7941e-4e41-7714-3de8-37b1a8f74dff@free.fr> <331e2430-9c74-ebeb-6e6c-e2257058bf92@aklaver.com> Comments: In-reply-to Adrian Klaver message dated "Wed, 03 May 2017 10:10:44 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <648.1493832597.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 03 May 2017 13:29:57 -0400 Message-ID: <649.1493832597@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org Adrian Klaver writes: > On 04/30/2017 11:54 PM, Philippe BEAUDOIN wrote: >> Just after the ALTER TABLE statement, I want to access this table. But >> at this time, the altered column is not visible with its new name. > From the error it looks to me like the statements are each run in a=20 > separate session and the UPDATE is not seeing the ALTER TABLE. No, it's in the same session; the problem is the lack of a CommandCounterIncrement call between the ALTER's update and the parsing of the next statement. That means the update isn't visible yet, even in its own session. See the fix here: https://git.postgresql.org/gitweb/?p=3Dpostgresql.git;a=3Dcommitdiff;h=3D92= 09e07605afe0349660447f20d83ef165cdd0ae regards, tom lane --=20 Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general